23.3.326 problem 328

Internal problem ID [6040]
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 : 328
Date solved : Tuesday, September 30, 2025 at 02:20:20 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} \left (2+x \right ) y-x \left (2+x \right ) y^{\prime }+x^{2} y^{\prime \prime }&=x^{3} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 15
ode:=(x+2)*y(x)-x*(x+2)*diff(y(x),x)+x^2*diff(diff(y(x),x),x) = x^3; 
dsolve(ode,y(x), singsol=all);
 
\[ y = x \left ({\mathrm e}^{x} c_1 +c_2 -x \right ) \]
Mathematica. Time used: 0.016 (sec). Leaf size: 22
ode=(2 + x)*y[x] - x*(2 + x)*D[y[x],x] + x^2*D[y[x],{x,2}] == x^3; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -x \left (x-c_2 e^x+1-c_1\right ) \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x**3 + x**2*Derivative(y(x), (x, 2)) - x*(x + 2)*Derivative(y(x), x) + (x + 2)*y(x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (-x**3 + x**2*Derivative(y(x), (x, 2)) + x