34.9.8 problem 18

Internal problem ID [8005]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 14. Linear equations with constant coefficients. Supplemetary problems. Page 92
Problem number : 18
Date solved : Tuesday, September 30, 2025 at 05:14:08 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} y^{\prime \prime }-y&=4 x \,{\mathrm e}^{x} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 22
ode:=diff(diff(y(x),x),x)-y(x) = 4*x*exp(x); 
dsolve(ode,y(x), singsol=all);
 
\[ y = {\mathrm e}^{-x} c_1 +{\mathrm e}^{x} \left (x^{2}+c_2 -x \right ) \]
Mathematica. Time used: 0.019 (sec). Leaf size: 43
ode=D[y[x],{x,2}]-y[x]==4*x*Exp[x]; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to e^{-x} \left (\int _1^x-2 e^{2 K[1]} K[1]dK[1]+e^{2 x} \left (x^2+c_1\right )+c_2\right ) \end{align*}
Sympy. Time used: 0.060 (sec). Leaf size: 17
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-4*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} + x^{2} - x\right ) e^{x} \]