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$$

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}$$
