\[ \boxed { {\frac {{\rm d}^{2}}{{\rm d}{x}^{2}}}y \left ( x \right ) +2\,a \left ( {\frac {\rm d}{{\rm d}x}}y \left ( x \right ) \right ) \cot \left ( ax \right ) + \left ( -{a}^{2}+{b}^{2} \right ) y \left ( x \right ) =0} \]
Mathematica: cpu = 0.106514 (sec), leaf count = 59 \[ \left \{\left \{y(x)\to c_1 e^{-\sqrt {-b^2} x} \csc (a x)+\frac {c_2 e^{\sqrt {-b^2} x} \csc (a x)}{2 \sqrt {-b^2}}\right \}\right \} \]
Maple: cpu = 0.046 (sec), leaf count = 37 \[ \left \{ y \left ( x \right ) ={{\it \_C1}\,\sin \left ( bx \right ) { \frac {1}{\sqrt { \left ( \cos \left ( ax \right ) \right ) ^{2}-1}}}}+{{ \it \_C2}\,\cos \left ( bx \right ) {\frac {1}{\sqrt { \left ( \cos \left ( ax \right ) \right ) ^{2}-1}}}} \right \} \]