\[ y''(x)=-a y(x) \csc ^2(x) \] ✓ Mathematica : cpu = 0.0537413 (sec), leaf count = 70
\[\left \{\left \{y(x)\to c_1 \sqrt [4]{\cos ^2(x)-1} P_{-\frac {1}{2}}^{\frac {1}{2} \sqrt {1-4 a}}(\cos (x))+c_2 \sqrt [4]{\cos ^2(x)-1} Q_{-\frac {1}{2}}^{\frac {1}{2} \sqrt {1-4 a}}(\cos (x))\right \}\right \}\] ✓ Maple : cpu = 2.31 (sec), leaf count = 132
\[ \left \{ y \left ( x \right ) ={ \left ( {\frac {\cos \left ( 2\,x \right ) }{2}}-{\frac {1}{2}} \right ) ^{{\frac {1}{4}\sqrt {1-4\,a}}}\sqrt [4]{2\,\cos \left ( 2\,x \right ) +2}\sqrt {-2\,\cos \left ( 2\,x \right ) +2} \left ( {\mbox {$_2$F$_1$}({\frac {1}{4}\sqrt {1-4\,a}}+{\frac {3}{4}},{\frac {1}{4}\sqrt {1-4\,a}}+{\frac {3}{4}};\,{\frac {3}{2}};\,{\frac {\cos \left ( 2\,x \right ) }{2}}+{\frac {1}{2}})}\sqrt {2\,\cos \left ( 2\,x \right ) +2}{\it \_C2}+{\mbox {$_2$F$_1$}({\frac {1}{4}\sqrt {1-4\,a}}+{\frac {1}{4}},{\frac {1}{4}\sqrt {1-4\,a}}+{\frac {1}{4}};\,{\frac {1}{2}};\,{\frac {\cos \left ( 2\,x \right ) }{2}}+{\frac {1}{2}})}{\it \_C1} \right ) {\frac {1}{\sqrt {\sin \left ( 2\,x \right ) }}}} \right \} \]