Consider the integral $I=\int_{-\infty}^{\infty} \frac{1}{x^{2}+1}$ 
Consider the integral $I=\int_{-\infty}^{\infty} \frac{1}{x^{2}+1}\, dx$. Show how to evaluate this integral by considering $\oint_{C_{(R)}} \frac{1}{z^{2}+1}, dz$ where $C_{R}$ is the closed semicircle in the upper half plane with endpoints at $(-R, 0)$ and $(R, 0)$ plus the $x$ axis.

Could someone help me through this problem?
 A: Let $f(z)=\frac{1}{z^2+1}$ and the contour $C$ be the closed half circle of radius R as described above.  Let $C_R$ be the arc of the half circle $C$ with radius $R$.  Using residue theorem, we have
$$\oint_{C}f(z) dz=\int_{-\infty}^{\infty}f(x)dx+\int_{C_R}f(z) dz=2\pi i\sum\text{Residues} \Rightarrow \int_{-\infty}^{\infty}f(x)dx = 2\pi i\sum\text{Residues}-\int_{C_R}f(z) dz$$
We start by proving 
$$\lim_{R \to \infty}\int_{C_R}f(z) dz=0$$
We let M be the maximum value of the function on the contour, and L be the length of the
contour.
$$\left|\int_{C_R}\frac{dz}{z^2+1}\right| \leq ML$$
By inspection, $L = \pi R$.  We proceed to find M:
$$M=\left|\frac{1}{z^2+1}\right|=\frac{1}{|z^2+1|}=\frac{1}{|z|^2+1}=\frac{1}{R^2+1}$$
Thus
$$\lim_{R \to \infty}\left|\int_{C_R}\frac{dz}{z^2+1}\right| \leq \lim_{R \to \infty} ML=\lim_{R \to \infty} \frac{\pi R}{R^2+1}=0$$
So this integral becomes zero.
Now we have
$$\int_{-\infty}^{\infty}\frac{dx}{x^2+1} = 2\pi i\sum\text{Residues}$$
so we must find the required residues.  To compute the residues, we expand $f(z)$ and find that there are singularities when $z= \pm i$
$$f(z)=\frac{1}{(z+i)(z-i)}$$
The singularity $z=i$ is the only one within the contour $C$, so this is the only residue we need to compute. To compute this residue (let it be called $b$), we do the following:
$$b=\lim_{z \to i} (z-i)f(z) =\lim_{z \to i} \frac{(z-i)}{(z+i)(z-i)}=\frac{1}{(i+i)}=\frac{1}{2i}$$
This is the only residue that needs to be computed, thus we can find the value of the integral:
$$\int_{-\infty}^{\infty}\frac{dx}{x^2+1} = 2\pi i b = \frac{2 \pi i}{2 i}=\pi$$
So the integral is found to equal $\pi$.
A: Denote the semicircle part $A$ and the $(-R,R)$ part $B$ (these are contours that make up $C$).


*

*Using the Residue theorem, what is $\oint_{C(R)}\frac{dz}{z^2+1}$?

*Can you find an upper bound for $\int_{A(R)}\frac{dz}{z^2+1}$ in terms of $R$? First bound the integrand.

*Notice the fact that $$\oint_{C(R)}=\int_{A(R)}+\int_{B(R)}.$$ You're interested in $\int_{B(R)}$ as $R\to\infty$. Can you use the previous two facts and take a limit?

