How to Evaluate $ \int \! \frac{dx}{1+2\cos x} $ ? 
Possible Duplicate:
How do you integrate $\int \frac{1}{a + \cos x} dx$? 

I have come across this integral and I tried various methods of solving. The thing that gets in the way is the constant $2$ on the $\cos(x)$ term. I tried the conjugate (works without the 2$\cos x$), Weierstrass Substitution (not sure if I was applying it correctly), and others. Is there a way to solve this integral elegantly or some unknown (sneaky) trick when you come across families of similar integrals as this one?:
$$ \int \! \frac{dx}{1+2\cos x} $$

Generalization:
Let's consider $\cos x = \frac{1-t^2}{1+t^2}; t = \tan\frac{x}{2}; dx=\frac{2}{1+t^2} dt.$ Then we get that our integral becomes:
$$J = \int \frac{2dt}{(a+b)+(a-b) t^2}$$
I. For the case $a>b$, consider $a+b=u^2$ and  $a-b=v^2$, and obtain that:
$$J = 2\int \frac{dt}{u^2+v^2 t^2}=\frac{2}{uv} \arctan\frac{vt}{u} +C.$$
Turning back to our notation we get:
$$I=\frac{2}{\sqrt{a^2-b^2}} \arctan\left(\sqrt{\frac{a-b}{a+b}} \tan\frac{x}{2} \right) + C.$$
II. For the case $a<b$, consider $a+b=u^2$ and  $a-b=-v^2$, and obtain that:
$$J = 2\int \frac{dt}{u^2-v^2 t^2}=\frac{1}{uv}\ln\frac{u+vt}{u-vt} \ +C.$$
Turning back again  to out initial notation and have that:
$$I=\frac{2}{\sqrt{b^2-a^2}} \ln\frac{b+a \cos x + \sqrt{b^2-a^2} \sin x}{a+b \cos x} + C.$$
Also, note that $x$ must be different from ${+}/{-}\arccos(-\frac{a}{b})+2k\pi$ if $|\frac{a}{b}|\leq1$.
Q.E.D.
