2.4.17 Problem 17

Maple
Mathematica
Sympy

Internal problem ID [8905]
Book : Own collection of miscellaneous problems
Section : section 4.0
Problem number : 17
Date solved : Friday, April 25, 2025 at 05:22:52 PM
CAS classification : [_Lienard]

Solve

xy+2y+xy=0

With initial conditions

y(0)=1y(0)=0

Using series expansion around x=0

The type of the expansion point is first determined. This is done on the homogeneous part of the ODE.

xy+2y+xy=0

The following is summary of singularities for the above ode. Writing the ode as

y+p(x)y+q(x)y=0

Where

p(x)=2xq(x)=1
Table 2.73: Table p(x),q(x) singularites.
p(x)=2x
singularity type
x=0 “regular”
q(x)=1
singularity type

Combining everything together gives the following summary of singularities for the ode as

Regular singular points : [0]

Irregular singular points : []

Since x=0 is regular singular point, then Frobenius power series is used. The ode is normalized to be

xy+2y+xy=0

Let the solution be represented as Frobenius power series of the form

y=n=0anxn+r

Then

y=n=0(n+r)anxn+r1y=n=0(n+r)(n+r1)anxn+r2

Substituting the above back into the ode gives

(1)x(n=0(n+r)(n+r1)anxn+r2)+2(n=0(n+r)anxn+r1)+x(n=0anxn+r)=0

Which simplifies to

(2A)(n=0xn+r1an(n+r)(n+r1))+(n=02(n+r)anxn+r1)+(n=0x1+n+ran)=0

The next step is to make all powers of x be n+r1 in each summation term. Going over each summation term above with power of x in it which is not already xn+r1 and adjusting the power and the corresponding index gives

n=0x1+n+ran=n=2an2xn+r1

Substituting all the above in Eq (2A) gives the following equation where now all powers of x are the same and equal to n+r1.

(2B)(n=0xn+r1an(n+r)(n+r1))+(n=02(n+r)anxn+r1)+(n=2an2xn+r1)=0

The indicial equation is obtained from n=0. From Eq (2B) this gives

xn+r1an(n+r)(n+r1)+2(n+r)anxn+r1=0

When n=0 the above becomes

x1+ra0r(1+r)+2ra0x1+r=0

Or

(x1+rr(1+r)+2rx1+r)a0=0

Since a00 then the above simplifies to

rx1+r(1+r)=0

Since the above is true for all x then the indicial equation becomes

r(1+r)=0

Solving for r gives the roots of the indicial equation as

r1=0r2=1

Since a00 then the indicial equation becomes

rx1+r(1+r)=0

Solving for r gives the roots of the indicial equation as [0,1].

Since r1r2=1 is an integer, then we can construct two linearly independent solutions

y1(x)=xr1(n=0anxn)y2(x)=Cy1(x)ln(x)+xr2(n=0bnxn)

Or

y1(x)=n=0anxny2(x)=Cy1(x)ln(x)+n=0bnxnx

Or

y1(x)=n=0anxny2(x)=Cy1(x)ln(x)+(n=0bnxn1)

Where C above can be zero. We start by finding y1. Eq (2B) derived above is now used to find all an coefficients. The case n=0 is skipped since it was used to find the roots of the indicial equation. a0 is arbitrary and taken as a0=1. Substituting n=1 in Eq. (2B) gives

a1=0

For 2n the recursive equation is

(3)an(n+r)(n+r1)+2an(n+r)+an2=0

Solving for an from recursive equation (4) gives

(4)an=an2n2+2nr+r2+n+r

Which for the root r=0 becomes

(5)an=an2n(1+n)

At this point, it is a good idea to keep track of an in a table both before substituting r=0 and after as more terms are found using the above recursive equation.

n an,r an
a0 1 1
a1 0 0

For n=2, using the above recursive equation gives

a2=1r2+5r+6

Which for the root r=0 becomes

a2=16

And the table now becomes

n an,r an
a0 1 1
a1 0 0
a2 1r2+5r+6 16

For n=3, using the above recursive equation gives

a3=0

And the table now becomes

