2.5.5 Problem 5

Solved as second order solved by an integrating factor
Solved as second order ode using change of variable on y method 1
Solved as second order ode using Kovacic algorithm
Maple
Mathematica
Sympy

Internal problem ID [8965]
Book : Own collection of miscellaneous problems
Section : section 5.0
Problem number : 5
Date solved : Friday, April 25, 2025 at 05:27:03 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

Solved as second order solved by an integrating factor

Time used: 0.083 (sec)

Solve

4x2y+(8x2+4x)y+(4x24x1)y=4xex

The ode satisfies this form

y+p(x)y+(p(x)+p(x)2)y2=f(x)

Where p(x)=2x+1x. Therefore, there is an integrating factor given by

M(x)=e12pdx=e2x+1xdx=xex

Multiplying both sides of the ODE by the integrating factor M(x) makes the left side of the ODE a complete differential

(M(x)y)=exexx(xexy)=exexx

Integrating once gives

(xexy)=ln(x)+c1

Integrating again gives

(xexy)=x(ln(x)+c11)+c2

Hence the solution is

y=x(ln(x)+c11)+c2xex

Or

y=c1xex+xexln(x)+c2exxxex

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1xex+xexln(x)+c2exxxex

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

Time used: 0.267 (sec)

Solve

4x2y+(8x2+4x)y+(4x24x1)y=4xex

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

4x2y+(8x2+4x)y+(4x24x1)y=0

In normal form the given ode is written as

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

Where

p(x)=8x2+4x4x2q(x)=4x24x14x2

Calculating the Liouville ode invariant Q given by

Q=qp2p24=4x24x14x2(8x2+4x4x2)2(8x2+4x4x2)24=4x24x14x2(16x+44x28x2+4x2x3)2((8x2+4x)216x4)4=4x24x14x2(16x+48x28x2+4x4x3)(8x2+4x)264x4=0

Since the Liouville ode invariant does not depend on the independent variable x then the transformation

(3)y=v(x)z(x)

is used to change the original ode to a constant coefficients ode in v. In (3) the term z(x) is given by

z(x)=ep(x)2dx=e8x2+4x4x22(5)=exx

Hence (3) becomes

(4)y=v(x)exx

Applying this change of variable to the original ode results in

4exx3/2v(x)=0

Which is now solved for v(x).

The above ode can be simplified to

4v(x)=0

The ODE simplifies to

v=0

Integrating twice gives the solution

v=c1x+c2

Will add steps showing solving for IC soon.

Now that v is known, then

y(x)=vz(x)(7)=(c1x+c2)(z(x))

But from (5)

z(x)=exx

Hence (7) becomes

y(x)=(c1x+c2)exx

Therefore the homogeneous solution yh is

yh=(c1x+c2)exx

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=exxy2=xex

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=|exxxexddx(exx)ddx(xex)|

Which gives

W=|exxxexex2x3/2+exxex2x+xex|

Therefore

W=(exx)(ex2x+xex)(xex)(ex2x3/2+exx)

Which simplifies to

W=e2xx

Which simplifies to

W=e2xx

Therefore Eq. (2) becomes

u1=4xe2x4xe2xdx

Which simplifies to

u1=1dx

Hence

u1=x

And Eq. (3) becomes

u2=4e2x4xe2xdx

Which simplifies to

u2=1xdx

Hence

u2=ln(x)

Therefore the particular solution, from equation (1) is

yp(x)=xex+xexln(x)

Which simplifies to

yp(x)=exx(ln(x)1)

Therefore the general solution is

y=yh+yp=((c1x+c2)exx)+(exx(ln(x)1))

Will add steps showing solving for IC soon.

Summary of solutions found

y(x)=(c1x+c2)exx+exx(ln(x)1)

Solved as second order ode using Kovacic algorithm

Time used: 0.135 (sec)

Solve

4x2y+(8x2+4x)y+(4x24x1)y=4xex

Writing the ode as

(1)4x2y+(8x2+4x)y+(4x24x1)y=0(2)Ay+By+Cy=0

Comparing (1) and (2) shows that

A=4x2(3)B=8x2+4xC=4x24x1

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=01

Comparing the above to (5) shows that

s=0t=1

Therefore eq. (4) becomes

(7)z(x)=0

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.118: 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)=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 infinity then the necessary conditions for case one are met. Therefore

L=[1]

Since r=0 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)=1

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=z1e128x2+4x4x2dx=z1exln(x)2=z1(exx)

Which simplifies to

y1=exx

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

y2=y1eBAdxy12dx

Substituting gives

y2=y1e8x2+4x4x2dx(y1)2dx=y1e2xln(x)(y1)2dx=y1(x)

Therefore the solution is

y=c1y1+c2y2=c1(exx)+c2(exx(x))

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

4x2y+(8x2+4x)y+(4x24x1)y=0

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

yh=c1exx+c2xex

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=exxy2=xex

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=|exxxexddx(exx)ddx(xex)|

Which gives

W=|exxxexex2x3/2+exxex2x+xex|

Therefore

W=(exx)(ex2x+xex)(xex)(ex2x3/2+exx)

Which simplifies to

W=e2xx

Which simplifies to

W=e2xx

Therefore Eq. (2) becomes

u1=4xe2x4xe2xdx

Which simplifies to

u1=1dx

Hence

u1=x

And Eq. (3) becomes

u2=4e2x4xe2xdx

Which simplifies to

u2=1xdx

Hence

u2=ln(x)

Therefore the particular solution, from equation (1) is

yp(x)=xex+xexln(x)

Which simplifies to

yp(x)=exx(ln(x)1)

Therefore the general solution is

y=yh+yp=(c1exx+c2xex)+(exx(ln(x)1))

Will add steps showing solving for IC soon.

Summary of solutions found

y=c1exx+c2xex+exx(ln(x)1)
Maple. Time used: 0.020 (sec). Leaf size: 21
ode:=4*x^2*diff(diff(y(x),x),x)+(-8*x^2+4*x)*diff(y(x),x)+(4*x^2-4*x-1)*y(x) = 4*x^(1/2)*exp(x); 
dsolve(ode,y(x), singsol=all);
 
y=ex(xln(x)+(c11)x+c2)x

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)] 
   checking if the LODE is missing y 
   -> Trying a Liouvillian solution using Kovacics algorithm 
      A Liouvillian solution exists 
      Reducible group (found an exponential solution) 
   <- Kovacics algorithm successful 
<- solving first the homogeneous part of the ODE successful
 

Mathematica. Time used: 0.045 (sec). Leaf size: 27
ode=4*x^2*D[y[x],{x,2}]+(-8*x^2+4*x)*D[y[x],x]+(4*x^2-4*x-1)*y[x] == 4*x^(1/2)*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)ex(xlog(x)+(1+c2)x+c1)x
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*sqrt(x)*exp(x) + 4*x**2*Derivative(y(x), (x, 2)) + (-8*x**2 + 4*x)*Derivative(y(x), x) + (4*x**2 - 4*x - 1)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (-sqrt(x)*exp(x) + x**2*y(x) + x**2*Derivative(y(x), (x, 2)) - x*y(x) - y(x)/4)/(x*(2*x - 1)) cannot be solved by the factorable group method