23.3.60 problem 62

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

\begin{align*} y-2 y^{\prime }+y^{\prime \prime }&=\left (-6+x \right ) x^{2} \end{align*}
Maple. Time used: 0.002 (sec). Leaf size: 20
ode:=y(x)-2*diff(y(x),x)+diff(diff(y(x),x),x) = (-6+x)*x^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \left (c_1 x +c_2 \right ) {\mathrm e}^{x}+x^{3}-6 x -12 \]
Mathematica. Time used: 0.008 (sec). Leaf size: 26
ode=y[x] - 2*D[y[x],x] + D[y[x],{x,2}] == (-6 + x)*x^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to x^3+x \left (-6+c_2 e^x\right )+c_1 e^x-12 \end{align*}
Sympy. Time used: 0.117 (sec). Leaf size: 19
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**2*(x - 6) + 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 )} = x^{3} - 6 x + \left (C_{1} + C_{2} x\right ) e^{x} - 12 \]