2.2.14 Problem 15

Solved as second order Euler type ode
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [9137]
Book : Second order enumerated odes
Section : section 2
Problem number : 15
Date solved : Sunday, March 30, 2025 at 02:23:09 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

Solved as second order Euler type ode

Time used: 0.200 (sec)

Solve

y2yx2=xex

This is second order non-homogeneous ODE. In standard form the ODE is

Ay(x)+By(x)+Cy(x)=f(x)

Where A=x2,B=0,C=2,f(x)=x3ex. Let the solution be

y=yh+yp

Where yh is the solution to the homogeneous ODE Ay(x)+By(x)+Cy(x)=0, and yp is a particular solution to the non-homogeneous ODE Ay(x)+By(x)+Cy(x)=f(x). Solving for yh from

x2y2y=0

This is Euler second order ODE. Let the solution be y=xr, then y=rxr1 and y=r(r1)xr2. Substituting these back into the given ODE gives

x2(r(r1))xr2+0rxr12xr=0

Simplifying gives

r(r1)xr+0xr2xr=0

Since xr0 then dividing throughout by xr gives

r(r1)+02=0

Or

(1)r2r2=0

Equation (1) is the characteristic equation. Its roots determine the form of the general solution. Using the quadratic equation the roots are

r1=1r2=2

Since the roots are real and distinct, then the general solution is

y=c1y1+c2y2

Where y1=xr1 and y2=xr2. Hence

y=c1x+c2x2

Next, we find the particular solution to the ODE

x2y2y=x3ex

The particular solution yp can be found using either the method of undetermined coefficients, or the method of variation of parameters. The method of variation of parameters will be used as it is more general and can be used when the coefficients of the ODE depend on x as well. Let

(1)yp(x)=u1y1+u2y2

Where u1,u2 to be determined, and y1,y2 are the two basis solutions (the two linearly independent solutions of the homogeneous ODE) found earlier when solving the homogeneous ODE as

y1=1xy2=x2

In the Variation of parameters u1,u2 are found using

(2)u1=y2f(x)aW(x)(3)u2=y1f(x)aW(x)

Where W(x) is the Wronskian and a is the coefficient in front of y in the given ODE. The Wronskian is given by W=|y1y2y1y2|. Hence

W=|1xx2ddx(1x)ddx(x2)|

Which gives

W=|1xx21x22x|

Therefore

W=(1x)(2x)(x2)(1x2)

Which simplifies to

W=3

Which simplifies to

W=3

Therefore Eq. (2) becomes

u1=x5ex3x2dx

Which simplifies to

u1=x3ex3dx

Hence

u1=2x7/2ex3+14x3ex3+28x5/2ex+140x2ex+560x3/2ex+1680xex+3360xex+3360ex

And Eq. (3) becomes

u2=x2ex3x2dx

Which simplifies to

u2=ex3dx

Hence

u2=2xex32ex3

Therefore the particular solution, from equation (1) is

yp(x)=2x7/2ex3+14x3ex3+28x5/2ex+140x2ex+560x3/2ex+1680xex+3360xex+3360exx+x2(2xex32ex3)

Which simplifies to

yp(x)=4ex(7x5/2+140x3/2+x3+35x2+840x+420x+840)x

Therefore the general solution is

y=yh+yp=4ex(7x5/2+140x3/2+x3+35x2+840x+420x+840)x+c1x+c2x2

Will add steps showing solving for IC soon.

Summary of solutions found

y=4ex(7x5/2+140x3/2+x3+35x2+840x+420x+840)x+c1x+c2x2

Solved as second order ode using Kovacic algorithm

Time used: 0.188 (sec)

Solve

y2yx2=xex

Writing the ode as

(1)y2yx2=0(2)Ay+By+Cy=0

Comparing (1) and (2) shows that

A=1(3)B=0C=2x2

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=2x2

Comparing the above to (5) shows that

s=2t=x2

Therefore eq. (4) becomes

(7)z(x)=(2x2)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.31: 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)=20=2

The poles of r in eq. (7) and the order of each pole are determined by solving for the roots of t=x2. There is a pole at x=0 of order 2. Since there is no odd order pole larger than 2 and the order at is 2 then the necessary conditions for case one are met. Since there is a pole of order 2 then necessary conditions for case two are met. Since pole order is not larger than 2 and the order at is 2 then the necessary conditions for case three are met. Therefore

L=[1,2,4,6,12]

Attempting to find a solution using case n=1.

Looking at poles of order 2. The partial fractions decomposition of r is

r=2x2

For the pole at x=0 let b be the coefficient of 1x2 in the partial fractions decomposition of r given above. Therefore b=2. Hence

[r]c=0αc+=12+1+4b=2αc=121+4b=1

Since the order of r at is 2 then [r]=0. Let b be the coefficient of 1x2 in the Laurent series expansion of r at . which can be found by dividing the leading coefficient of s by the leading coefficient of t from

r=st=2x2

Since the gcd(s,t)=1. This gives b=2. Hence

[r]=0α+=12+1+4b=2α=121+4b=1

The following table summarizes the findings so far for poles and for the order of r at where r is

r=2x2

pole c location pole order [r]c αc+ αc
0 2 0 2 1

Order of r at [r] α+ α
2 0 2 1

