78.14.17 problem 6 (b)

Internal problem ID [18282]
Book : DIFFERENTIAL EQUATIONS WITH APPLICATIONS AND HISTORICAL NOTES by George F. Simmons. 3rd edition. 2017. CRC press, Boca Raton FL.
Section : Chapter 3. Second order linear equations. Section 19. The Method of Variation of Parameters. Problems at page 135
Problem number : 6 (b)
Date solved : Monday, March 31, 2025 at 05:24:45 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} \left (x^{2}+x \right ) y^{\prime \prime }+\left (-x^{2}+2\right ) y^{\prime }-\left (2+x \right ) y&=x \left (x +1\right )^{2} \end{align*}

Maple. Time used: 0.006 (sec). Leaf size: 23
ode:=(x^2+x)*diff(diff(y(x),x),x)+(-x^2+2)*diff(y(x),x)-(x+2)*y(x) = x*(1+x)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {c_2}{x}+{\mathrm e}^{x} c_1 -\frac {x^{2}}{3}-x -1 \]
Mathematica. Time used: 0.133 (sec). Leaf size: 45
ode=(x^2+x)*D[y[x],{x,2}]+(2-x^2)*D[y[x],x]-(2+x)*y[x]==x*(x+1)^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\[ y(x)\to -\frac {x^2}{3}-x+\sqrt {2} c_2 e^{x+\frac {1}{2}}+\frac {c_1}{\sqrt {2 e} x}-1 \]
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*(x + 1)**2 + (2 - x**2)*Derivative(y(x), x) - (x + 2)*y(x) + (x**2 + x)*Derivative(y(x), (x, 2)),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)) - 2*x**2 - x*y(x) + x*Derivative(y(x), (x, 2)) - x - 2*y(x))/(x**2 - 2) cannot be solved by the factorable group method