2.1.253 Problem 256

Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [9425]
Book : Collection of Kovacic problems
Section : section 1
Problem number : 256
Date solved : Wednesday, March 05, 2025 at 07:49:04 AM
CAS classification : [_Lienard]

Solve

xy+2y+xy=0

Solved as second order ode using Kovacic algorithm

Time used: 0.119 (sec)

Writing the ode as

(1)xy+2y+xy=0(2)Ay+By+Cy=0

Comparing (1) and (2) shows that

A=x(3)B=2C=x

Applying the Liouville transformation on the dependent variable gives

z(x)=yeB2Adx

Then (2) becomes

(4)z(x)=rz(x)

Where r is given by

(5)r=st=2AB2BA+B24AC4A2

Substituting the values of A,B,C from (3) in the above and simplifying gives

(6)r=11

Comparing the above to (5) shows that

s=1t=1

Therefore eq. (4) becomes

(7)z(x)=z(x)

Equation (7) is now solved. After finding z(x) then y is found using the inverse transformation

y=z(x)eB2Adx

The first step is to determine the case of Kovacic algorithm this ode belongs to. There are 3 cases depending on the order of poles of r and the order of r at . The following table summarizes these cases.

Case

Allowed pole order for r

Allowed value for O()

1

{0,1,2,4,6,8,}

{,6,4,2,0,2,3,4,5,6,}

2

Need to have at least one pole that is either order 2 or odd order greater than 2. Any other pole order is allowed as long as the above condition is satisfied. Hence the following set of pole orders are all allowed. {1,2},{1,3},{2},{3},{3,4},{1,2,5}.

no condition

3

{1,2}

{2,3,4,5,6,7,}

Table 2.253: Necessary conditions for each Kovacic case

The order of r at is the degree of t minus the degree of s. Therefore

O()=deg(t)deg(s)=00=0

There are no poles in r. Therefore the set of poles Γ is empty. Since there is no odd order pole larger than 2 and the order at is 0 then the necessary conditions for case one are met. Therefore

L=[1]

Since r=1 is not a function of x, then there is no need run Kovacic algorithm to obtain a solution for transformed ode z=rz as one solution is

z1(x)=cos(x)

Using the above, the solution for the original ode can now be found. The first solution to the original ode in y is found from

y1=z1e12BAdx=z1e122xdx=z1eln(x)=z1(1x)

Which simplifies to

y1=cos(x)x

The second solution y2 to the original ode is found using reduction of order

y2=y1eBAdxy12dx

Substituting gives

y2=y1e2xdx(y1)2dx=y1e2ln(x)(y1)2dx=y1(tan(x))

Therefore the solution is

y=c1y1+c2y2=c1(cos(x)x)+c2(cos(x)x(tan(x)))

Will add steps showing solving for IC soon.

Maple. Time used: 0.005 (sec). Leaf size: 17
ode:=diff(diff(y(x),x),x)*x+2*diff(y(x),x)+x*y(x) = 0; 
dsolve(ode,y(x), singsol=all);
 
y=sin(x)c1+cos(x)c2x

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(d2dx2y(x))x+2ddxy(x)+xy(x)=0Highest derivative means the order of the ODE is2d2dx2y(x)Isolate 2nd derivatived2dx2y(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 lineard2dx2y(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 denominators(d2dx2y(x))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(d2dx2y(x))to series expansionx(d2dx2y(x))=k=0ak(k+r)(k+r1)xk+r1Shift index usingk>k+1x(d2dx2y(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.027 (sec). Leaf size: 37
ode=x*D[y[x],{x,2}]+2*D[y[x],x]+x*y[x]==0; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)2c1eixic2eix2x
Sympy. Time used: 0.205 (sec). Leaf size: 20
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 = {} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=C1J12(x)+C2Y12(x)x