34.13.16 problem 38

Internal problem ID [8057]
Book : Schaums Outline. Theory and problems of Differential Equations, 1st edition. Frank Ayres. McGraw Hill 1952
Section : Chapter 18. Linear equations with variable coefficients (Equations of second order). Supplemetary problems. Page 120
Problem number : 38
Date solved : Tuesday, September 30, 2025 at 05:14:52 PM
CAS classification : [[_2nd_order, _with_linear_symmetries]]

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