\[ y''(x)=-\frac {1}{4} y(x) \csc ^2(x) \left (-4 n^2+4 v (v+1) \sin ^2(x)-\cos ^2(x)+2\right ) \] ✓ Mathematica : cpu = 0.460635 (sec), leaf count = 42
DSolve[Derivative[2][y][x] == -1/4*(Csc[x]^2*(2 - 4*n^2 - Cos[x]^2 + 4*v*(1 + v)*Sin[x]^2)*y[x]),y[x],x]
\[\left \{\left \{y(x)\to c_1 \sqrt [4]{\cos ^2(x)-1} P_v^n(\cos (x))+c_2 \sqrt [4]{\cos ^2(x)-1} Q_v^n(\cos (x))\right \}\right \}\] ✓ Maple : cpu = 0.246 (sec), leaf count = 113
dsolve(diff(diff(y(x),x),x) = -1/4*(4*v*(v+1)*sin(x)^2-cos(x)^2+2-4*n^2)/sin(x)^2*y(x),y(x))
\[y \left (x \right ) = \frac {\sqrt {-2 \cos \left (2 x \right )+2}\, \left (2 \cos \left (2 x \right )+2\right )^{\frac {1}{4}} \left (\frac {\cos \left (2 x \right )}{2}-\frac {1}{2}\right )^{\frac {n}{2}} \left (\hypergeom \left (\left [1+\frac {v}{2}+\frac {n}{2}, \frac {1}{2}-\frac {v}{2}+\frac {n}{2}\right ], \left [\frac {3}{2}\right ], \frac {\cos \left (2 x \right )}{2}+\frac {1}{2}\right ) \sqrt {2 \cos \left (2 x \right )+2}\, c_{2}+\hypergeom \left (\left [-\frac {v}{2}+\frac {n}{2}, \frac {1}{2}+\frac {v}{2}+\frac {n}{2}\right ], \left [\frac {1}{2}\right ], \frac {\cos \left (2 x \right )}{2}+\frac {1}{2}\right ) c_{1}\right )}{\sqrt {\sin \left (2 x \right )}}\]