\[ y''(x)=\cot (2 x) y'(x)-2 y(x) \] ✓ Mathematica : cpu = 0.147114 (sec), leaf count = 80
DSolve[Derivative[2][y][x] == -2*y[x] + Cot[2*x]*Derivative[1][y][x],y[x],x]
\[\left \{\left \{y(x)\to c_1 \left (\cos ^2(x)-\frac {1}{2}\right )-\frac {2}{3} c_2 \cos ^{\frac {3}{2}}(x) \left (2 \cos ^2(x) \, _2F_1\left (\frac {1}{4},\frac {3}{4};\frac {7}{4};\cos ^2(x)\right )-\, _2F_1\left (\frac {1}{4},\frac {3}{4};\frac {7}{4};\cos ^2(x)\right )+3 \left (1-\cos ^2(x)\right )^{3/4}\right )\right \}\right \}\] ✓ Maple : cpu = 0.183 (sec), leaf count = 30
dsolve(diff(diff(y(x),x),x) = cos(2*x)/sin(2*x)*diff(y(x),x)-2*y(x),y(x))
\[y \left (x \right ) = \left (\sin ^{\frac {3}{4}}\left (2 x \right )\right ) \left (\LegendreP \left (\frac {1}{4}, \frac {3}{4}, \cos \left (2 x \right )\right ) c_{1}+\LegendreQ \left (\frac {1}{4}, \frac {3}{4}, \cos \left (2 x \right )\right ) c_{2}\right )\]