23.3.62 problem 64

Internal problem ID [5776]
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 : 64
Date solved : Tuesday, September 30, 2025 at 02:02:56 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

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