2.2.26 Problem 26

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
Maple
Mathematica
Sympy

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

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

Time used: 1.367 (sec)

Solve

y+(11x)y+4x2ye2x=4(x3+x2)e3x

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

y+(x1)yx+4x2ye2x=0

In normal form the ode

(1)y+(x1)yx+4x2ye2x=0

Becomes

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

Where

p(x)=x1xq(x)=4x2e2x

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=ex1xdxdx=ex+ln(x)dx=xexdx(6)=(x+1)ex

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

q1(τ)=q(x)τ(x)2=4x2e2xx2e2x(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(2(x+1)ex)c2sin(2(x+1)ex)

Therefore the homogeneous solution yh is

yh=c1cos(2(x+1)ex)c2sin(2(x+1)ex)

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=4cos(xex)2sin(ex)cos(ex)4sin(xex)cos(xex)cos(ex)2+2sin(xex)cos(xex)+2sin(ex)cos(ex)y2=4cos(xex)2cos(ex)22cos(xex)22cos(ex)2+14sin(xex)cos(xex)sin(ex)cos(ex)

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=|4cos(xex)2sin(ex)cos(ex)4sin(xex)cos(xex)cos(ex)2+2sin(xex)cos(xex)+2sin(ex)cos(ex)4cos(xex)2cos(ex)22cos(xex)22cos(ex)2+14sin(xex)cos(xex)sin(ex)cos(ex)ddx(4cos(xex)2sin(ex)cos(ex)4sin(xex)cos(xex)cos(ex)2+2sin(xex)cos(xex)+2sin(ex)cos(ex))ddx(4cos(xex)2cos(ex)22cos(xex)22cos(ex)2+14sin(xex)cos(xex)sin(ex)cos(ex))|

Which gives

W=|4cos(xex)2sin(ex)cos(ex)4sin(xex)cos(xex)cos(ex)2+2sin(xex)cos(xex)+2sin(ex)cos(ex)4cos(xex)2cos(ex)22cos(xex)22cos(ex)2+14sin(xex)cos(xex)sin(ex)cos(ex)8cos(xex)sin(ex)cos(ex)(xex+ex)sin(xex)+4cos(xex)2excos(ex)24cos(xex)2sin(ex)2ex4(xex+ex)cos(xex)2cos(ex)2+4sin(xex)2(xex+ex)cos(ex)28sin(xex)cos(xex)cos(ex)exsin(ex)+2(xex+ex)cos(xex)22sin(xex)2(xex+ex)2excos(ex)2+2sin(ex)2ex8cos(xex)cos(ex)2(xex+ex)sin(xex)+8cos(xex)2cos(ex)exsin(ex)+4cos(xex)(xex+ex)sin(xex)4cos(ex)exsin(ex)4(xex+ex)cos(xex)2sin(ex)cos(ex)+4sin(xex)2(xex+ex)sin(ex)cos(ex)+4sin(xex)cos(xex)excos(ex)24sin(xex)cos(xex)sin(ex)2ex|

Therefore

W=(4cos(xex)2sin(ex)cos(ex)4sin(xex)cos(xex)cos(ex)2+2sin(xex)cos(xex)+2sin(ex)cos(ex))(8cos(xex)cos(ex)2(xex+ex)sin(xex)+8cos(xex)2cos(ex)exsin(ex)+4cos(xex)(xex+ex)sin(xex)4cos(ex)exsin(ex)4(xex+ex)cos(xex)2sin(ex)cos(ex)+4sin(xex)2(xex+ex)sin(ex)cos(ex)+4sin(xex)cos(xex)excos(ex)24sin(xex)cos(xex)sin(ex)2ex)(4cos(xex)2cos(ex)22cos(xex)22cos(ex)2+14sin(xex)cos(xex)sin(ex)cos(ex))(8cos(xex)sin(ex)cos(ex)(xex+ex)sin(xex)+4cos(xex)2excos(ex)24cos(xex)2sin(ex)2ex4(xex+ex)cos(xex)2cos(ex)2+4sin(xex)2(xex+ex)cos(ex)28sin(xex)cos(xex)cos(ex)exsin(ex)+2(xex+ex)cos(xex)22sin(xex)2(xex+ex)2excos(ex)2+2sin(ex)2ex)

Which simplifies to

W=Expression too large to display

Which simplifies to

W=2xex

Therefore Eq. (2) becomes

u1=4(4cos(xex)2cos(ex)22cos(xex)22cos(ex)2+14sin(xex)cos(xex)sin(ex)cos(ex))e3xx2(x+1)2xexdx

Which simplifies to

u1=2x(x+1)e2x(sin(2xex)sin(2ex)cos(2ex)cos(2xex))dx

Hence

u1=isinh(2iex+2ixex)exxcosh(2iex+2ixex)2+isinh(2iex+2ixex)ex

And Eq. (3) becomes

u2=4(4cos(xex)2sin(ex)cos(ex)4sin(xex)cos(xex)cos(ex)2+2sin(xex)cos(xex)+2sin(ex)cos(ex))e3xx2(x+1)2xexdx

Which simplifies to

u2=2x(x+1)e2x(sin(2ex)cos(2xex)+cos(2ex)sin(2xex))dx

Hence

u2=2(xex2+ex2)cosh(2iex+2ixex)+isinh(2iex+2ixex)2

Therefore the particular solution, from equation (1) is

yp(x)=(isinh(2iex+2ixex)exxcosh(2iex+2ixex)2+isinh(2iex+2ixex)ex)(4cos(xex)2sin(ex)cos(ex)4sin(xex)cos(xex)cos(ex)2+2sin(xex)cos(xex)+2sin(ex)cos(ex))+(4cos(xex)2cos(ex)22cos(xex)22cos(ex)2+14sin(xex)cos(xex)sin(ex)cos(ex))(2(xex2+ex2)cosh(2iex+2ixex)+isinh(2iex+2ixex)2)

Which simplifies to

yp(x)=(x+1)ex

Therefore the general solution is

y=yh+yp=(c1cos(2(x+1)ex)c2sin(2(x+1)ex))+((x+1)ex)

Will add steps showing solving for IC soon.

Summary of solutions found

y(x)=(x+1)ex+c1cos(2(x+1)ex)c2sin(2(x+1)ex)

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

Time used: 0.728 (sec)

Solve

y+(11x)y+4x2ye2x=4(x3+x2)e3x

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

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

Where A=1,B=x1x,C=4x2e2x,f(x)=4e3xx2(x+1). 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

y+(x1)yx+4x2ye2x=0

In normal form the ode

(1)y+(x1)yx+4x2ye2x=0

Becomes

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

Where

p(x)=x1xq(x)=4x2e2x

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)=2x2e2xcτ=2xe2x2x2e2xcx2e2x

