Prove $\frac{1}{2 \pi} \int_0^{2\pi} \frac{1 - r^2}{1 + r^2 - 2r \cos{t}} dt = 1$ using contour integration The question is to solve the integral using concepts of contour integrals:
$$\frac{1}{2 \pi}   \int_0^{2\pi} \frac{1 - r^2}{1 + r^2 - 2r \cos{t}} dt = 1$$
 A: Remark: the integrand $P_r(t)$ is known as the Poisson kernel and the result follows immediately from a term-by-term integration of the normally converging (when $0\leq r<1$) series $P_r(t)=\sum_{n\in\mathbb{Z}}r^{|n|}e^{in t}$ over $[0,2\pi]$. But since you want contour integration...
Hint: when $0<r<1$ use Cauchy's integral formula given that
$$
\frac{1-r^2}{1+r^2-2r\cos t}=\mbox{Re}\left( \frac{1+re^{it}}{1-re^{it}}\right)=\mbox{Re}\left( \frac{1+z}{1-z}\right)\qquad z=re^{it}
$$
and factor $r^2$ out in the numerator and the denominator to reduce to the latter when $r>1$, which yields $-1$.
Details upon request: when $0<r<1$, the function$f(z)=\frac{1+z}{1-z}$ is holomorphic on the open unit disk, which contains $\gamma$ the circle of radius $r$ and center $0$. So by Cauchy's integral formula
$$1=f(0)=\frac{1}{2i\pi}\int_\gamma \frac{f(z)}{z}dz=\frac{1}{2i\pi}\int_0^{2\pi} \frac{1+re^{it}}{1-re^{it}}\cdot \frac{ire^{it}}{re^{it}}dt=\frac{1}{2\pi}\int_0^{2\pi} \frac{1+re^{it}}{1-re^{it}}dt$$whence
$$1=\mbox{Re}\left(\frac{1}{2\pi}\int_0^{2\pi} \frac{1+re^{it}}{1-re^{it}}dt\right)=\frac{1}{2\pi}\int_0^{2\pi}\mbox{Re}\left( \frac{1+re^{it}}{1-re^{it}}\right)dt=\frac{1}{2\pi}\int_0^{2\pi}\frac{1-r^2}{1+r^2-2r\cos t}dt.$$
When $r>1$, we have
$$
\frac{1}{2\pi}\int_0^{2\pi}\frac{1-r^2}{1+r^2-2r\cos t}dt=\frac{1}{2\pi}\int_0^{2\pi}\frac{-r^2(1-r^{-2})}{r^2(1+r^{-2}-2r^{-1}\cos t)}dt=-1
$$
by application of the above to $0<r^{-1}<1$.
For $r=0$, we find $1$. And for $r=1$, we get $0$.
A: Let $$I(r) = \dfrac{1}{2 \pi} \int_0^{2\pi} \frac{1 - r^2}{1 + r^2 - 2r \cos{t}} dt \tag{$\spadesuit$}$$
Splitting the integral from $0$ to $\pi$ and $\pi$ to $2\pi$, changing $t \to \pi-t$, in the second integral, we get
$$I(r) = \dfrac{1}{\pi} \int_0^{\pi} \frac{1 - r^2}{1 + r^2 - 2r \cos{t}} dt = \dfrac{1}{\pi} \int_0^{\pi} \frac{1 - r^2}{1 + r^2 + 2r \cos{t}} dt$$
Replacing $t$ by $2t$ in $(\spadesuit)$, we get that
$$I(r) = \dfrac1{\pi} \int_0^{\pi} \frac{1 - r^2}{1 + r^2 - 2r \cos{2t}} dt = \dfrac1{\pi} \int_0^{\pi} \dfrac{1 - r^2}{(1+r)^2-4r \cos^2(t)} dt$$
\begin{align}
I(r^2) & = \dfrac1{\pi} \int_0^{\pi} \dfrac{1 - r^4}{(1+r^2)^2-4r^2 \cos^2(t)} dt\\
& = \dfrac1{2\pi}\left(\int_0^{\pi} \dfrac{1 - r^2}{1+r^2-2r \cos(t)} dt + \int_0^{\pi} \dfrac{1 - r^2}{1+r^2+2r \cos(t)} dt\right)\\
& = I(r)
\end{align}
Now note that $I(r)$ is continuous for $r \in [0,1)$ and $r \in (1,\infty)$. Now note that
$$I(0) = 1 \text{ and } \lim_{r \to \infty} I(r) = -1$$
Since $I(r) = I(r^2)$, we have $I(r) = \cdots I(r^{2^n})$. For $r\in [0,1)$, we have
$$I(r) = \lim_{n \to \infty} I(r^{2^n}) = I(\lim_{n \to \infty} r^{2^n}) = I(0) = 1$$
For $r\in (1,\infty)$, we have
$$I(r) = \lim_{n \to \infty} I(r^{2^n}) = I(\lim_{n \to \infty} r^{2^n}) = -1$$
Hence,
$$I(r) = \begin{cases} 1 & \text{ if }r\in[0,1)\\ 0 & \text{ if } r = 1\\ -1 & \text{ if }r \in (1,\infty)\end{cases}$$
