Prove that $\frac{1}{2\pi}\int_0^{2\pi}\frac{R^2-r^2}{R^2-2Rr\cos\theta+r^2}d\theta=1$ Let $C=\{z:|z|=r|\}$ with $r<R$ oriented in + sense. calcule:
$$\int_{C}\frac{R+z}{z(R-z)}dz$$
and deduce that 
$$\frac{1}{2\pi}\int_0^{2\pi}\frac{R^2-r^2}{R^2-2Rr\cos\theta+r^2}d\theta=1$$
My attempt
I proved that $$\int_{C}\frac{R+z}{z(R-z)}dz=2\pi i$$
Using Residue theorem because the residue of the function is $a_{-1}=1$ and the function have a simple polo at $z=0$.
For the other part i'm a little stuck, can someone help me?
 A: Hint
You have 
$$\begin{aligned}2 i \pi = \int_{C}\frac{R+z}{z(R-z)}dz &= i\int_0^{2\pi}\frac{R+e^{i \theta}}{re^{i \theta}(R-e^{i \theta})}re^{i \theta}d\theta\\
&= i\int_0^{2\pi}\frac{(R+re^{i \theta})(R-re^{-i \theta})}{R^2-2Rr\cos\theta+r^2}d\theta\\
&= i\int_0^{2\pi}\frac{R^2-r^2}{R^2-2Rr\cos\theta+r^2}d\theta -2\int_0^{2\pi}\frac{rR \sin \theta}{R^2-2Rr\cos\theta+r^2}d\theta
\end{aligned}$$ using the parameterization $\theta \mapsto re^{i \theta}$ of $C$, $\cos \theta = \frac{e^{i \theta} + e^{-i \theta}}{2}$ and $\sin \theta = \frac{e^{i \theta} - e^{-i \theta}}{2i}$.
And the last integral vanishes as $\sin$ is an odd map.
A: Define : \begin{aligned} f:\mathbb{C}\setminus\left\lbrace\frac{R}{r},\frac{r}{R}\right\rbrace&\rightarrow\mathbb{C}\\ z&\mapsto\frac{R^{2}-r^{2}}{\left(R-rz\right)\left(Rz-r\right)} \end{aligned}
Since $ r<R $, the residue theorem allows us to write : $$ \oint_{\left|z\right|=1}{f\left(z\right)\mathrm{d}z}=2\pi\,\mathrm{i}\,\mathrm{Res}\left(f,\frac{r}{R}\right) $$
Calculating the residue : $ \mathrm{Res}\left(f,\frac{r}{R}\right)=\lim\limits_{z\to \frac{r}{R}}\left(z-\frac{r}{R}\right)f\left(z\right)=\lim\limits_{z\to\frac{r}{R}}{\frac{R^{2}-r^{2}}{R^{2}-rRz}}=1 $, setting $ z=\mathrm{e}^{\mathrm{i}\,\theta} $ gives the following : $$ \frac{1}{2\pi}\int_{0}^{2\pi}{f\left(\mathrm{e}^{\mathrm{i}\,\theta}\right)\mathrm{e}^{\mathrm{i}\,\theta}\,\mathrm{d}\theta}=1 $$
Since $ f\left(\mathrm{e}^{\mathrm{i}\,\theta}\right)\mathrm{e}^{\mathrm{i}\,\theta}=\frac{R^{2}-r^{2}}{\left(R-r\,\mathrm{e}^{\mathrm{i}\,\theta}\right)\left(R-r\,\mathrm{e}^{-\mathrm{i}\,\theta}\right)}=\frac{R^{2}-r^{2}}{R^{2}-2rR\cos{\theta}+r^{2}} $, we get : $$ \frac{1}{2\pi}\int_{0}^{2\pi}{\frac{R^{2}-r^{2}}{R^{2}-2rR\cos{\theta}+r^{2}}\,\mathrm{d}\theta}=1 $$
