2.2.42 Problem 42

Solved as higher order constant coeff ode
Maple
Mathematica
Sympy

Internal problem ID [9164]
Book : Second order enumerated odes
Section : section 2
Problem number : 42
Date solved : Friday, April 25, 2025 at 05:58:43 PM
CAS classification : [[_high_order, _linear, _nonhomogeneous]]

Solved as higher order constant coeff ode

Time used: 0.163 (sec)

The characteristic equation is

λ4λ33λ2+5λ2=0

The roots of the above equation are

λ1=2λ2=1λ3=1λ4=1

Therefore the homogeneous solution is

yh(x)=exc1+xexc2+x2exc3+e2xc4

The fundamental set of solutions for the homogeneous solution are the following

y1=exy2=xexy3=x2exy4=e2x

This is higher order nonhomogeneous ODE. Let the solution be

y=yh+yp

Where yh is the solution to the homogeneous ODE And yp is a particular solution to the nonhomogeneous ODE. yh is the solution to

yy3y+5y2y=0

Now the particular solution to the given ODE is found

yy3y+5y2y=xex+3e2x

The particular solution is now found using the method of undetermined coefficients.

Looking at the RHS of the ode, which is

xex+3e2x

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

[{e2x},{xex,ex}]

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

{xex,x2ex,ex,e2x}

Since ex is duplicated in the UC_set, then this basis is multiplied by extra x. The UC_set becomes

[{e2x},{xex,x2ex}]

Since xex is duplicated in the UC_set, then this basis is multiplied by extra x. The UC_set becomes

[{e2x},{x2ex,x3ex}]

Since x2ex is duplicated in the UC_set, then this basis is multiplied by extra x. The UC_set becomes

[{e2x},{x3ex,x4ex}]

Since e2x is duplicated in the UC_set, then this basis is multiplied by extra x. The UC_set becomes

[{xe2x},{x3ex,x4ex}]

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

yp=A1xe2x+A2x3ex+A3x4ex

The unknowns {A1,A2,A3} 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

24A3ex27A1e2x+18A2ex+72A3xex=xex+3e2x

Solving for the unknowns by comparing coefficients results in

[A1=19,A2=154,A3=172]

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

yp=xe2x9x3ex54+x4ex72

Therefore the general solution is

y=yh+yp=(exc1+xexc2+x2exc3+e2xc4)+(xe2x9x3ex54+x4ex72)

Maple. Time used: 0.006 (sec). Leaf size: 52
ode:=diff(diff(diff(diff(y(x),x),x),x),x)-diff(diff(diff(y(x),x),x),x)-3*diff(diff(y(x),x),x)+5*diff(y(x),x)-2*y(x) = x*exp(x)+3*exp(-2*x); 
dsolve(ode,y(x), singsol=all);
 
y=(216x+1944c2216)e2x1944+ex(x44x33+(72c4+43)x2+(72c389)x+72c1+827)72

Maple trace

Methods for high order ODEs: 
--- Trying classification methods --- 
trying a quadrature 
trying high order exact linear fully integrable 
trying differential order: 4; linear nonhomogeneous with symmetry [0,1] 
trying high order linear exact nonhomogeneous 
trying differential order: 4; missing the dependent variable 
checking if the LODE has constant coefficients 
<- constant coefficients successful
 

Maple step by step