n an,r an
a0 1 1
a1 0 0
a2 1r2+5r+6 16
a3 0 0

For n=4, using the above recursive equation gives

a4=1r4+14r3+71r2+154r+120

Which for the root r=0 becomes

a4=1120

And the table now becomes

n an,r an
a0 1 1
a1 0 0
a2 1r2+5r+6 16
a3 0 0
a4 1r4+14r3+71r2+154r+120 1120

For n=5, using the above recursive equation gives

a5=0

And the table now becomes

n an,r an
a0 1 1
a1 0 0
a2 1r2+5r+6 16
a3 0 0
a4 1r4+14r3+71r2+154r+120 1120
a5 0 0

Using the above table, then the solution y1(x) is

y1(x)=a0+a1x+a2x2+a3x3+a4x4+a5x5+a6x6=1x26+x4120+O(x6)

Now the second solution y2(x) is found. Let

r1r2=N

Where N is positive integer which is the difference between the two roots. r1 is taken as the larger root. Hence for this problem we have N=1. Now we need to determine if C is zero or not. This is done by finding limrr2a1(r). If this limit exists, then C=0, else we need to keep the log term and C0. The above table shows that

aN=a1=0

Therefore

limrr20=limr10=0

The limit is 0. Since the limit exists then the log term is not needed and we can set C=0. Therefore the second solution has the form

y2(x)=n=0bnxn+r=n=0bnxn1

Eq (3) derived above is used to find all bn coefficients. The case n=0 is skipped since it was used to find the roots of the indicial equation. b0 is arbitrary and taken as b0=1. Substituting n=1 in Eq(3) gives

b1=0

For 2n the recursive equation is

(4)bn(n+r)(n+r1)+2(n+r)bn+bn2=0

Which for for the root r=1 becomes

(4A)bn(n1)(n2)+2(n1)bn+bn2=0

Solving for bn from the recursive equation (4) gives

(5)bn=bn2n2+2nr+r2+n+r

Which for the root r=1 becomes

(6)bn=bn2n2n

At this point, it is a good idea to keep track of bn in a table both before substituting r=1 and after as more terms are found using the above recursive equation.

n bn,r bn
b0 1 1
b1 0 0

For n=2, using the above recursive equation gives

b2=1r2+5r+6

Which for the root r=1 becomes

b2=12

And the table now becomes

n bn,r bn
b0 1 1
b1 0 0
b2 1r2+5r+6 12

For n=3, using the above recursive equation gives

b3=0

And the table now becomes

n bn,r bn
b0 1 1
b1 0 0
b2 1r2+5r+6 12
b3 0 0

For n=4, using the above recursive equation gives

b4=1(r2+5r+6)(r2+9r+20)

Which for the root r=1 becomes

b4=124

And the table now becomes

n bn,r bn
b0 1 1
b1 0 0
b2 1r2+5r+6 12
b3 0 0
b4 1r4+14r3+71r2+154r+120 124

For n=5, using the above recursive equation gives

b5=0

And the table now becomes

n bn,r bn
b0 1 1
b1 0 0
b2 1r2+5r+6 12
b3 0 0
b4 1r4+14r3+71r2+154r+120 124
b5 0 0

Using the above table, then the solution y2(x) is

y2(x)=1(b0+b1x+b2x2+b3x3+b4x4+b5x5+b6x6)=1x22+x424+O(x6)x

Therefore the homogeneous solution is

yh(x)=c1y1(x)+c2y2(x)=c1(1x26+x4120+O(x6))+c2(1x22+x424+O(x6))x

Hence the final solution is

y=yh=c1(1x26+x4120+O(x6))+c2(1x22+x424+O(x6))x

Initial conditions are now used to to solve for the constants of integrations. This results in

y=1x26+x4120+O(x6)
Figure 2.184: Solution plot
Maple. Time used: 0.004 (sec). Leaf size: 14
Order:=6; 
ode:=x*diff(diff(y(x),x),x)+2*diff(y(x),x)+x*y(x) = 0; 
ic:=y(0) = 1, D(y)(0) = 0; 
dsolve([ode,ic],y(x),type='series',x=0);
 