Now that the all [r]c and its associated αc± have been determined for all the poles in the set Γ and [r] and its associated α± have also been found, the next step is to determine possible non negative integer d from these using

d=αs()cΓαcs(c)

Where s(c) is either + or and s() is the sign of α±. This is done by trial over all set of families s=(s(c))cΓ until such d is found to work in finding candidate ω. Trying α=1 then

d=α(αc1)=1(1)=0

Since d an integer and d0 then it can be used to find ω using

ω=cΓ(s(c)[r]c+αcs(c)xc)+s()[r]

The above gives

ω=(()[r]c1+αc1xc1)+()[r]=1x+()(0)=1x=1x

Now that ω is determined, the next step is find a corresponding minimal polynomial p(x) of degree d=0 to solve the ode. The polynomial p(x) needs to satisfy the equation

(1A)p+2ωp+(ω+ω2r)p=0

Let

(2A)p(x)=1

Substituting the above in eq. (1A) gives

(0)+2(1x)(0)+((1x2)+(1x)2(2x2))=00=0

The equation is satisfied since both sides are zero. Therefore the first solution to the ode z=rz is

z1(x)=peωdx=e1xdx=1x

The first solution to the original ode in y is found from

y1=z1e12BAdx

Since B=0 then the above reduces to

y1=z1=1x

Which simplifies to

y1=1x

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

y2=y1eBAdxy12dx

Since B=0 then the above becomes

y2=y11y12dx=1x11x2dx=1x(x33)

Therefore the solution is

y=c1y1+c2y2=c1(1x)+c2(1x(x33))

This is second order nonhomogeneous ODE. Let the solution be

y=yh+yp

Where yh is the solution to the homogeneous ODE Ay(x)+By(x)+Cy(x)=0, and yp is a particular solution to the nonhomogeneous ODE Ay(x)+By(x)+Cy(x)=f(x). yh is the solution to

y2yx2=0

The homogeneous solution is found using the Kovacic algorithm which results in

yh=c1x+c2x23

The particular solution yp can be found using either the method of undetermined coefficients, or the method of variation of parameters. The method of variation of parameters will be used as it is more general and can be used when the coefficients of the ODE depend on x as well. Let

(1)yp(x)=u1y1+u2y2

Where u1,u2 to be determined, and y1,y2 are the two basis solutions (the two linearly independent solutions of the homogeneous ODE) found earlier when solving the homogeneous ODE as

y1=1xy2=x23

In the Variation of parameters u1,u2 are found using

(2)u1=y2f(x)aW(x)(3)u2=y1f(x)aW(x)

Where W(x) is the Wronskian and a is the coefficient in front of y in the given ODE. The Wronskian is given by W=|y1y2y1y2|. Hence

W=|1xx23ddx(1x)ddx(x23)|

Which gives

W=|1xx231x22x3|

Therefore

W=(1x)(2x3)(x23)(1x2)

Which simplifies to

W=1

Which simplifies to

W=1

Therefore Eq. (2) becomes

u1=x3ex31dx

Which simplifies to

u1=x3ex3dx

Hence

u1=2x7/2ex3+14x3ex3+28x5/2ex+140x2ex+560x3/2ex+1680xex+3360xex+3360ex

And Eq. (3) becomes

u2=ex1dx

Which simplifies to

u2=exdx

Hence

u2=2xex2ex

Therefore the particular solution, from equation (1) is

yp(x)=2x7/2ex3+14x3ex3+28x5/2ex+140x2ex+560x3/2ex+1680xex+3360xex+3360exx+x2(2xex2ex)3

Which simplifies to

yp(x)=4ex(7x5/2+140x3/2+x3+35x2+840x+420x+840)x

Therefore the general solution is

y=yh+yp=(c1x+c2x23)+(4ex(7x5/2+140x3/2+x3+35x2+840x+420x+840)x)

Will add steps showing solving for IC soon.

Summary of solutions found

y=4ex(7x5/2+140x3/2+x3+35x2+840x+420x+840)x+c1x+c2x23
Maple. Time used: 0.008 (sec). Leaf size: 51
ode:=diff(diff(y(x),x),x)-2/x^2*y(x) = x*exp(-x^(1/2)); 
dsolve(ode,y(x), singsol=all);
 
y=4ex(7x5/2+140x3/2+x3+35x2+840x+420x+840)+c2x3+c1x

Maple trace

Methods for second order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying high order exact linear fully integrable 
trying differential order: 2; linear nonhomogeneous with symmetry [0,1] 
trying a double symmetry of the form [xi=0, eta=F(x)] 
-> Try solving first the homogeneous part of the ODE 
   checking if the LODE has constant coefficients 
   checking if the LODE is of Euler type 
   <- LODE of Euler type successful 
<- solving first the homogeneous part of the ODE successful
 

Mathematica. Time used: 0.046 (sec). Leaf size: 57
ode=D[y[x],{x,2}]-2/x^2*y[x] == x*Exp[-x^(1/2)]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)x21x13eK[1]dK[1]+c2x2+2Γ(8,x)3x+c1x
Sympy. Time used: 1.005 (sec). Leaf size: 66
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(-sqrt(x)) + Derivative(y(x), (x, 2)) - 2*y(x)/x**2,0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=(C1x3ex+C2ex+28x52+560x32+3360x+4x3+140x2+1680x+3360)exx