Proving $\frac1{2\pi} \int_0^{2\pi} \frac{R^2-r^2}{R^2-2Rr\cos\theta+r^2} d\theta =1$ by integrating $\frac{R+z}{z(R-z)}$ without residue theorem. I was given the function:
$$ \frac{R+z}{z(R-z)} $$
And I was asked to integrate it around a closed contour to prove:
$$\frac1{2\pi} \int_0^{2\pi} \frac{R^2-r^2}{R^2-2Rr\cos\theta+r^2} d\theta =1$$
I've seen people get a proof quite easily by using the residue theorem, but I have not studied it yet so I am not supposed to do it.
My attempt:
Let $\gamma = re^{it}$,
$$\int_\gamma f dz = \int_\gamma \frac1z + \frac2{R-z} dz$$
$$\Rightarrow \int_\gamma f dz = \int_0^{2\pi} \frac{ire^{it}}{re^{it}}dt + \int_0^{2\pi} \frac{2ire^{it}}{R-re^{it}}dt$$
$$ = 2\pi i + \int_0^{2\pi} \frac{2Rr\cos t + 2r}{R^2+2Rr\cos t + r^2} dt$$
But I don't know what else should I do. Any ideas?
Edit: Sorry I had a typo, the function to integrate was $ \frac{R+z}{z(R-z)} $ and not $ \frac{R-z}{z(R-z)} $
 A: We could avoid complex analysis altogether
$$I = \frac{1}{\pi}\int_0^\pi \frac{R^2-r^2}{R^2+r^2 - 2Rr\cos\theta}\:d\theta$$
$$ = \frac{1}{\pi}\int_0^\pi \frac{R^2-r^2}{R^2+r^2\left(\cos^2\frac{\theta}{2}+\sin^2\frac{\theta}{2}\right) - 2Rr\left(\cos^2\frac{\theta}{2}-\sin^2\frac{\theta}{2}\right)}\:d\theta$$
$$\frac{1}{\pi}\int_0^\pi \frac{(R-r)(R+r)}{(R-r)^2\cos^2\frac{\theta}{2}+(R+r)^2\sin^2\frac{\theta}{2}}\:d\theta = \frac{2}{\pi}\int_0^\pi \frac{\left(\frac{R-r}{R+r}\right)\cdot\frac{1}{2}\sec^2\theta\:d\theta}{\left(\frac{R-r}{R+r}\right)^2+\tan^2\frac{\theta}{2}}$$
$$= \frac{2}{\pi}\tan^{-1}\left[\left(\frac{R-r}{R+r}\right)\tan\frac{\theta}{2}\right]\Biggr|_0^{\pi^-} = 1$$
with the assumption that $|R|\neq|r|$
A: For each $0<r<1$
$$
P_{r}(x)=\frac{1-r^2}{1-2r\cos(x)+r^2}.
$$
can be expressed as
$$
P_r(x)=\sum_{n\in\mathbb{Z}}r^{|n|}\text{e}^{ixn}=
\text{Re}\Big(
\frac{1+z}{1-z}\Big)=\frac{1-|z|^2}{|1-z|^2},
$$
where $z=r\text{e}^{ix}$ and $|x|\leq\pi$. Since the trigonometric series is uniformly convergent, the order of summation and integration can be change to get
$$\frac{1}{2\pi}\int^{\pi}_{-\pi} P_t(x)\,dx=\frac{1}{2\pi}\sum_{n\in\mathbb{Z}}r^{|n|}\int^{\pi}_{-\pi}e^{ixn}\,dx = 1$$
since $\frac{1}{2\pi}\int^{\pi}_{-\pi}e^{inx}\,dx=0$ for all $n\in\mathbb{Z}\setminus\{0\}$.
A: $$I = \frac{1}{\pi}\int_0^\pi \frac{R^2-r^2}{R^2+r^2 - 2Rr\cos(\theta)}\:d\theta$$ Use the tangent half-angle substitution to get
$$I = \frac{2}{\pi}\int_0^\infty \frac{(R-r) (R+r)}{t^2 (R+r)^2+(R-r)^2}\,dt$$
$$t=\frac{ (R-r)}{r+R}x \implies I=\frac{2}{\pi}\int_0^\infty \frac{dx}{x^2+1}=\frac{2}{\pi}\frac \pi 2=1$$
A: I would like to thank everyone. Your answers were very useful and helped me to approach the problem in different ways. Unfortunately, none of them was the answer I was expecting to get to.
The final solution I finally came to was this (considering the themes I have studied):
for any $0<r<R$, let $\gamma = re^{it}$, then:
$$\int_\gamma f dz = \int_\gamma \frac1z + \frac2{R-z} dz$$
$$\Rightarrow \int_\gamma f dz = \int_0^{2\pi} \frac{ire^{it}}{re^{it}}dt + \int_0^{2\pi} \frac{2ire^{it}}{R-re^{it}}dt$$
$$ = 2\pi i + \int_0^{2\pi} \frac{2ire^{it}}{R-re^{it}} dt$$
Since $r<R$, the right function is holomorphic inside $\gamma$, which means $2\pi i + \int_0^{2\pi} \frac{2ire^{it}}{R-re^{it}} dt = 2\pi i$.
So we can make:
$$ 2\pi i = \int_0^{\pi} \frac{(R+re^{it})ire^{it}}{(R-re^{it})re^{it}}dt$$
$$ \Rightarrow 2\pi i = i \int_0^{2\pi} \frac{R+re^{it}}{R-re^{it}} dt \\
 = i \int_0^{2\pi} \frac{R+r\cos t + ir\sin t}{R-r\cos t - ir\sin t}\left( \frac{R-r\cos t + ir\sin t}{R-r\cos t + ir\sin t} \right) dt \\
 = i\int_0^{2\pi} \frac{R^2 - r^2+2iRr\sin t}{R^2 -2rR\cos t + r^2} dt $$
By taking the real and imaginary parts in both $2\pi i$ and the integral we get:
$$ 2\pi = \int_0^{2\pi} \frac{R^2 - r^2}{R^2 -2rR\cos t + r^2} dt \\ \Rightarrow 1 = \frac{1}{2\pi} \int_0^{2\pi} \frac{R^2 - r^2}{R^2 -2rR\cos t + r^2} dt$$