Substituting the above into (4) results in

p1(τ)=τ(x)+p(x)τ(x)τ(x)2=2xe2x2x2e2xcx2e2x+x1x2x2e2xc(2x2e2xc)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=2x2e2xdxc=2(x+1)x2e2xcx

Substituting the above into the solution obtained gives

y=c1cos(2(x+1)x2e2xx)c2sin(2(x+1)x2e2xx)

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=cos(2(x+1)x2e2xx)y2=sin(2(x+1)x2e2xx)

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=|cos(2(x+1)x2e2xx)sin(2(x+1)x2e2xx)ddx(cos(2(x+1)x2e2xx))ddx(sin(2(x+1)x2e2xx))|

Which gives

W=|cos(2(x+1)x2e2xx)sin(2(x+1)x2e2xx)(2x2e2xx+(x+1)(2xe2x2x2e2x)x2e2xx2(x+1)x2e2xx2)sin(2(x+1)x2e2xx)(2x2e2xx+(x+1)(2xe2x2x2e2x)x2e2xx2(x+1)x2e2xx2)cos(2(x+1)x2e2xx)|

Therefore

W=(cos(2(x+1)x2e2xx))((2x2e2xx+(x+1)(2xe2x2x2e2x)x2e2xx2(x+1)x2e2xx2)cos(2(x+1)x2e2xx))(sin(2(x+1)x2e2xx))((2x2e2xx+(x+1)(2xe2x2x2e2x)x2e2xx2(x+1)x2e2xx2)sin(2(x+1)x2e2xx))

