How to find the intergral $I_{A}=\int_{0}^{2\pi}\frac{\sin^2{x}}{(1+A\cos{x})^2}dx$ Let $A\in (0,1)$be give real number ,find the closed form  intergral 
$$I_{A}=\int_{0}^{2\pi}\dfrac{\sin^2{x}}{(1+A\cos{x})^2}dx$$
This integral comes from a physical problem，following is my try:
since
$$I_{A}=\int_{0}^{2\pi}\dfrac{\sin^2{x}}{(1+A\cos{x})^2}dx=I_{1}+I_{2}$$
Where $$I_{1}=\int_{0}^{\pi}\dfrac{\sin^2{x}}{(1+A\cos{x})^2}dx,I_{2}=\int_{\pi}^{2\pi}\dfrac{\sin^2{x}}{(1+A\cos{x})^2}dx$$
For $I_{2}$ Let $x=\pi+t$,then we have
$$I_{2}=\int_{0}^{\pi}\dfrac{\sin^2{x}}{(1-A\cos{x})^2}dx$$
so 
$$I_{A}=I_{1}+I_{2}=2\int_{0}^{\pi}\dfrac{\sin^2{x}(1+A^2\cos^2{x})}{(1-A^2\cos^2{x})^2}dx=4\int_{0}^{\frac{\pi}{2}}\dfrac{\sin^2{x}(1+A^2\cos^2{x})}{(1-A^2\cos^2{x})^2}dx$$
Then I  fell ugly, so how to prove it? Thank you 
 A: Use integration by parts
$$\int \frac{\sin^2 x\ dx}{(1+A\cos x)^2}$$
$$=\int \sin x\cdot \frac{\sin x}{(1+A\cos x)^2}\ dx$$
$$=\sin x\cdot \frac{1}{A(1+A\cos x)}-\int \frac{\cos x}{A(1+A\cos x)}\ dx$$
$$=\frac{\sin x}{A(1+A\cos x)}-\frac{1}{A^2}\int \frac{(1+A\cos x)-1}{1+A\cos x}\ dx$$
$$=\frac{\sin x}{A(1+A\cos x)}-\frac{x}{A^2}+\frac{1}{A^2}\int \frac{dx}{1+A\cos x}$$
$$=\frac{\sin x}{A(1+A\cos x)}-\frac{x}{A^2}+\frac{1}{A^2}\int \frac{dx}{1+A\frac{1-\tan^2\frac x2}{1+\tan^2\frac x2}}$$
$$=\frac{\sin x}{A(1+A\cos x)}-\frac{x}{A^2}+\frac{2}{A^2}\int \frac{\frac 12\sec^2\frac x2dx}{(1-A)\left(\frac{1+A}{1-A}+\tan^2\frac x2\right)}$$
$$=\frac{\sin x}{A(1+A\cos x)}-\frac{x}{A^2}+\frac{2}{A^2(1-A)}\int \frac{d\left( \tan\frac x2\right)}{\left(\tan\frac x2\right)^2+\left(\sqrt{\frac{1+A}{1-A}}\right)^2}$$
$$=\frac{\sin x}{A(1+A\cos x)}-\frac{x}{A^2}+\frac{2}{A^2\sqrt{1-A^2}}\tan^{-1}\left(\tan\frac{x}{2}\sqrt{\frac{1-A}{1+A}}\right)$$
$$\therefore \int_0^{2\pi} \frac{\sin^2 x\ dx}{(1+A\cos x)^2}=2\int_0^{\pi} \frac{\sin^2 x\ dx}{(1+A\cos x)^2}=\color{blue}{\frac{2\pi}{A^2}\left(\frac{1}{\sqrt{1-A^2}}-1\right)}$$
A: Most probably you would like to have a formula depending on $A$.
Using complex residues we need to find the residues of 
$$f(z) = -\frac{(z^2-1)^2}{A^2 z \left(1 + \frac{2z}{A}+ z^2\right)^2}$$
within the unit disc.
$f(z)$ has a single pole at $z=0$ and for $0<A<1$ a pole of order $2$ at $z_A=\frac{\sqrt{1-A^2}-1}{A}$.
While the residue at $z=0$ is easy to calculate, the residue at $z_A$ is a bit ugly. So, I used Mathematica to calculate the residue at $z_A$ and will give only the final result without further simplifying:
$$I_A = 2\pi\left(Res_{z=0}f(z) + Res_{z=z_A}f(z)\right)$$
$$= 2 \pi  \left(-\frac{1}{A^2} + \frac{A^2+2 \sqrt{1-A^2}-2}{A^2 \left(\left(\sqrt{1-A^2}-2\right) A^2-2 \sqrt{1-A^2}+2\right)}\right)$$
Of course, I tested it numerically and the formula produces nicely the searched for integral:
$$\left(
\begin{array}{ccc}
 \text{A} & I_A \text{numerical} & I_A \text{ via residues} \\
 0.1 & 3.16535 & 3.16535 \\
 0.2 & 3.2391 & 3.2391 \\
 0.3 & 3.37092 & 3.37092 \\
 0.4 & 3.57707 & 3.57707 \\
 0.5 & 3.88805 & 3.88805 \\
 0.6 & 4.36332 & 4.36332 \\
 0.7 & 5.13272 & 5.13272 \\
 0.8 & 6.54498 & 6.54498 \\
 0.9 & 10.0388 & 10.0388 \\
\end{array}
\right)$$
