29.11.7 problem 298

Internal problem ID [4898]
Book : Ordinary differential equations and their solutions. By George Moseley Murphy. 1960
Section : Various 11
Problem number : 298
Date solved : Sunday, March 30, 2025 at 04:09:34 AM
CAS classification : [_rational, _Riccati]

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

Maple. Time used: 0.026 (sec). Leaf size: 280
ode:=(-x^2+1)*diff(y(x),x) = n*(1-2*x*y(x)+y(x)^2); 
dsolve(ode,y(x), singsol=all);
 
\[ y = \frac {2 \left (-\frac {\left (-\frac {x}{2}-\frac {1}{2}\right )^{-2 n} \left (x +1\right ) \left (x -1\right )^{2} \operatorname {HeunCPrime}\left (0, 2 n -1, 0, 0, n^{2}-n +\frac {1}{2}, \frac {2}{x +1}\right )}{8}-\left (x -1\right )^{2} \operatorname {HeunCPrime}\left (0, -2 n +1, 0, 0, n^{2}-n +\frac {1}{2}, \frac {2}{x +1}\right ) c_1 +\left (x +1\right )^{2} \left (c_1 \left (\left (n -\frac {1}{2}\right ) x -\frac {n}{2}+\frac {1}{2}\right ) \left (\frac {x +1}{x -1}\right )^{-n} \operatorname {hypergeom}\left (\left [-n +1, -n +1\right ], \left [-2 n +2\right ], -\frac {2}{x -1}\right )+\frac {n \left (-\frac {x}{2}-\frac {1}{2}\right )^{-2 n} \operatorname {hypergeom}\left (\left [n , n\right ], \left [2 n \right ], -\frac {2}{x -1}\right ) \left (\frac {x +1}{x -1}\right )^{n} \left (x -1\right )}{16}\right )\right ) \left (\frac {x +1}{x -1}\right )^{n} \left (-\frac {x}{2}-\frac {1}{2}\right )^{2 n}}{\left (x +1\right )^{2} n \left (\operatorname {hypergeom}\left (\left [-n +1, -n +1\right ], \left [-2 n +2\right ], -\frac {2}{x -1}\right ) c_1 \left (-\frac {x}{2}-\frac {1}{2}\right )^{2 n}+\frac {\operatorname {hypergeom}\left (\left [n , n\right ], \left [2 n \right ], -\frac {2}{x -1}\right ) \left (\frac {x +1}{x -1}\right )^{2 n} \left (x -1\right )}{8}\right )} \]
Mathematica. Time used: 0.342 (sec). Leaf size: 47
ode=(1-x^2)*D[y[x],x]==n*(1-2*x*y[x]+y[x]^2); 
ic={}; 
DSolve[{ode,ic},y[x],x,IncludeSingularSolutions->True]
 
\begin{align*} y(x)\to \frac {\operatorname {LegendreQ}(n,x)+c_1 \operatorname {LegendreP}(n,x)}{\operatorname {LegendreQ}(n-1,x)+c_1 \operatorname {LegendreP}(n-1,x)} \\ y(x)\to \frac {\operatorname {LegendreP}(n,x)}{\operatorname {LegendreP}(n-1,x)} \\ \end{align*}
Sympy
from sympy import * 
x = symbols("x") 
n = symbols("n") 
y = Function("y") 
ode = Eq(-n*(-2*x*y(x) + y(x)**2 + 1) + (1 - x**2)*Derivative(y(x), x),0) 
ics = {} 
dsolve(ode,func=y(x),ics=ics)
 
Timed Out