I'm having a trouble with this integral expression:
$$\int_0^{2\pi} \frac{d\theta}{A+B \cos\theta}$$
I've done this substitution: $t= \tan(\theta/2)$
and get: $\displaystyle \cos\theta= \frac{1-t^2}{1+t^2}$ and $\displaystyle d\theta=\frac{2}{1+t^2}dt$ where $\displaystyle \cos^2\theta/2=\frac{1}{1+t^2}$
then the integral becomes:
$$\int\frac{2 \, dt}{(A-B)t^2+(A+B)}= \sqrt\frac{A+B}{A-B} \arctan \left(\left(\sqrt\frac{A+B}{A-B} \right) t\right)$$
However, I'm not sure about the new limits since $\tan$ has period $\pi$ so what I have to do at this point to decide the new limits? And of course if you find some mistake in what I've done before, please let me know!