83.27.9 problem 9

Internal problem ID [19284]
Book : A Text book for differentional equations for postgraduate students by Ray and Chaturvedi. First edition, 1958. BHASKAR press. INDIA
Section : Chapter VII. Exact differential equations and certain particular forms of equations. Exercise VII (A) at page 104
Problem number : 9
Date solved : Monday, March 31, 2025 at 07:05:35 PM
CAS classification : [[_2nd_order, _exact, _linear, _nonhomogeneous]]

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

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