72.16.17 problem 17

Internal problem ID [19682]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 23. Operator Methods for Finding Particular Solutions. Problems at page 169
Problem number : 17
Date solved : Thursday, October 02, 2025 at 04:41:17 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} 12 y-7 y^{\prime }+y^{\prime \prime }&={\mathrm e}^{2 x} \left (x^{3}-5 x^{2}\right ) \end{align*}
Maple. Time used: 0.007 (sec). Leaf size: 39
ode:=diff(diff(y(x),x),x)-7*diff(y(x),x)+12*y(x) = exp(2*x)*(x^3-5*x^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{4 x} c_2 +\frac {\left (4 x^{3}-2 x^{2}+8 \,{\mathrm e}^{x} c_1 -18 x -25\right ) {\mathrm e}^{2 x}}{8} \]
Mathematica. Time used: 0.016 (sec). Leaf size: 45
ode=D[y[x],{x,2}]-7*D[y[x],x]+12*y[x]==Exp[2*x]*(x^3-5*x^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \frac {1}{8} e^{2 x} \left (4 x^3-2 x^2-18 x+8 c_1 e^x+8 c_2 e^{2 x}-25\right ) \end{align*}
Sympy. Time used: 0.217 (sec). Leaf size: 37
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq((-x**3 + 5*x**2)*exp(2*x) + 12*y(x) - 7*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = \left (C_{1} e^{x} + C_{2} e^{2 x} + \frac {x^{3}}{2} - \frac {x^{2}}{4} - \frac {9 x}{4} - \frac {25}{8}\right ) e^{2 x} \]