2.1065   ODE No. 1065

\[ \left (n^2-a^2\right ) y(x)+2 n \cot (x) y'(x)+y''(x)=0 \] Mathematica : cpu = 0.0974961 (sec), leaf count = 114

DSolve[(-a^2 + n^2)*y[x] + 2*n*Cot[x]*Derivative[1][y][x] + Derivative[2][y][x] == 0,y[x],x]
 

\[\left \{\left \{y(x)\to c_1 \left (\cos ^2(x)-1\right )^{\frac {1}{4} (1-2 n)} P_{\frac {1}{2} \left (2 \sqrt {2 n^2-a^2}-1\right )}^{\frac {1}{2} (2 n-1)}(\cos (x))+c_2 \left (\cos ^2(x)-1\right )^{\frac {1}{4} (1-2 n)} Q_{\frac {1}{2} \left (2 \sqrt {2 n^2-a^2}-1\right )}^{\frac {1}{2} (2 n-1)}(\cos (x))\right \}\right \}\] Maple : cpu = 0.292 (sec), leaf count = 60

dsolve(diff(diff(y(x),x),x)+2*n*diff(y(x),x)*cot(x)+(-a^2+n^2)*y(x)=0,y(x))
 

\[y \left (x \right ) = \sin \left (x \right )^{-n +\frac {1}{2}} \left (\operatorname {LegendreQ}\left (-\frac {1}{2}+\sqrt {-a^{2}+2 n^{2}}, n -\frac {1}{2}, \cos \left (x \right )\right ) c_{2}+\operatorname {LegendreP}\left (-\frac {1}{2}+\sqrt {-a^{2}+2 n^{2}}, n -\frac {1}{2}, \cos \left (x \right )\right ) c_{1}\right )\]