##### 4.25.5 $$a^2 y(x)+y''(x)=\cot (a x)$$

ODE
$a^2 y(x)+y''(x)=\cot (a x)$ ODE Classiﬁcation

[[_2nd_order, _linear, _nonhomogeneous]]

Book solution method
TO DO

Mathematica
cpu = 0.17827 (sec), leaf count = 46

$\left \{\left \{y(x)\to \frac {\sin (a x) \left (a^2 c_2+\log \left (\sin \left (\frac {a x}{2}\right )\right )-\log \left (\cos \left (\frac {a x}{2}\right )\right )\right )}{a^2}+c_1 \cos (a x)\right \}\right \}$

Maple
cpu = 0.976 (sec), leaf count = 41

$\left [y \left (x \right ) = \sin \left (a x \right ) \textit {\_C2} +\cos \left (a x \right ) \textit {\_C1} +\frac {\sin \left (a x \right ) \ln \left (\frac {1-\cos \left (a x \right )}{\sin \left (a x \right )}\right )}{a^{2}}\right ]$ Mathematica raw input

DSolve[a^2*y[x] + y''[x] == Cot[a*x],y[x],x]

Mathematica raw output

{{y[x] -> C[1]*Cos[a*x] + ((a^2*C[2] - Log[Cos[(a*x)/2]] + Log[Sin[(a*x)/2]])*Si
n[a*x])/a^2}}

Maple raw input

dsolve(diff(diff(y(x),x),x)+a^2*y(x) = cot(a*x), y(x))

Maple raw output

[y(x) = sin(a*x)*_C2+cos(a*x)*_C1+sin(a*x)*ln((1-cos(a*x))/sin(a*x))/a^2]