29.6.32 problem 38

Internal problem ID [7317]
Book : Mathematical Methods in the Physical Sciences. third edition. Mary L. Boas. John Wiley. 2006
Section : Chapter 8, Ordinary differential equations. Section 6. SECOND-ORDER LINEAR EQUATIONSWITH CONSTANT COEFFICIENTS AND RIGHT-HAND SIDE NOT ZERO. page 422
Problem number : 38
Date solved : Tuesday, September 30, 2025 at 04:28:10 PM
CAS classification : [[_2nd_order, _missing_y]]

\begin{align*} y^{\prime \prime }-2 y^{\prime }&=9 x \,{\mathrm e}^{-x}-6 x^{2}+4 \,{\mathrm e}^{2 x} \end{align*}
Maple. Time used: 0.001 (sec). Leaf size: 39
ode:=diff(diff(y(x),x),x)-2*diff(y(x),x) = 9*x*exp(-x)-6*x^2+4*exp(2*x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {\left (4 x +c_1 -2\right ) {\mathrm e}^{2 x}}{2}+\left (3 x +4\right ) {\mathrm e}^{-x}+x^{3}+\frac {3 x^{2}}{2}+\frac {3 x}{2}+c_2 \]
Mathematica. Time used: 3.888 (sec). Leaf size: 57
ode=D[y[x],{x,2}]-2*D[y[x],x]==9*x*Exp[-x]-6*x^2+4*Exp[2*x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to \int _1^xe^{2 K[2]} \left (c_1+\int _1^{K[2]}\left (-6 e^{-2 K[1]} K[1]^2+9 e^{-3 K[1]} K[1]+4\right )dK[1]\right )dK[2]+c_2 \end{align*}
Sympy. Time used: 0.176 (sec). Leaf size: 41
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(6*x**2 - 9*x*exp(-x) - 4*exp(2*x) - 2*Derivative(y(x), x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{1} + x^{3} + \frac {3 x^{2}}{2} + \frac {3 x}{2} + 3 x e^{- x} + \left (C_{2} + 2 x\right ) e^{2 x} + 4 e^{- x} \]