2.2.24 Problem 25

Solved as second order ode using change of variable on x method 2
Solved as second order ode using change of variable on x method 1
Solved as second order Bessel ode
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [9146]
Book : Second order enumerated odes
Section : section 2
Problem number : 25
Date solved : Friday, April 25, 2025 at 05:57:55 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

Solved as second order ode using change of variable on x method 2

Time used: 0.235 (sec)

Solve

xyy+4x3y=x5

This is second order non-homogeneous 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 non-homogeneous ODE Ay(x)+By(x)+Cy(x)=f(x). yh is the solution to

xyy+4x3y=0

In normal form the ode

(1)xyy+4x3y=0

Becomes

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

Where

p(x)=1xq(x)=4x2

Applying change of variables τ=g(x) to (2) gives

(3)d2dτ2y(τ)+p1(ddτy(τ))+q1y(τ)=0

Where τ is the new independent variable, and

(4)p1(τ)=τ(x)+p(x)τ(x)τ(x)2(5)q1(τ)=q(x)τ(x)2

Let p1=0. Eq (4) simplifies to

τ(x)+p(x)τ(x)=0

This ode is solved resulting in

τ=ep(x)dxdx=e1xdxdx=eln(x)dx=xdx(6)=x22

Using (6) to evaluate q1 from (5) gives

q1(τ)=q(x)τ(x)2=4x2x2(7)=4

Substituting the above in (3) and noting that now p1=0 results in

d2dτ2y(τ)+q1y(τ)=0d2dτ2y(τ)+4y(τ)=0

The above ode is now solved for y(τ).This is second order with constant coefficients homogeneous ODE. In standard form the ODE is

Ay(τ)+By(τ)+Cy(τ)=0

Where in the above A=1,B=0,C=4. Let the solution be y=eλτ. Substituting this into the ODE gives

(1)λ2eτλ+4eτλ=0

Since exponential function is never zero, then dividing Eq(2) throughout by eλτ gives

(2)λ2+4=0

Equation (2) is the characteristic equation of the ODE. Its roots determine the general solution form.Using the quadratic formula

λ1,2=B2A±12AB24AC

Substituting A=1,B=0,C=4 into the above gives

λ1,2=0(2)(1)±1(2)(1)02(4)(1)(4)=±2i

Hence

λ1=+2iλ2=2i

Which simplifies to

λ1=2iλ2=2i

Since roots are complex conjugate of each others, then let the roots be

λ1,2=α±iβ

Where α=0 and β=2. Therefore the final solution, when using Euler relation, can be written as

y=eατ(c1cos(βτ)+c2sin(βτ))

Which becomes

y=e0(c1cos(2τ)+c2sin(2τ))

Or

y=c1cos(2τ)+c2sin(2τ)

Will add steps showing solving for IC soon.

The above solution is now transformed back to y(x) using (6) which results in

y(x)=c1cos(x2)+c2sin(x2)

Therefore the homogeneous solution yh is

yh=c1cos(x2)+c2sin(x2)

The particular solution is now found using the method of undetermined coefficients. Looking at the RHS of the ode, which is

x5

Shows that the corresponding undetermined set of the basis functions (UC_set) for the trial solution is

[{1,x,x2,x3,x4,x5}]

While the set of the basis functions for the homogeneous solution found earlier is

{cos(x2),sin(x2)}

Since there is no duplication between the basis function in the UC_set and the basis functions of the homogeneous solution, the trial solution is a linear combination of all the basis in the UC_set.

yp=A6x5+A5x4+A4x3+A3x2+A2x+A1

The unknowns {A1,A2,A3,A4,A5,A6} are found by substituting the above trial solution yp into the ODE and comparing coefficients. Substituting the trial solution into the ODE and simplifying gives

x(20x3A6+12x2A5+6xA4+2A3)5x4A64x3A53x2A42xA3A2+4x3(A6x5+A5x4+A4x3+A3x2+A2x+A1)=x5

Solving for the unknowns by comparing coefficients results in

[A1=0,A2=0,A3=14,A4=0,A5=0,A6=0]

Substituting the above back in the above trial solution yp, gives the particular solution

yp=x24

Therefore the general solution is

y=yh+yp=(c1cos(x2)+c2sin(x2))+(x24)

Will add steps showing solving for IC soon.

Summary of solutions found

y(x)=x24+c1cos(x2)+c2sin(x2)

Solved as second order ode using change of variable on x method 1

Time used: 0.281 (sec)

Solve

xyy+4x3y=x5

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

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

Where A=x,B=1,C=4x3,f(x)=x5. 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

xyy+4x3y=0

In normal form the ode

(1)xyy+4x3y=0

Becomes

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

Where

p(x)=1xq(x)=4x2

Applying change of variables τ=g(x) to (2) results

(3)d2dτ2y(τ)+p1(ddτy(τ))+q1y(τ)=0

Where τ is the new independent variable, and

(4)p1(τ)=τ(x)+p(x)τ(x)τ(x)2(5)q1(τ)=q(x)τ(x)2

