\[ y''(x)=y(x) \left (-\csc ^2(x)\right ) \sec ^2(x) \left (-a \sin ^2(x) \cos ^2(x)-(m-1) m \sin ^2(x)-(n-1) n \cos ^2(x)\right ) \] ✓ Mathematica : cpu = 1.06606 (sec), leaf count = 158
\[\left \{\left \{y(x)\to \frac {(-1)^{-m} \cos ^2(x)^{-\frac {m}{2}-\frac {1}{4}} \left (-\sin ^2(x)\right )^{n/2} \left (c_1 (-1)^m \cos ^2(x)^{m+\frac {1}{2}} \, _2F_1\left (\frac {1}{2} \left (m+n-\sqrt {-a}\right ),\frac {1}{2} \left (m+n+\sqrt {-a}\right );m+\frac {1}{2};\cos ^2(x)\right )+i c_2 \cos ^2(x) \, _2F_1\left (\frac {1}{2} \left (-m+n-\sqrt {-a}+1\right ),\frac {1}{2} \left (-m+n+\sqrt {-a}+1\right );\frac {3}{2}-m;\cos ^2(x)\right )\right )}{\sqrt {\cos (x)}}\right \}\right \}\]
✓ Maple : cpu = 0.212 (sec), leaf count = 102
\[ \left \{ y \left ( x \right ) = \left ( \sin \left ( x \right ) \right ) ^{n} \left ( \left ( \cos \left ( x \right ) \right ) ^{-m+1}{\mbox {$_2$F$_1$}({\frac {n}{2}}-{\frac {m}{2}}+{\frac {i}{2}}\sqrt {a}+{\frac {1}{2}},{\frac {n}{2}}-{\frac {m}{2}}-{\frac {i}{2}}\sqrt {a}+{\frac {1}{2}};\,{\frac {3}{2}}-m;\, \left ( \cos \left ( x \right ) \right ) ^{2})}{\it \_C2}+ \left ( \cos \left ( x \right ) \right ) ^{m}{\mbox {$_2$F$_1$}({\frac {n}{2}}+{\frac {m}{2}}+{\frac {i}{2}}\sqrt {a},{\frac {n}{2}}+{\frac {m}{2}}-{\frac {i}{2}}\sqrt {a};\,{\frac {1}{2}}+m;\, \left ( \cos \left ( x \right ) \right ) ^{2})}{\it \_C1} \right ) \right \} \]