Question:
$$\int_0^{4\pi}\frac{dx}{5+4\cos x} $$
My approach:
First I calculated the antiderivative as follows:
Using: $\cos\theta= \frac{1-\tan^2\frac{\theta}{2}}{1+\tan^2\frac{\theta}{2}}$ we have:
$\int\frac{dx}{5+4\cos x}=\int\frac{dx}{5+4\frac{1-\tan^2\frac{x}{2}}{1+\tan^2\frac{x}{2}}}=\int\frac{1+\tan^2\frac{x}{2}}{5+5\tan^2\frac{x}{2}+4-4\tan^2\frac{x}{2}}dx=\int\frac{\frac{1}{\cos^2 \frac{x}{2}}}{3^2+\tan^2\frac{x}{2}}dx$
Using substitution we have:
$u=\tan\frac{x}{2}$
$du=\frac{1}{2}\frac{1}{\cos^2\frac{x}{2}}dx$
$2\int\frac{\frac{1}{2}\frac{1}{\cos^2 \frac{x}{2}}}{3^2+\tan^2\frac{x}{2}}dx=2\int\frac{du}{3^2+u^2}=\frac{2}{3}\arctan\frac{u}{3}+\mathscr{C}=\frac{2}{3}\arctan\frac{\tan\frac{x}{2}}{3}+ \mathscr{C}$
Now we can calculate the definite integral as follows:
$\int_0^{4\pi}\frac{dx}{5+4\cos x} = \frac{2}{3}\arctan\frac{\tan\frac{x}{2}}{3}\bigl|_0^{4\pi}=\frac{2}{3}(\arctan\frac{\tan\frac{4\pi}{2}}{3}-\arctan\frac{\tan\frac{0}{2}}{3})=0$
The result I get is $0$ but the correct one is $\frac{4\pi}{3}$. Can someone explain me why?