78.16.17 problem 17

Internal problem ID [18325]
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 : Monday, March 31, 2025 at 05:25:38 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-7 y^{\prime }+12 y&={\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.023 (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]
 
\[ 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 ) \]
Sympy. Time used: 0.327 (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} \]