81.14.8 problem 18-18

Internal problem ID [21693]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 18. Algebra of differential operators. Page 435
Problem number : 18-18
Date solved : Thursday, October 02, 2025 at 08:00:02 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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