58.12.22 problem 22

Internal problem ID [14807]
Book : Differential Equations by Shepley L. Ross. Third edition. John Willey. New Delhi. 2004.
Section : Chapter 4, Section 4.4. Variation of parameters. Exercises page 162
Problem number : 22
Date solved : Thursday, October 02, 2025 at 09:55:08 AM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

\begin{align*} x^{2} y^{\prime \prime }-x \left (x +2\right ) y^{\prime }+\left (x +2\right ) y&=x^{3} \end{align*}
Maple. Time used: 0.005 (sec). Leaf size: 15
ode:=x^2*diff(diff(y(x),x),x)-x*(x+2)*diff(y(x),x)+(x+2)*y(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.017 (sec). Leaf size: 22
ode=x^2*D[y[x],{x,2}]-x*(x+2)*D[y[x],x]+(x+2)*y[x]==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*y(x) + 2*y(x))/(x*(x + 2)) cannot be solved by the factorable group method