Integration of a trigonometric function

I am having some difficulties with the calculation of the following integral. Can somebody help me please?

$$\int \frac{dx}{1+a\cos x},\text{ for }0<a<1$$

-
How many times are you going to ask the same question? –  Mike Nov 7 '12 at 13:51
It is not the same question. It is another exercise.. –  user43418 Nov 7 '12 at 13:52
It's the same basic integral rewritten. You've now had 3 people give you the same answer on 3 separate questions. –  Mike Nov 7 '12 at 13:57

Detailed hint:

Wikipedia calls this the The Weierstrass Substitutiion: when $t=\tan(\theta/2)$, \begin{align} \sin(\theta)&=\frac{2t}{1+t^2}\\ \cos(\theta)&=\frac{1-t^2}{1+t^2}\\ \tan(\theta)&=\frac{2t}{1-t^2}\\ \mathrm{d}\theta&=\frac{2\mathrm{d}t}{1+t^2} \end{align}

-

Hint 1: $\cos x=\frac{1-t^2}{1+t^2}$ which $t=\tan\frac{x}{2}$.

Hint 2: $t=\tan\frac{x}{2}\Rightarrow dt=\frac{1}{2}\sec^2\frac{x}{2}dx=\frac{1}{2}(t^2+1)dx$.

-
How do you replace the dx in integral expression ? I have a similar integral to calculate –  Carpediem Nov 7 '12 at 13:55
So we have: $\int \frac{\frac{2}{t^2+1}}{1+a\frac{1-t^2}{1+t^2}}$ –  user43418 Nov 7 '12 at 14:09