# 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 ?

• It means $$\frac{\arctan(2\tan(x/2))}{2}+C$$ – Dr. Sonnhard Graubner Jun 29 '18 at 16:47
• @Dr.SonnhardGraubner O.k. but it cancel out because we add $C$ and then subtract $C$ in the definite integral !, – Ahmad Jun 29 '18 at 16:50
• I think the problem is that $\tan(x/2)$ has a discontinuity at $x=\pi$ – Alex Pavellas Jun 29 '18 at 16:52
• When you write \arctan 2 \tan\frac x 2 then you see $\arctan 2\tan\frac x 2,$ but when you write \arctan 2{\tan\frac x 2} then you see $\arctan 2{\tan\frac x 2},$ with less space than there should be after the $2.$ And the reason for that becomes clear if you recall how things like \tan work. I edited accordingly. – Michael Hardy Jun 29 '18 at 17:50

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.