58.11.20 problem 20

Internal problem ID [14751]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.3. The method of undetermined coefficients. Exercises page 151
Problem number : 20
Date solved : Thursday, October 02, 2025 at 09:50:46 AM
CAS classification : [[_3rd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime \prime }-4 y^{\prime \prime }+5 y^{\prime }-2 y&=3 x^{2} {\mathrm e}^{x}-7 \,{\mathrm e}^{x} \end{align*}
Maple. Time used: 0.006 (sec). Leaf size: 34
ode:=diff(diff(diff(y(x),x),x),x)-4*diff(diff(y(x),x),x)+5*diff(y(x),x)-2*y(x) = 3*x^2*exp(x)-7*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = -\frac {{\mathrm e}^{x} \left (x^{4}+4 x^{3}-4 c_2 \,{\mathrm e}^{x}-4 c_3 x -2 x^{2}-4 c_1 \right )}{4} \]
Mathematica. Time used: 0.052 (sec). Leaf size: 47
ode=D[y[x],{x,3}]-4*D[y[x],{x,2}]+5*D[y[x],x]-2*y[x]==3*x^2*Exp[x]-7*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{4} e^x \left (-x^4-4 x^3+2 x^2+4 (1+c_2) x+4 \left (c_3 e^x+1+c_1\right )\right ) \end{align*}
Sympy. Time used: 0.194 (sec). Leaf size: 27
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-3*x**2*exp(x) - 2*y(x) + 7*exp(x) + 5*Derivative(y(x), x) - 4*Derivative(y(x), (x, 2)) + Derivative(y(x), (x, 3)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} + C_{3} e^{x} + x \left (C_{2} - \frac {x^{3}}{4} - x^{2} + \frac {x}{2}\right )\right ) e^{x} \]