Given the integral
$$\int_{-\infty}^{\infty} \frac{1}{x^2+1} dx = \pi$$
Evaluate it using the following complex intregral
$$\oint_{C(r)} \frac{1}{z^2+1} \,dz$$
where $C(r)$ is the closed semicircle in the upper half plane with endpoints $(-r,0)$ and $(r,0)$. The following hint is also provided:
$$ \frac{1}{z^2+1}=\frac{-1}{2i}\bigg(\frac{1}{z+i}-\frac{1}{z-i}\bigg)$$
and that you should show the integral along the open semicircle vanishes as $r \rightarrow \infty$
I have begun approaching the problem by breaking up $C(r)$ into $C_1$ and $C_2$ where $C_1$ is the open semicircle and $C_2$ is the line segment from $x=-r$ to $x=r$, giving us
$$ \frac{-1}{2i} \bigg(\int_{C_1}^{} \frac{1}{z+i}-\frac{1}{z-i} dz+\int_{C_2}^{}\frac{1}{z+i}-\frac{1}{z-i} dz\bigg)$$
For the $C_2$ integral, $z=x$, however, I'm unsure how to show the the $C_1$ integral vanishes as $r\rightarrow \infty$. How should I proceed?
For $r>1$, take the following parametrization for $C_1$
$$\gamma:[0,2\pi]\to \Bbb{C},\ \gamma(t)=re^{it}$$ Then
$$\int_{C_1}\frac{dz}{z^2+1}=\int_0^{\pi}\frac{re^{it}}{r^2e^{2it}+1}dt$$
And since $|re^{it}|=r$ and $|r^2e^{2it}+1|\ge |r^2e^{it}|-|1|=|r^2|-1=r^2-1$ $$\int_0^{\pi}\frac{re^{it}}{r^2e^{2it}+1}dt≤\frac{r\pi}{r^2-1}$$
which goes to $0$ as $r\to \infty$.