How do you integrate $\int \frac{1}{a + \cos x} dx$? How do you integrate $\int \frac{1}{a + \cos x} dx$?  Is it solvable by elementary methods?  I was trying to do it while incorrectly solving a homework problem but I couldn't find the answer.
Thanks!

Let $ y = \frac{x}{2}$.
$$\frac{1}{a + \cos 2y} = \frac{1}{a -1 + 2\cos ^2 y} = \frac{\sec^2 y}{(a-1)\sec^2 y + 2} = \frac{\sec^2 y}{a + 1 + (a-1)\tan^2 y} $$
Thus 
$$\int \frac{1}{a + \cos x} \text{d}x = \int \frac{2}{a + \cos 2y} \text{d}y $$
$$ = \int \frac{ 2\sec^2 y}{ a + 1 + (a-1)\tan^2 y} \text{d} y$$
Now make the subsitution $t = \tan y$.
I remember having used the same trick before: Summing the series $ \frac{1}{2n+1} + \frac{1}{2} \cdot \frac{1}{2n+3} + \cdots \ \text{ad inf}$