y=116x2+1120x4+O(x6)

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
checking if the LODE has constant coefficients 
checking if the LODE is of Euler type 
trying a symmetry of the form [xi=0, eta=F(x)] 
checking if the LODE is missing y 
-> Trying a Liouvillian solution using Kovacics algorithm 
   A Liouvillian solution exists 
   Group is reducible or imprimitive 
<- Kovacics algorithm successful
 

Maple step by step

Let’s solve[x(ddxddxy(x))+2ddxy(x)+xy(x)=0,y(0)=1,(ddxy(x))|{x=0}=0]Highest derivative means the order of the ODE is2ddxddxy(x)Isolate 2nd derivativeddxddxy(x)=y(x)2(ddxy(x))xGroup terms withy(x)on the lhs of the ODE and the rest on the rhs of the ODE; ODE is linearddxddxy(x)+2(ddxy(x))x+y(x)=0Check to see ifx0=0is a regular singular pointDefine functions[P2(x)=2x,P3(x)=1]xP2(x)is analytic atx=0(xP2(x))|x=0=2x2P3(x)is analytic atx=0(x2P3(x))|x=0=0x=0is a regular singular pointCheck to see ifx0=0is a regular singular pointx0=0Multiply by denominatorsx(ddxddxy(x))+2ddxy(x)+xy(x)=0Assume series solution fory(x)y(x)=k=0akxk+rRewrite ODE with series expansionsConvertxy(x)to series expansionxy(x)=k=0akxk+r+1Shift index usingk>k1xy(x)=k=1ak1xk+rConvertddxy(x)to series expansionddxy(x)=k=0ak(k+r)xk+r1Shift index usingk>k+1ddxy(x)=k=1ak+1(k+r+1)xk+rConvertx(ddxddxy(x))to series expansionx(ddxddxy(x))=k=0ak(k+r)(k+r1)xk+r1Shift index usingk>k+1x(ddxddxy(x))=k=1ak+1(k+r+1)(k+r)xk+rRewrite ODE with series expansionsa0r(1+r)x1+r+a1(1+r)(2+r)xr+(k=1(ak+1(k+r+1)(k+2+r)+ak1)xk+r)=0a0cannot be 0 by assumption, giving the indicial equationr(1+r)=0Values of r that satisfy the indicial equationr{1,0}Each term must be 0a1(1+r)(2+r)=0Each term in the series must be 0, giving the recursion relationak+1(k+r+1)(k+2+r)+ak1=0Shift index usingk>k+1ak+2(k+2+r)(k+3+r)+ak=0Recursion relation that defines series solution to ODEak+2=ak(k+2+r)(k+3+r)Recursion relation forr=1ak+2=ak(k+1)(k+2)Solution forr=1[y(x)=k=0akxk1,ak+2=ak(k+1)(k+2),0=0]Recursion relation forr=0ak+2=ak(k+2)(k+3)Solution forr=0[y(x)=k=0akxk,ak+2=ak(k+2)(k+3),2a1=0]Combine solutions and rename parameters[y(x)=(k=0akxk1)+(k=0bkxk),ak+2=ak(k+1)(k+2),0=0,bk+2=bk(k+2)(k+3),2b1=0]
Mathematica. Time used: 0.204 (sec). Leaf size: 19
ode=x*D[y[x],{x,2}]+2*D[y[x],x]+x*y[x]==0; 
ic={y[0]==1,Derivative[1][y][0] ==0}; 
AsymptoticDSolveValue[{ode,ic},y[x],{x,0,5}]
 
y(x)x4120x26+1
Sympy. Time used: 0.857 (sec). Leaf size: 39
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(x*y(x) + x*Derivative(y(x), (x, 2)) + 2*Derivative(y(x), x),0) 
ics = {y(0): 1, Subs(Derivative(y(x), x), x, 0): 0} 
dsolve(ode,func=y(x),ics=ics,hint="2nd_power_series_regular",x0=0,n=6)
 
y(x)=C2(x4120x26+1)+C1(x6720+x424x22+1)x+O(x6)