A problem with definite integral for trigonometric functions I need to evaluate $ \displaystyle \int\limits_{0}^{2\pi} \frac{dx}{5-3\cos x}$
The answer in the book is $\frac{\pi}{2}$.
What i did is $\displaystyle \int \frac{dx}{5-3\cos{x}} = \dfrac{\arctan {2 \tan{\frac{x}{2}}}}{2}$ , So evaluating from $0$ to $2\pi$ gives $0$
Where did i mistake ? How to evaluate definite integrals like this ?

The function mapping $x$ into $\frac{1}{2}\tan(2x)$ is increasing and differentiable on each connected component of its domain, but not everywhere. And we require that change of variables are given by one-to-one maps (at least essentially, with respect to some measure). A correct way to handle your integral is
$$\begin{eqnarray*} \int_{0}^{2\pi}\frac{dx}{5-3\cos x} &=& \int_{0}^{\pi}\frac{dx}{5-3\cos x}+\frac{dx}{5+3\cos x}\\&=&10\int_{0}^{\pi}\frac{dx}{25-9\cos^2 x}=20\int_{0}^{\pi/2}\frac{dx}{25-9\cos^2 x}\end{eqnarray*} $$
by exploiting symmetry and periodicity. By letting $x=\arctan t$ we get
$$ \int_{0}^{2\pi}\frac{dx}{5-3\cos x}=20 \int_{0}^{+\infty}\frac{dt}{25(1+t^2)-9}=\frac{\pi}{2}. $$
More generally, if $A>B>0$ we have $\int_{0}^{2\pi}\frac{dx}{A\pm B\cos x}=\frac{2\pi}{\sqrt{A^2-B^2}} $ through the same "trick", or through the residue theorem.