Which simplifies to

W=2x2e2x(cos(2(x+1)x2e2xx)2+sin(2(x+1)x2e2xx)2)x2e2x

Which simplifies to

W=2x2e2xx2e2x

Therefore Eq. (2) becomes

u1=4sin(2(x+1)x2e2xx)e3xx2(x+1)2x2e2xx2e2xdx

Which simplifies to

u1=2(x+1)exx2e2xsin(2(x+1)x2e2xx)dx

Hence

u1=0x2(α+1)eαα2e2αsin(2(α+1)α2e2αα)dα

And Eq. (3) becomes

u2=4cos(2(x+1)x2e2xx)e3xx2(x+1)2x2e2xx2e2xdx

Which simplifies to

u2=2(x+1)exx2e2xcos(2(x+1)x2e2xx)dx

Hence

u2=0x2(α+1)eαα2e2αcos(2(α+1)α2e2αα)dα

Therefore the particular solution, from equation (1) is

yp(x)=0x2(α+1)eαα2e2αsin(2(α+1)α2e2αα)dαcos(2(x+1)x2e2xx)sin(2(x+1)x2e2xx)0x2(α+1)eαα2e2αcos(2(α+1)α2e2αα)dα

Which simplifies to

yp(x)=20x(α+1)eαα2e2αsin(2(α+1)α2e2αα)dαcos(2(x+1)x2e2xx)2sin(2(x+1)x2e2xx)0x(α+1)eαα2e2αcos(2(α+1)α2e2αα)dα

Therefore the general solution is

y=yh+yp=(c1cos(2(x+1)x2e2xx)c2sin(2(x+1)x2e2xx))+(20x(α+1)eαα2e2αsin(2(α+1)α2e2αα)dαcos(2(x+1)x2e2xx)2sin(2(x+1)x2e2xx)0x(α+1)eαα2e2αcos(2(α+1)α2e2αα)dα)

Will add steps showing solving for IC soon.

Summary of solutions found

y=20x(α+1)eαα2e2αsin(2(α+1)α2e2αα)dαcos(2(x+1)x2e2xx)2sin(2(x+1)x2e2xx)0x(α+1)eαα2e2αcos(2(α+1)α2e2αα)dα+c1cos(2(x+1)x2e2xx)c2sin(2(x+1)x2e2xx)

Maple. Time used: 0.009 (sec). Leaf size: 37
ode:=diff(diff(y(x),x),x)+(1-1/x)*diff(y(x),x)+4*x^2*y(x)*exp(-2*x) = 4*(x^3+x^2)*exp(-3*x); 
dsolve(ode,y(x), singsol=all);
 
y=sin(2(x+1)ex)c2+cos(2(x+1)ex)c1+(x+1)ex

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)] 
trying symmetries linear in x and y(x) 
-> Try solving first the homogeneous part of the ODE 
   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: 4.276 (sec). Leaf size: 142
ode=D[y[x],{x,2}]+(1-1/x)*D[y[x],x]+4*x^2*y[x]*Exp[-2*x]==4*(x^2+x^3)*Exp[-3*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)cos(2ex(log(ex)+1))1ex2log(K[1])(log(K[1])+1)sin(2(log(K[1])+1)K[1])K[1]3dK[1]sin(2ex(log(ex)+1))1ex2cos(2(log(K[2])+1)K[2])log(K[2])(log(K[2])+1)K[2]3dK[2]+c1cos(2ex(log(ex)+1))c2sin(2ex(log(ex)+1))
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(4*x**2*y(x)*exp(-2*x) + (1 - 1/x)*Derivative(y(x), x) - (4*x**3 + 4*x**2)*exp(-3*x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE -x*(4*x**3 - 4*x**2*y(x)*exp(x) + 4*x**2 - exp(3*x)*Derivative(y(x), (x, 2)))*exp(-3*x)/(x - 1) + Derivative(y(x), x) cannot be solved by the factorable group method