72.16.2 problem 2

Internal problem ID [19667]
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 : 2
Date solved : Thursday, October 02, 2025 at 04:41:10 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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