23.3.76 problem 78

Internal problem ID [5790]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Part II. Chapter 3. THE DIFFERENTIAL EQUATION IS LINEAR AND OF SECOND ORDER, page 311
Problem number : 78
Date solved : Tuesday, September 30, 2025 at 02:03:24 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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