<s>[INST] Find $\int_0^{2\pi}\frac1{5-4\cos x}\ dx$ $$\int_0^{2\pi}\frac1{5-4\cos x}\ dx$$
How do I compute this integral? An online integral calculator gives an antiderivative as
$$\frac{2\arctan(3\tan\frac x2)}3$$
but then gives the definite integral as $\frac{2\pi}3$. Obviously this doesn't make sense as the antiderivative vanishes at $x=0$ and $x=2\pi$.
 [/INST] Sorry for being late
By ‘Rationalisation’
$$
\begin{aligned}
\int_0^{2 \pi} \frac{d x}{5-4 \cos x}=&2 \int_0^\pi \frac{d x}{5-4 \cos x} \\
= & 2 \int_0^\pi \frac{5+4 \cos x}{25-16 \cos ^2 x} d x \\
= & 10 \int_0^\pi \frac{d x}{25-16 \cos ^2 x}+8 \int_0^\pi \frac{\cos x}{25-16 \cos ^2 x} d x \\
= & 20 \int_0^{\frac{\pi}{2}} \frac{\sec ^2 x}{25 \sec ^2 x-16} d x+8 \int_0^\pi \frac{d(\sin x)}{9+\sin ^2 x} \\
= & 4 \int_0^{\frac{\pi}{2}} \frac{d(5 \tan x)}{(5 \tan x)^2+3^2}+\frac{8}{3}\left[\tan ^{-1}\left(\frac{\sin x}{3}\right)\right]_0^\pi \\
= & \frac{4}{3}\left[\tan ^{-1}\left(\frac{5 \tan x}{3}\right)\right]_0^{\frac{\pi}{2}} \\
= & \frac{2 \pi}{3}
\end{aligned}
$$
</s>