Let q1=c2 where c is some constant. Therefore from (5)

τ=1cq(6)=2x2cτ=2xcx2

Substituting the above into (4) results in

p1(τ)=τ(x)+p(x)τ(x)τ(x)2=2xcx21x2x2c(2x2c)2=0

Therefore ode (3) now becomes

y(τ)+p1y(τ)+q1y(τ)=0(7)d2dτ2y(τ)+c2y(τ)=0

The above ode is now solved for y(τ). Since the ode is now constant coefficients, it can be easily solved to give

y(τ)=c1cos(cτ)+c2sin(cτ)

Now from (6)

τ=1cqdx=2x2dxc=xx2c

Substituting the above into the solution obtained gives

y=c1cos(xx2)+c2sin(xx2)

The particular solution is now found using the method of undetermined coefficients. Looking at the RHS of the ode, which is

x5

Shows that the corresponding undetermined set of the basis functions (UC_set) for the trial solution is

[{1,x,x2,x3,x4,x5}]

While the set of the basis functions for the homogeneous solution found earlier is

{cos(xx2),sin(xx2)}

Since there is no duplication between the basis function in the UC_set and the basis functions of the homogeneous solution, the trial solution is a linear combination of all the basis in the UC_set.

yp=A6x5+A5x4+A4x3+A3x2+A2x+A1

The unknowns {A1,A2,A3,A4,A5,A6} are found by substituting the above trial solution yp into the ODE and comparing coefficients. Substituting the trial solution into the ODE and simplifying gives

x(20x3A6+12x2A5+6xA4+2A3)5x4A64x3A53x2A42xA3A2+4x3(A6x5+A5x4+A4x3+A3x2+A2x+A1)=x5

Solving for the unknowns by comparing coefficients results in

[A1=0,A2=0,A3=14,A4=0,A5=0,A6=0]

Substituting the above back in the above trial solution yp, gives the particular solution

yp=x24

Therefore the general solution is

y=yh+yp=(c1cos(xx2)+c2sin(xx2))+(x24)

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1cos(xx2)+c2sin(xx2)+x24

Solved as second order Bessel ode

Time used: 0.517 (sec)

Solve

xyy+4x3y=x5

Writing the ode as

(1)x2yyx+4x4y=x6

Let the solution be

y=yh+yp

Where yh is the solution to the homogeneous ODE and yp is a particular solution to the non-homogeneous ODE. Bessel ode has the form

(2)x2y+yx+(n2+x2)y=0

The generalized form of Bessel ode is given by Bowman (1958) as the following

(3)x2y+(12α)xy+(β2γ2x2γn2γ2+α2)y=0

With the standard solution

(4)y=xα(c1BesselJ(n,βxγ)+c2BesselY(n,βxγ))

Comparing (3) to (1) and solving for α,β,n,γ gives

α=1β=1n=12γ=2

Substituting all the above into (4) gives the solution as

y=c1x2sin(x2)πx2c2x2cos(x2)πx2

Therefore the homogeneous solution yh is

yh=c1x2sin(x2)πx2c2x2cos(x2)πx2

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=x2sin(x2)πx2y2=x2cos(x2)π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=|x2sin(x2)πx2x2cos(x2)πx2ddx(x2sin(x2)πx2)ddx(x2cos(x2)πx2)|

Which gives

W=|x2sin(x2)πx2x2cos(x2)πx22sin(x2)πx2x22sin(x2)π(x2)3/2+2x22cos(x2)πx22cos(x2)πx2+x22cos(x2)π(x2)3/2+2x22sin(x2)πx2|

Therefore

W=(x2sin(x2)πx2)(2cos(x2)πx2+x22cos(x2)π(x2)3/2+2x22sin(x2)πx2)(x2cos(x2)πx2)(2sin(x2)πx2x22sin(x2)π(x2)3/2+2x22cos(x2)πx2)

Which simplifies to

W=4x(sin(x2)2+cos(x2)2)π

Which simplifies to

W=4xπ

Therefore Eq. (2) becomes

u1=x72cos(x2)πx24x3πdx

Which simplifies for 0<x to

u1=x32πcos(x2)4dx

Hence

u1=2π(cos(x2)2+x2sin(x2)2)4

And Eq. (3) becomes

u2=x72sin(x2)πx24x3πdx

Which simplifies for 0<x to

u2=x32πsin(x2)4dx

Hence

u2=2π(sin(x2)2x2cos(x2)2)4

Therefore the particular solution, from equation (1) is

yp(x)=(cos(x2)2+x2sin(x2)2)xsin(x2)2x2xcos(x2)(sin(x2)2x2cos(x2)2)2x2

Which simplifies to

yp(x)=xx24

Therefore the general solution is

y=yh+yp=(c1x2sin(x2)πx2c2x2cos(x2)πx2)+(xx24)

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1x2sin(x2)πx2c2x2cos(x2)πx2+xx24

Solved as second order ode using Kovacic algorithm

Time used: 0.510 (sec)

