MapleSeriesEx4.mws

Series Solution Example Number 4

With initial conditions

Truncated series solutions are graphed in blue (Order = 8), red (Order = 12), green (Order = 16), and black (Order = 32) .

>    ode:=diff(y(x),x,x)-4*x*diff(y(x),x)+x*y(x)=-sin(x)-4*x*cos(x)+x*sin(x);

ode := diff(y(x),`$`(x,2))-4*x*diff(y(x),x)+x*y(x) = -sin(x)-4*x*cos(x)+x*sin(x)

>    Order:=8;

Order := 8

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

y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+O(x^8),x,8)

>    rhs(%);

series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+O(x^8),x,8)

>    poly1:=convert(%,polynom);

poly1 := 1+x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7

>    with(plots):

>    SeriesSoln1:=plot(poly1,x=0..7,color=blue):

>    display(SeriesSoln1);

[Maple Plot]

>    Order:=12;

Order := 12

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

y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+O(x^12),x,12)

>    rhs(%);

series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+O(x^12),x,12)

>    poly2:=convert(%,polynom);

poly2 := 1+x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11

>    SeriesSoln2:=plot(poly2,x=0..7,color=red):

>    display(SeriesSoln1,SeriesSoln2);

[Maple Plot]

>    Order:=16;

Order := 16

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

y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/11887948...
y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/11887948...

>    rhs(%);

series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/118879488000*x^...
series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/118879488000*x^...

>    poly3:=convert(%,polynom);

poly3 := 1+x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/118879488000*x^...
poly3 := 1+x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/118879488000*x^...

>    SeriesSoln3:=plot(poly3,x=0..7,color=green):

>    display(SeriesSoln1,SeriesSoln2,SeriesSoln3);

[Maple Plot]

>    soln1:=plot(poly1,x=0..4,y=-100..2,color=blue):

>    soln2:=plot(poly2,x=0..4,y=-100..2,color=red):

>    soln3:=plot(poly3,x=0..4,y=-100..2,color=green):

>    display(soln1,soln2,soln3);

[Maple Plot]

>    Order:=32;

Order := 32

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

y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/11887948...
y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/11887948...
y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/11887948...
y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/11887948...
y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/11887948...
y(x) = series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/11887948...

>    rhs(%);

series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/118879488000*x^...
series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/118879488000*x^...
series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/118879488000*x^...
series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/118879488000*x^...
series(1+1*x-1/3*x^3-11/120*x^5+1/180*x^6-241/5040*x^7+1/240*x^8-2249/120960*x^9+19/9450*x^10-244441/39916800*x^11+8983/11975040*x^12-309589/177914880*x^13+42043/181621440*x^14-51647563/118879488000*x^...

>    poly4:=convert(%,polynom);

poly4 := 1+x-337188246007/17377871486976000*x^19-1845147022809820985971201/8222838654177922817725562880000000*x^31-241/5040*x^7-1/3*x^3+19/9450*x^10-309589/177914880*x^13+953731/15567552000*x^16-142783...
poly4 := 1+x-337188246007/17377871486976000*x^19-1845147022809820985971201/8222838654177922817725562880000000*x^31-241/5040*x^7-1/3*x^3+19/9450*x^10-309589/177914880*x^13+953731/15567552000*x^16-142783...
poly4 := 1+x-337188246007/17377871486976000*x^19-1845147022809820985971201/8222838654177922817725562880000000*x^31-241/5040*x^7-1/3*x^3+19/9450*x^10-309589/177914880*x^13+953731/15567552000*x^16-142783...
poly4 := 1+x-337188246007/17377871486976000*x^19-1845147022809820985971201/8222838654177922817725562880000000*x^31-241/5040*x^7-1/3*x^3+19/9450*x^10-309589/177914880*x^13+953731/15567552000*x^16-142783...
poly4 := 1+x-337188246007/17377871486976000*x^19-1845147022809820985971201/8222838654177922817725562880000000*x^31-241/5040*x^7-1/3*x^3+19/9450*x^10-309589/177914880*x^13+953731/15567552000*x^16-142783...
poly4 := 1+x-337188246007/17377871486976000*x^19-1845147022809820985971201/8222838654177922817725562880000000*x^31-241/5040*x^7-1/3*x^3+19/9450*x^10-309589/177914880*x^13+953731/15567552000*x^16-142783...

>    with(plots):

>    SeriesSoln4:=plot(poly4,x=0..7,color=black):

>    display(SeriesSoln4);

[Maple Plot]

>    soln4:=plot(poly4,x=0..4,y=-100..2,color=black):

>    display(soln1,soln2,soln3,soln4);

[Maple Plot]

>    soln1:=plot(poly1,x=0..2,y=-1..2,color=blue):

>    soln2:=plot(poly2,x=0..2,y=-1..2,color=red):

>    soln3:=plot(poly3,x=0..2,y=-1..2,color=green):

>    display(soln1,soln2,soln3);

[Maple Plot]

Changing an initial condition in finding soln5 (orange) produces what?

>    Order:=16;

Order := 16

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

y(x) = series(1*x-1/6*x^3+1/120*x^5-1/5040*x^7+1/362880*x^9-1/39916800*x^11+1/6227020800*x^13-1/1307674368000*x^15+O(x^16),x,16)

>    rhs(%);

series(1*x-1/6*x^3+1/120*x^5-1/5040*x^7+1/362880*x^9-1/39916800*x^11+1/6227020800*x^13-1/1307674368000*x^15+O(x^16),x,16)

>    poly5:=convert(%,polynom);

poly5 := x-1/6*x^3+1/120*x^5-1/5040*x^7+1/362880*x^9-1/39916800*x^11+1/6227020800*x^13-1/1307674368000*x^15

>    soln1:=plot(poly1,x=0..3.14,y=-1..2,color=blue):

>    soln2:=plot(poly2,x=0..3.14,y=-1..2,color=red):

>    soln3:=plot(poly3,x=0..3.14,y=-1..2,color=green):

>    soln5:=plot(poly5,x=0..3.14,y=-1..2,color=orange):

>    display(soln1,soln2,soln3,soln5);

[Maple Plot]

We can see below that maybe the computer does not yet know everything (and it took a long time on this one).

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

y(x) = (((17*I*cos(2)+17*sin(2))*x-I*cos(2)-4*I*sin(2)+4*cos(2)-sin(2))*exp(-I*(x-2))+17*exp((x-2)*I)*((-I*cos(2)+sin(2))*x-4/17*I*sin(2)+1/17*I*cos(2)-1/17*sin(2)-4/17*cos(2)))/(-2-8*I+34*x)
y(x) = (((17*I*cos(2)+17*sin(2))*x-I*cos(2)-4*I*sin(2)+4*cos(2)-sin(2))*exp(-I*(x-2))+17*exp((x-2)*I)*((-I*cos(2)+sin(2))*x-4/17*I*sin(2)+1/17*I*cos(2)-1/17*sin(2)-4/17*cos(2)))/(-2-8*I+34*x)

>   

>