MapleSeriesCosh.mws

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).

diff(y(x),x,x)-4*y(x) = 0

y(0) = 0, D(y)(0) = 2

>    ode:=diff(y(x),x,x)-4*y(x)=0;

ode := diff(y(x),`$`(x,2))-4*y(x) = 0

>    Order:=8;

Order := 8

>    dsolve({ode,y(0)=0,D(y)(0)=2},y(x),type=series);

y(x) = series(2*x+4/3*x^3+4/15*x^5+8/315*x^7+O(x^8),x,8)

>    rhs(%);

series(2*x+4/3*x^3+4/15*x^5+8/315*x^7+O(x^8),x,8)

>    poly:=convert(%,polynom);

poly := 2*x+4/3*x^3+4/15*x^5+8/315*x^7

>    with(plots):AnalSoln:=plot(sinh(2*x),x=0..5,color=red):

>    SeriesSoln:=plot(poly,x=0..5,color=blue):

>    display(SeriesSoln,AnalSoln);

[Maple Plot]

>    Order:=12;

Order := 12

>    dsolve({ode,y(0)=0,D(y)(0)=2},y(x),type=series);

y(x) = series(2*x+4/3*x^3+4/15*x^5+8/315*x^7+4/2835*x^9+8/155925*x^11+O(x^12),x,12)

>    rhs(%);

series(2*x+4/3*x^3+4/15*x^5+8/315*x^7+4/2835*x^9+8/155925*x^11+O(x^12),x,12)

>    poly:=convert(%,polynom);

poly := 2*x+4/3*x^3+4/15*x^5+8/315*x^7+4/2835*x^9+8/155925*x^11

>    SeriesSoln:=plot(poly,x=0..5,color=blue):

>    display(SeriesSoln,AnalSoln);

[Maple Plot]

>    Order:=16;

Order := 16

>    dsolve({ode,y(0)=0,D(y)(0)=2},y(x),type=series);

y(x) = series(2*x+4/3*x^3+4/15*x^5+8/315*x^7+4/2835*x^9+8/155925*x^11+8/6081075*x^13+16/638512875*x^15+O(x^16),x,16)

>    rhs(%);

series(2*x+4/3*x^3+4/15*x^5+8/315*x^7+4/2835*x^9+8/155925*x^11+8/6081075*x^13+16/638512875*x^15+O(x^16),x,16)

>    poly:=convert(%,polynom);

poly := 2*x+4/3*x^3+4/15*x^5+8/315*x^7+4/2835*x^9+8/155925*x^11+8/6081075*x^13+16/638512875*x^15

>    SeriesSoln:=plot(poly,x=0..5,color=blue):

>    display(SeriesSoln,AnalSoln);

[Maple Plot]

>    Order:=20;

Order := 20

>    dsolve({ode,y(0)=0,D(y)(0)=2},y(x),type=series);

y(x) = series(2*x+4/3*x^3+4/15*x^5+8/315*x^7+4/2835*x^9+8/155925*x^11+8/6081075*x^13+16/638512875*x^15+4/10854718875*x^17+8/1856156927625*x^19+O(x^20),x,20)

>    rhs(%);

series(2*x+4/3*x^3+4/15*x^5+8/315*x^7+4/2835*x^9+8/155925*x^11+8/6081075*x^13+16/638512875*x^15+4/10854718875*x^17+8/1856156927625*x^19+O(x^20),x,20)

>    poly:=convert(%,polynom);

poly := 2*x+4/3*x^3+4/15*x^5+8/315*x^7+4/2835*x^9+8/155925*x^11+8/6081075*x^13+16/638512875*x^15+4/10854718875*x^17+8/1856156927625*x^19

>    SeriesSoln:=plot(poly,x=0..5,color=blue):

>    display(SeriesSoln,AnalSoln);

[Maple Plot]

>    dsolve({ode},y(x));

{y(x) = _C1*exp(-2*x)+_C2*exp(2*x)}

>    dsolve({ode,y(0)=0,D(y)(0)=2},y(x));

y(x) = -1/2*exp(-2*x)+1/2*exp(2*x)

>