\[ a^2 y(x)-\cot (a x)+y''(x)=0 \] ✓ Mathematica : cpu = 0.0340277 (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_1 \cos (a x)+c_2 \sin (a x)\right \}\right \}\] ✓ Maple : cpu = 0.147 (sec), leaf count = 41
\[ \left \{ y \left ( x \right ) =\sin \left ( ax \right ) {\it \_C2}+\cos \left ( ax \right ) {\it \_C1}+{\frac {\sin \left ( ax \right ) }{{a}^{2}}\ln \left ( {\frac {1-\cos \left ( ax \right ) }{\sin \left ( ax \right ) }} \right ) } \right \} \]