\[ a^2 y(x)-\cot (a x)+y''(x)=0 \] ✓ Mathematica : cpu = 0.0428319 (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.121 (sec), leaf count = 41
\[\left \{y \left (x \right ) = c_{1} \cos \left (a x \right )+c_{2} \sin \left (a x \right )+\frac {\ln \left (\frac {-\cos \left (a x \right )+1}{\sin \left (a x \right )}\right ) \sin \left (a x \right )}{a^{2}}\right \}\]