TITLE: How to calculate the integration $\int_{0}^{\pi}\frac{dx}{(2-\cos{x})^2}$
QUESTION [6 upvotes]: Given that 
$$
\int_{0}^{\pi}\frac{dx}{2-\cos{x}}=\frac{\pi}{\sqrt{a^2-1}}
$$
How to calculate the integral
$$
\int_{0}^{\pi}\frac{dx}{(2-\cos{x})^2}
$$

REPLY [11 votes]: We have
$$
\mathcal{I}(a)=\int_0^{\large\pi} \frac{d\theta}{a-\cos\theta}=\frac{\pi}{\sqrt{a^2-1}},
$$
then differentiating both the sides with respect to $a$, you will obtain
$$
\mathcal{I}'(a)=\int_0^{\large\pi} \frac{d\theta}{(a-\cos\theta)^2}=\frac{a\pi}{(a^2-1)^{\large\frac32}}.
$$