Solve

xyy+4x3y=x5

Writing the ode as

(1)xyy+4x3y=0(2)Ay+By+Cy=0

Comparing (1) and (2) shows that

A=x(3)B=1C=4x3

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=16x4+34x2

Comparing the above to (5) shows that

s=16x4+3t=4x2

Therefore eq. (4) becomes

(7)z(x)=(16x4+34x2)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.37: 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)=24=2

The poles of r in eq. (7) and the order of each pole are determined by solving for the roots of t=4x2. 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. Therefore

L=[1,2]

Attempting to find a solution using case n=1.

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

r=4x2+34x2

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

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

Since the order of r at is Or()=2 then

v=Or()2=22=1

[r] is the sum of terms involving xi for 0iv in the Laurent series for r at . Therefore

[r]=i=0vaixi(8)=i=01aixi

Let a be the coefficient of xv=x1 in the above sum. The Laurent series of r at is

(9)r2ix3i16x39i1024x727i32768x11405i4194304x151701i134217728x1915309i8589934592x2372171i274877906944x27+

Comparing Eq. (9) with Eq. (8) shows that

a=2i

From Eq. (9) the sum up to v=1 gives

[r]=i=01aixi(10)=2ix

Now we need to find b, where b be the coefficient of xv1=x0=1 in r minus the coefficient of same term but in ([r])2 where [r] was found above in Eq (10). Hence

([r])2=4x2

This shows that the coefficient of 1 in the above is 0. Now we need to find the coefficient of 1 in r. How this is done depends on if v=0 or not. Since v=1 which is not zero, then starting r=st, we do long division and write this in the form

r=Q+Rt

Where Q is the quotient and R is the remainder. Then the coefficient of 1 in r will be the coefficient this term in the quotient. Doing long division gives

r=st=16x4+34x2=Q+R4x2=(4x2)+(34x2)=4x2+34x2

We see that the coefficient of the term x in the quotient is 0. Now b can be found.

b=(0)(0)=0

Hence

[r]=2ixα+=12(bav)=12(02i1)=12α=12(bav)=12(02i1)=12

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

r=16x4+34x2

pole c location pole order [r]c αc+ αc
0 2 0 32 12

Order of r at [r] α+ α
2 2ix 12 12

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 α=12 then

d=α(αc1)=12(12)=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]=12x+()(2ix)=12x2ix=12x2ix

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(12x2ix)(0)+((12x22i)+(12x2ix)2(16x4+34x2))=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=e(12x2ix)dx=eix2x

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

y1=z1e12BAdx=z1e121xdx=z1eln(x)2=z1(x)

Which simplifies to

y1=eix2

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

y2=y1eBAdxy12dx

Substituting gives

y2=y1e1xdx(y1)2dx=y1eln(x)(y1)2dx=y1(ie2ix24)

Therefore the solution is

y=c1y1+c2y2=c1(eix2)+c2(eix2(ie2ix24))

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

xyy+4x3y=0

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

yh=c1eix2ic2eix24

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=eix2y2=ieix24

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=|eix2ieix24ddx(eix2)ddx(ieix24)|

Which gives

W=|eix2ieix242ixeix2xeix22|

Therefore

W=(eix2)(xeix22)(ieix24)(2ixeix2)

Which simplifies to

W=eix2xeix2

Which simplifies to

W=x

Therefore Eq. (2) becomes

u1=ieix2x54x2dx

Which simplifies to

u1=ieix2x34dx

Hence

u1=i(ix21)eix28

And Eq. (3) becomes

u2=eix2x5x2dx

Which simplifies to

u2=eix2x3dx

Hence

u2=(ix2+1)eix22

Therefore the particular solution, from equation (1) is

yp(x)=i(ix21)eix2eix28ieix2(ix2+1)eix28

Which simplifies to

yp(x)=x24

Therefore the general solution is

y=yh+yp=(c1eix2ic2eix24)+(x24)

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1eix2ic2eix24+x24
Maple. Time used: 0.004 (sec). Leaf size: 22
ode:=x*diff(diff(y(x),x),x)-diff(y(x),x)+4*x^3*y(x) = x^5; 
dsolve(ode,y(x), singsol=all);
 
y=sin(x2)c2+cos(x2)c1+x24

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 
   trying a symmetry of the form [xi=0, eta=F(x)] 
   <- linear_1 successful 
<- solving first the homogeneous part of the ODE successful
 

Mathematica. Time used: 0.057 (sec). Leaf size: 68
ode=x*D[y[x],{x,2}]-D[y[x],x]+4*x^3*y[x]==x^5; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)sin(x2)1x12cos(K[1]2)K[1]3dK[1]18sin(2x2)+14x2cos2(x2)+c1cos(x2)+c2sin(x2)
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**5 + 4*x**3*y(x) + x*Derivative(y(x), (x, 2)) - Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -x*(-x**4 + 4*x**2*y(x) + Derivative(y(x), (x, 2))) + Derivative(y(x), x) cannot be solved by the factorable group method