81.12.20 problem 16-21

Internal problem ID [21673]
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-21
Date solved : Thursday, October 02, 2025 at 07:59:45 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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