ODE
\[ y(x) \left (p (p+1)-k^2 \csc ^2(x)\right )+y''(x)+\cot (x) y'(x)=0 \] ODE Classification
[[_2nd_order, _with_linear_symmetries]]
Book solution method
TO DO
Mathematica ✓
cpu = 0.558367 (sec), leaf count = 22
\[\{\{y(x)\to c_1 P_p^k(\cos (x))+c_2 Q_p^k(\cos (x))\}\}\]
Maple ✓
cpu = 1.107 (sec), leaf count = 19
\[[y \left (x \right ) = \textit {\_C1} \LegendreP \left (p , k , \cos \left (x \right )\right )+\textit {\_C2} \LegendreQ \left (p , k , \cos \left (x \right )\right )]\] Mathematica raw input
DSolve[(p*(1 + p) - k^2*Csc[x]^2)*y[x] + Cot[x]*y'[x] + y''[x] == 0,y[x],x]
Mathematica raw output
{{y[x] -> C[1]*LegendreP[p, k, Cos[x]] + C[2]*LegendreQ[p, k, Cos[x]]}}
Maple raw input
dsolve(diff(diff(y(x),x),x)+cot(x)*diff(y(x),x)+(p*(p+1)-k^2*csc(x)^2)*y(x) = 0, y(x))
Maple raw output
[y(x) = _C1*LegendreP(p,k,cos(x))+_C2*LegendreQ(p,k,cos(x))]