Compute definite integral. I am trying to compute the integral:
$$\int_0^{2\pi}\frac{d\theta}{r-cos(\theta)}$$
I tried to set $u = \tan(\frac{\theta}{2})$ but is it impossible because $\tan(\frac{2\pi}{2}) = \tan(\pi) = 0$

I'll appreciate some guidance.
HINT:

Inasmuch as the cosine function is even and $2\pi$-periodic, we have

$$\int_0^{2\pi }\frac{1}{r-\cos(\theta)}\,d\theta=\int_{-\pi}^\pi\frac{1}{r-\cos(\theta)}\,d\theta=2\int_0^\pi \frac{1}{r-\cos(\theta)}\,d\theta$$
For $r&gt;1$ there is no problem that $\tan \theta$ is ever $0$, and then the solution is:

$$\frac{2 \pi}{\sqrt{r^2 - 1}}$$