# Proving $\int_0^{2\pi} \frac{R^2-r^2}{R^2-2Rrcos(t)+r^2}dt=2\pi$ using complex integration

Let $$0 We evaluate $$\int_\gamma \frac{R+z}{(R-z)z} dz$$ Using partial fraction and Cauchy integral formula,$$\int_\gamma \frac{R+z}{(R-z)z} dz=\int_\gamma \frac{2}{(R-z)}dz+\int_\gamma \frac{1}{z}dz=2\pi i$$

And we have $$\int_\gamma \frac{R+z}{(R-z)z}dz=\int_0^{2\pi} \frac{R+re^{it}}{(R-re^{it})re^{it}}ire^{it}dt$$

$$=i\int_0^{2\pi} \frac{(R+rcos(t))+irsin(t)}{(R-rcos(t))-irsin(t)}dt$$

$$=i\int_0^{2\pi} \frac{(R+rcos(t))+irsin(t)(R-rcos(t))+irsin(t)}{R^2-2Rrcos(t)+r^2}dt$$

$$=i\int_0^{2\pi} \frac{R^2-r^2+2iRrcos(t)}{R^2-2Rrsin(t)+r^2}dt$$

I am stuck here, can someone help to move further?

You already know that$$i\int_0^{2\pi}\frac{R^2-r^2+2irR\sin(t)}{R^2+r^2-2rR\cos(t)}\,\mathrm dt=2\pi i,$$which is equivalent to$$\int_0^{2\pi}\frac{R^2-r^2+2irR\sin(t)}{R^2+r^2-2rR\cos(t)}\,\mathrm dt=2\pi.$$But then\begin{align}\int_0^{2\pi}\frac{R^2-r^2}{R^2+r^2-2rR\cos(t)}\,\mathrm dt&=\operatorname{Re}\left(\int_0^{2\pi}\frac{R^2-r^2+2irR\sin(t)}{R^2+r^2-2rR\cos(t)}\,\mathrm dt\right)\\&=2\pi.\end{align}