Chapter 5 - 5.2 - 15
file:bd5-2p15.mws
| > | restart; |
Define the differential equation
| > | ode := diff(y(x),x,x) - x*diff(y(x),x) -y(x) =0; |
Define the initial conditions - notice the special form for y'(0)
| > | ics := y(0)=2, D(y)(0)=1; |
Use the Maple command dsolve with the series option to construct a power series about x=0
| > | dsolve({ode,ics},y(x),series); |
I copied 4 terms and defined y4
| > | y4 := 2+1*x+1*x^2+1/3*x^3; |
| > | y5 := 2+1*x+1*x^2+1/3*x^3+x^4/4; |
Graph of y4 and y5 - which is red?
| > | plot({y4,y5},x=0..5); |
Construct the exact solution - this may or may not work
| > | dsolve({ode,ics},y(x)); |
| > | soln := rhs(%); |
Compute the power series of exact solution up to order x^5
| > | series(soln,x=0,5); |
| > | plot({y4,y5,soln},x=0..1); |
| > |