81.12.19 problem 16-20

Internal problem ID [21672]
Book : The Differential Equations Problem Solver. VOL. I. M. Fogiel director. REA, NY. 1978. ISBN 78-63609
Section : Chapter 16. Variation of Parameters. Page 375.
Problem number : 16-20
Date solved : Thursday, October 02, 2025 at 07:59:44 PM
CAS classification : [[_2nd_order, _linear, _nonhomogeneous]]

\begin{align*} \left (x^{2}-3 x +1\right ) y^{\prime \prime }-\left (x^{2}-x -2\right ) y^{\prime }+\left (2 x -3\right ) y&=x \left (x^{2}-3 x +1\right )^{2} \end{align*}
Maple. Time used: 0.007 (sec). Leaf size: 32
ode:=(x^2-3*x+1)*diff(diff(y(x),x),x)-(x^2-x-2)*diff(y(x),x)+(2*x-3)*y(x) = x*(x^2-3*x+1)^2; 
dsolve(ode,y(x), singsol=all);
 
\[ y = -4+{\mathrm e}^{x} c_2 -\frac {x^{4}}{2}-\frac {x^{3}}{2}+c_1 \,x^{2}+\left (-6-c_1 \right ) x \]
Mathematica. Time used: 0.199 (sec). Leaf size: 42
ode=(x^2-3*x+1)*D[y[x],{x,2}]-(x^2-x-2)*D[y[x],x]+(2*x-3)*y[x]==x*(x^2-3*x+1)^2; 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)&\to -\frac {x^4}{2}-\frac {x^3}{2}-(2+c_2) x^2+(-4+c_2) x+c_1 e^x-4 \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
y = Function("y") 
ode = Eq(-x*(x**2 - 3*x + 1)**2 + (2*x - 3)*y(x) + (x**2 - 3*x + 1)*Derivative(y(x), (x, 2)) - (x**2 - x - 2)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
NotImplementedError : The given ODE Derivative(y(x), x) - (x**5 - 6*x**4 + 11*x**3 - x**2*Derivative(y(x), (x, 2)) - 6*x**2 - 2*x*y(x) + 3*x*Derivative(y(x), (x, 2)) + x + 3*y(x) - Derivative(y(x), (x, 2)))/(-x**2 + x + 2) cannot be solved by the factorable group method