\[ y(x) \left (-a \cos ^2(x)-(n-1) n\right )+\cos ^2(x) y''(x)=0 \] ✓ Mathematica : cpu = 0.411958 (sec), leaf count = 134
\[\left \{\left \{y(x)\to c_1 i^{1-n} \cos ^{1-n}(x) \, _2F_1\left (-\frac {n}{2}-\frac {i \sqrt {a}}{2}+\frac {1}{2},-\frac {n}{2}+\frac {i \sqrt {a}}{2}+\frac {1}{2};\frac {3}{2}-n;\cos ^2(x)\right )+c_2 i^n \cos ^n(x) \, _2F_1\left (\frac {n}{2}-\frac {i \sqrt {a}}{2},\frac {n}{2}+\frac {i \sqrt {a}}{2};n+\frac {1}{2};\cos ^2(x)\right )\right \}\right \}\] ✓ Maple : cpu = 0.369 (sec), leaf count = 123
\[\left \{y \left (x \right ) = c_{1} \left (\cos ^{-n}\left (x \right )\right ) \hypergeom \left (\left [-\frac {n}{2}+\frac {i \sqrt {a}}{2}+1, -\frac {n}{2}-\frac {i \sqrt {a}}{2}+1\right ], \left [-n +\frac {3}{2}\right ], \frac {\cos \left (2 x \right )}{2}+\frac {1}{2}\right ) \sin \left (2 x \right )+\frac {c_{2} \left (-2 \cos \left (2 x \right )+2\right )^{\frac {3}{4}} \left (2 \cos \left (2 x \right )+2\right )^{\frac {1}{4}} \left (\cos ^{n}\left (x \right )\right ) \hypergeom \left (\left [\frac {n}{2}+\frac {i \sqrt {a}}{2}+\frac {1}{2}, \frac {n}{2}-\frac {i \sqrt {a}}{2}+\frac {1}{2}\right ], \left [n +\frac {1}{2}\right ], \frac {\cos \left (2 x \right )}{2}+\frac {1}{2}\right )}{\sqrt {\sin \left (2 x \right )}}\right \}\]