Evaluating $\int_0^{\pi} \frac{1}{(2-\cos(x))^2}$

Hint : Let $$f(a) =\int_{0}^π\frac{dx}{a-cosx}$$

Now try taking derivative of this integral w.r.t. $a$.

$$f'(a)=-\int_{0}^π\frac{dx}{(a-cosx)^2}=\frac{-a\pi}{(a^2-1)^{3/2}}$$

Do you get any idea to proceed?


Note that $$\frac{d} {dx} \frac {\sin x} {a-\cos x} =\frac{a\cos x-1} {(a-\cos x) ^2} $$ and hence $$\int\frac{dx} {(a-\cos x) ^2}=-\frac{\sin x} {a-\cos x}-a\int\frac{dx} {a-\cos x} +a^2\int\frac{dx}{(a-\cos x) ^2}$$ or $$(a^2-1)\int\frac{dx}{(a-\cos x) ^2}=\frac{\sin x} {a-\cos x} +a\int\frac{dx} {a-\cos x} $$ and using the limits $0,\pi$ we get $$\int_{0}^{\pi}\frac{dx}{(a-\cos x) ^2}=\frac{\pi a} {(a^2-1)^{3/2}} $$