Finding $\int^{\pi}_{0}\frac{1}{\sqrt{a-\cos x}}dx$ 
Finding $$\int^{\pi}_{0}\frac{1}{\sqrt{a-\cos x}}dx$$

Try:  using $$\cos x =\frac{1-\tan^2\frac{x}{2}}{1+\tan^2\frac{x}{2}}$$
$$\int^{\pi}_{0}\frac{\sec \frac{x}{2}}{\sqrt{(a-1)+(a+1)\tan^2\frac{x}{2}}}dx$$
Could some help me to solve it , thanks

Starting from
$$I(a)=\int^{\pi}_{0}\frac{\sec \frac{x}{2}}{\sqrt{(a-1)+(a+1)\tan^2\frac{x}{2}}}\mathrm{d}x$$
Let us consider the map $x\mapsto 2x$ and factor out the $(a-1)$ term, so that
$$I(a)=\frac{2}{\sqrt{a-1}}\int_{0}^{\pi/2}\frac{\sec x}{\sqrt{1+\dfrac{a+1}{a-1}\tan^2 x}}\mathrm{d}x \\
=\frac{2}{\sqrt{a-1}}\int_{0}^{\pi/2}\frac{1}{\sqrt{\cos^2x+\dfrac{a+1}{a-1}\sin^2 x}}\mathrm{d}x \\
=\frac{2}{\sqrt{a-1}}\int_{0}^{\pi/2}\frac{1}{\sqrt{1-\sin^2x+\dfrac{a+1}{a-1}\sin^2 x}}\mathrm{d}x \\
=\frac{2}{\sqrt{a-1}}\int_{0}^{\pi/2}\frac{1}{\sqrt{1-\dfrac{2}{1-a}\sin^2 x}}\mathrm{d}x $$
By defining $m=\dfrac{2}{1-a}$, the last integral reads
$$\int_{0}^{\pi/2}\frac{1}{\sqrt{1-m\sin^2 x}}\mathrm{d}x = K(m)$$
where $K(m)$ is the complete elliptic integral of the first kind.
Finally
$$ I(a) = \frac{2}{\sqrt{a-1}}K\left(\frac{2}{1-a}\right) $$
