Series Solution sinh(2x)
Comparison with the analytical solution
Truncated series solutions are graphed in blue (SeriesSoln). The analytical solution is graphed in red (AnalSoln).
> | ode:=diff(y(x),x,x)-4*y(x)=0; |
> | Order:=8; |
> | dsolve({ode,y(0)=0,D(y)(0)=2},y(x),type=series); |
> | rhs(%); |
> | poly:=convert(%,polynom); |
> | with(plots):AnalSoln:=plot(sinh(2*x),x=0..5,color=red): |
> | SeriesSoln:=plot(poly,x=0..5,color=blue): |
> | display(SeriesSoln,AnalSoln); |
> | Order:=12; |
> | dsolve({ode,y(0)=0,D(y)(0)=2},y(x),type=series); |
> | rhs(%); |
> | poly:=convert(%,polynom); |
> | SeriesSoln:=plot(poly,x=0..5,color=blue): |
> | display(SeriesSoln,AnalSoln); |
> | Order:=16; |
> | dsolve({ode,y(0)=0,D(y)(0)=2},y(x),type=series); |
> | rhs(%); |
> | poly:=convert(%,polynom); |
> | SeriesSoln:=plot(poly,x=0..5,color=blue): |
> | display(SeriesSoln,AnalSoln); |
> | Order:=20; |
> | dsolve({ode,y(0)=0,D(y)(0)=2},y(x),type=series); |
> | rhs(%); |
> | poly:=convert(%,polynom); |
> | SeriesSoln:=plot(poly,x=0..5,color=blue): |
> | display(SeriesSoln,AnalSoln); |
> | dsolve({ode},y(x)); |
> | dsolve({ode,y(0)=0,D(y)(0)=2},y(x)); |
> |