\[ a^2 y(x)-\cot (a x)+y''(x)=0 \] ✓ Mathematica : cpu = 0.0411163 (sec), leaf count = 48
\[\left \{\left \{y(x)\to -\frac {\sin (a x) \left (\log \left (\cos \left (\frac {a x}{2}\right )\right )-\log \left (\sin \left (\frac {a x}{2}\right )\right )\right )}{a^2}+c_2 \sin (a x)+c_1 \cos (a x)\right \}\right \}\]
✓ Maple : cpu = 0.043 (sec), leaf count = 43
\[ \left \{ y \left ( x \right ) =\sin \left ( ax \right ) {\it \_C2}+\cos \left ( ax \right ) {\it \_C1}+{\frac {\sin \left ( ax \right ) \left ( \ln \left ( \cos \left ( ax \right ) -1 \right ) -\ln \left ( \cos \left ( ax \right ) +1 \right ) \right ) }{2\,{a}^{2}}} \right \} \]