Best way to evaluate integral with contour integration? I'm trying to evaluate the integral:
$$\int_{-\infty}^{\infty}\frac{\sin^2{x}}{x^2}dx$$ with contour integration and am not sure if the basic idea of what I'm doing is correct.
I know that $$\sin{x} = \frac{e^{ix} - e^{-ix}}{2i}$$ and thus $\sin^2{x} = e^{2ix} + e^{-2ix} -2$.
Thus, can I solve
$$\int_{\infty}^{\infty}\frac{e^{2iz}+e^{-2iz} -2}{-4z^2}dz$$ using the indented semicircle contour and take its real part to obtain the solution to my original integral?
 A: Your method almost works.  Note that the integrals 
$\int_{-\infty}^{\infty}\frac{e^{2iz}}{-4z^2}dz$ and
$\int_{-\infty}^{\infty}\frac{e^{-2iz}}{-4z^2}dz$
require different contours.
Alternatively, note that
$$
\sin^2x = \frac{1 - \cos (2x)}{2} = \Re \left( \frac{1 - e^{2ix}}{2} \right)
$$
So that we can calculate
$$
\Re \left(\int_{-\infty}^{\infty}\frac{1 - e^{2iz}}{2z^2}dz \right)
$$
A: Consider the contour
$$
\gamma_1=[-R,R]\cup R-i[0,1]\cup[R,-R]-i\cup-R-i[1,0]
$$
Since there are no singularities of $\frac{\sin^2(z)}{z^2}$, we get
$$
\int_{\gamma_1}\frac{\sin^2(z)}{z^2}\mathrm{d}z=0
$$
Since the integral over each of the two short segments is bounded by $\dfrac1{R^2}\to0$ we get
$$
\int_{-\infty}^\infty\frac{\sin^2(x)}{x^2}\mathrm{d}x
=\int_{-\infty-i}^{\infty-i}\frac{\sin^2(x)}{x^2}\mathrm{d}x
$$
Consider the contour
$$
\gamma_2=[-R,R]-i\cup Re^{i[0,\pi]}-i
$$
which encloses the singularity at $z=0$, and the contour
$$
\gamma_3=[-R,R]-i\cup Re^{-i[0,\pi]}-i
$$
which encloses no singularities. Since the integral over each of the two arcs is bounded by $\dfrac\pi{R}\to0$, we get
$$
\begin{align}
\int_{-\infty}^\infty\frac{\sin^2(x)}{x^2}\mathrm{d}x
&=\int_{-\infty}^\infty\frac{2-e^{2ix}-e^{-2ix}}{4x^2}\mathrm{d}x\\
&=\int_{\gamma_2}\frac{2-e^{2iz}}{4z^2}\mathrm{d}z
-\int_{\gamma_3}\frac{e^{-2iz}}{4z^2}\mathrm{d}z\\[6pt]
&=\pi-0
\end{align}
$$
since the residue of $\dfrac{2-e^{2iz}}{4z^2}$ at $z=0$ is $-\dfrac{i}{2}$ and $\gamma_3$ does not enclose any singularities.
Therefore, we get
$$
\int_{-\infty}^\infty\frac{\sin^2(x)}{x^2}\mathrm{d}x=\pi
$$
