# $\int_{0}^{2\pi} \frac{1}{a+b\cos(x)}dx$

Evaluate $$\int_{0}^{2\pi} \frac{1}{a+b\cos(x)}dx$$

My attempt,

I let $u=\tan (\frac{x}{2})$

$du=\frac{1}{2} \sec^2 (\frac{x}{2})dx$, but then I realise that my lower and upper limit will change to $\int_{0}^{0}$. How to solve this definite integral? Thanks in advance.

EDITED

I could actually solve the integral without limits by this substitution, I would get $$\frac{2 \tan^{-1} (\frac{\sqrt{a-b} \tan (\frac{x}{2})}{\sqrt{a+b}})}{\sqrt{a-b} \sqrt{a+b}}+c$$

• As pointed out by other users, your substitution function has singularity at $x = \pi$, which renders any naive computation problematic. A quick remedy is to shift your domain of integration to $(-\pi, \pi)$. – Sangchul Lee May 18 '17 at 10:59
• $\cos x$ runs through the same values from $\pi$ to $2\pi$ as it does from $0$ to $\pi$ but in reverse. So your integral equals twice the integral from 0 to $\pi.$ If $a<b$, then you'll have singularities in your function which will cause more work. If $b<a$, then your substitution has a singularity at $\pi$ which also needs dealt with. – B. Goddard May 18 '17 at 11:03