Better way to evaluate $\int \frac{dx}{\left (a +b\cos x \right)^2}$ $$\int \frac{dx}{\left (a +b\cos x \right)^2}$$
$$u=\frac{b +a \cos x}{a +b\cos x }$$
$$du=\frac{\sin x\left(b^2 -a^2\right)}{ \left (a +b.\cos x \right)^2}$$
$$\frac{du}{\sin x\left(b^2 -a^2\right)}=\frac{dx}{\left (a +b\cos x \right)^2}$$
$$\cos x=\frac{au -b}{a - bu}  $$
$$\sin x=\sqrt{1-\left(\frac{au -b}{a - bu}\right)^2}$$
 It is becoming messy with this .I also tried it using half angle formula but didn't find it good.

HINT
Put $$A=\frac{\ sin x}{a+b\cos x} $$now differentiate both sides and after simplification integrate it up to get the desired result.
