4.7.1 \(\left (1-x^2\right ) y'(x)=n \left (y(x)^2-2 x y(x)+1\right )\)

ODE
\[ \left (1-x^2\right ) y'(x)=n \left (y(x)^2-2 x y(x)+1\right ) \] ODE Classification

[_rational, _Riccati]

Book solution method
Riccati ODE, Generalized ODE

Mathematica
cpu = 0.0838893 (sec), leaf count = 32

\[\left \{\left \{y(x)\to \frac {c_1 P_n(x)+Q_n(x)}{c_1 P_{n-1}(x)+Q_{n-1}(x)}\right \}\right \}\]

Maple
cpu = 2.865 (sec), leaf count = 231

\[ \left \{ y \relax (x ) ={\frac {1}{4\,n \left (1+x \right ) } \left (8\, \left (\left (n-1/2 \right ) x+1/2-n/2 \right ) {\it \_C1}\, \left (1+x \right ) {\it HeunC} \left (0,-2\,n+1,0,0,{n}^{2}-n+1/2,2\, \left (1+x \right ) ^{-1} \right ) -n \left (-{\frac {1}{2}}-{\frac {x}{2}} \right ) ^{-2\,n+1} \left (1+x \right ) {\it HeunC} \left (0,2\,n-1,0,0,{n}^{2}-n+{\frac {1}{2}},2\, \left (1+x \right ) ^{-1} \right ) -8\, \left (-1+x \right ) \left ({\it HeunCPrime} \left (0,-2\,n+1,0,0,{n}^{2}-n+1/2,2\, \left (1+x \right ) ^{-1} \right ) {\it \_C1}-1/4\, \left (-1/2-x/2 \right ) ^{-2\,n+1}{\it HeunCPrime} \left (0,2\,n-1,0,0,{n}^{2}-n+1/2,2\, \left (1+x \right ) ^{-1} \right ) \right ) \right ) \left ({\it HeunC} \left (0,-2\,n+1,0,0,{n}^{2}-n+{\frac {1}{2}},2\, \left (1+x \right ) ^{-1} \right ) {\it \_C1}-{\frac {1}{4} \left (-{\frac {1}{2}}-{\frac {x}{2}} \right ) ^{-2\,n+1}{\it HeunC} \left (0,2\,n-1,0,0,{n}^{2}-n+{\frac {1}{2}},2\, \left (1+x \right ) ^{-1} \right ) } \right ) ^{-1}} \right \} \] Mathematica raw input

DSolve[(1 - x^2)*y'[x] == n*(1 - 2*x*y[x] + y[x]^2),y[x],x]

Mathematica raw output

{{y[x] -> (C[1]*LegendreP[n, x] + LegendreQ[n, x])/(C[1]*LegendreP[-1 + n, x] + 
LegendreQ[-1 + n, x])}}

Maple raw input

dsolve((-x^2+1)*diff(y(x),x) = n*(1-2*x*y(x)+y(x)^2), y(x),'implicit')

Maple raw output

y(x) = 1/4*(8*((n-1/2)*x+1/2-1/2*n)*_C1*(1+x)*HeunC(0,-2*n+1,0,0,n^2-n+1/2,2/(1+
x))-n*(-1/2-1/2*x)^(-2*n+1)*(1+x)*HeunC(0,2*n-1,0,0,n^2-n+1/2,2/(1+x))-8*(-1+x)*
(HeunCPrime(0,-2*n+1,0,0,n^2-n+1/2,2/(1+x))*_C1-1/4*(-1/2-1/2*x)^(-2*n+1)*HeunCP
rime(0,2*n-1,0,0,n^2-n+1/2,2/(1+x))))/n/(1+x)/(HeunC(0,-2*n+1,0,0,n^2-n+1/2,2/(1
+x))*_C1-1/4*(-1/2-1/2*x)^(-2*n+1)*HeunC(0,2*n-1,0,0,n^2-n+1/2,2/(1+x)))