89.16.18 problem 18

Internal problem ID [24668]
Book : A short course in Differential Equations. Earl D. Rainville. Second edition. 1958. Macmillan Publisher, NY. CAT 58-5010
Section : Chapter 9. Nonhomogeneous Equations: Undetermined coefficients. Exercises at page 140
Problem number : 18
Date solved : Thursday, October 02, 2025 at 10:46:53 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y&=8 x \,{\mathrm e}^{x} \end{align*}
Maple. Time used: 0.004 (sec). Leaf size: 25
ode:=diff(diff(y(x),x),x)-y(x) = 8*x*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-x} c_2 +2 \left (x^{2}-x +\frac {1}{2} c_1 \right ) {\mathrm e}^{x} \]
Mathematica. Time used: 0.022 (sec). Leaf size: 30
ode=D[y[x],{x,2}]-y[x]== 8*x*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^x \left (2 x^2-2 x+1+c_1\right )+c_2 e^{-x} \end{align*}
Sympy. Time used: 0.069 (sec). Leaf size: 20
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-8*x*exp(x) - y(x) + Derivative(y(x), (x, 2)),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
\[ y{\left (x \right )} = C_{2} e^{- x} + \left (C_{1} + 2 x^{2} - 2 x\right ) e^{x} \]