Let’s solveddxddxd2dx2y(x)ddxd2dx2y(x)3ddxddxy(x)+5ddxy(x)2y(x)=xex+3e2xHighest derivative means the order of the ODE is4ddxddxd2dx2y(x)Characteristic polynomial of homogeneous ODEr4r33r2+5r2=0Roots of the characteristic polynomial and corresponding multiplicitiesr=[[2,1],[1,3]]Homogeneous solution fromr=2y1(x)=e2x1st homogeneous solution fromr=1y2(x)=ex2nd homogeneous solution fromr=1y3(x)=xex3rd homogeneous solution fromr=1y4(x)=x2exGeneral solution of the ODEy(x)=C1y1(x)+C2y2(x)+C3y3(x)+C4y4(x)+yp(x)Substitute in solutions of the homogeneous ODEy(x)=C1e2x+C2ex+C3xex+C4x2ex+yp(x)Find a particular solutionyp(x)of the ODEDefine the forcing function of the ODEf(x)=xex+3e2xForm of the particular solution to the ODE where theui(x)are to be foundyp(x)=i=14ui(x)yi(x)Calculate the 1st derivative ofyp(x)ddxyp(x)=i=14((ddxui(x))yi(x)+ui(x)(ddxyi(x)))Choose equation to add to a system of equations inddxui(x)i=14(ddxui(x))yi(x)=0Calculate the 2nd derivative ofyp(x)ddxddxyp(x)=i=14((ddxui(x))(ddxyi(x))+ui(x)(ddxddxyi(x)))Choose equation to add to a system of equations inddxui(x)i=14(ddxui(x))(ddxyi(x))=0Calculate the 3rd derivative ofyp(x)ddxd2dx2yp(x)=i=14((ddxui(x))(ddxddxyi(x))+ui(x)(ddxd2dx2yi(x)))Choose equation to add to a system of equations inddxui(x)i=14(ddxui(x))(ddxddxyi(x))=0The ODE is of the following form where thePi(x)in this situation are the coefficients of the derivatives in the ODEddxddxd2dx2y(x)+(i=03Pi(x)(didxiy(x)))=f(x)Substituteyp(x)=i=14ui(x)yi(x)into the ODE(j=03Pj(x)(i=14ui(x)(djdxjyi(x))))+i=14((ddxui(x))(ddxd2dx2yi(x))+ui(x)(ddxddxd2dx2yi(x)))=f(x)Rearrange the ODEi=14(ui(x)((j=03Pj(x)(djdxjyi(x)))+ddxddxd2dx2yi(x))+(ddxui(x))(ddxd2dx2yi(x)))=f(x)Notice thatyi(x)are solutions to the homogeneous equation so the first term in the sum is 0i=14(ddxui(x))(ddxd2dx2yi(x))=f(x)We have now made a system of4equations in4unknowns (ddxui(x))[i=14(ddxui(x))yi(x)=0,i=14(ddxui(x))(ddxyi(x))=0,i=14(ddxui(x))(ddxddxyi(x))=0,i=14(ddxui(x))(ddxd2dx2yi(x))=f(x)]Convert the system to linear algebra format, notice that the matrix is the wronskianW[y1(x)y2(x)y3(x)y4(x)ddxy1(x)ddxy2(x)ddxy3(x)ddxy4(x)ddxddxy1(x)ddxddxy2(x)ddxddxy3(x)ddxddxy4(x)ddxd2dx2y1(x)ddxd2dx2y2(x)ddxd2dx2y3(x)ddxd2dx2y4(x)][ddxu1(x)ddxu2(x)ddxu3(x)ddxu4(x)]=[000f(x)]Solve for the varied parameters[u1(x)u2(x)u3(x)u4(x)]=1W[000f(x)]dxSubstitute in the homogeneous solutions and forcing function and solve[u1(x)u2(x)u3(x)u4(x)]=[x9(ex)3x81+(ex)3243x327+x254+x42419(ex)32x9(ex)3x26(ex)3x218x39+29(ex)3+x3(ex)3x21216(ex)3]Find a particular solutionyp(x)of the ODEyp(x)=e2x(1+x)9+(x443x3+43x289x+827)ex72Substitute particular solution into general solution to ODEy(x)=C1e2x+C2ex+C3xex+C4x2exe2x(1+x)9+(x443x3+43x289x+827)ex72
Mathematica. Time used: 0.279 (sec). Leaf size: 170
ode=D[y[x],{x,4}]-D[y[x],{x,3}]-3*D[y[x],{x,2}]+5*D[y[x],x]-2*y[x]==x*Exp[x]+3*Exp[-2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
y(x)exx1x19e3K[3](3K[3]+1)(e3K[3]K[3]+3)dK[3]+e2x1x(127e3K[1]K[1]19)dK[1]+ex1x154e3K[2](e3K[2]K[2]+3)(9K[2]2+6K[2]+2)dK[2]+exx41216e2xx2+c4exx2+c3exx+c1e2x+c2ex
Sympy. Time used: 0.475 (sec). Leaf size: 32
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*exp(x) - 2*y(x) + 5*Derivative(y(x), x) - 3*Derivative(y(x), (x, 2)) - Derivative(y(x), (x, 3)) + Derivative(y(x), (x, 4)) - 3*exp(-2*x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
y(x)=(C1x9)e2x+(C2+x(C3+x(C4+x272x54)))ex