TITLE: how to calculate the integral of $\sin^2(x)/x^2$
QUESTION [14 upvotes]: Possible Duplicate:
Proof for an integral involving sinc function
How do I show that $\int_{-\infty}^\infty \frac{ \sin x \sin nx}{x^2} \ dx = \pi$? 

$\int_{-\infty}^{\infty}\sin^2(x)/x^2=\pi$ according to wolfram alpha. That is such a beautiful result! But how do I calculate this integral by hand?
Thanks in advance.

REPLY [26 votes]: First we split $\sin^2(x)=\frac{(1-e^{2ix})+(1-e^{-2ix})}{4}$. To avoid the pole at $x=0$, drop the path of integration a bit below the real line (this function has no poles and it vanishes at infinity, so this is okay).
Next, let $\gamma^+$ be the path below the real axis, then circling back in a semi-circular path counterclockwise around the upper half-plane; and let $\gamma^-$ be the path below the real axis, then circling back in a semi-circular path clockwise around the lower half-plane.
$\hspace{4cm}$
Note that $\gamma^+$ circles the pole at $x=0$ of $\frac{(1-e^{2ix})}{4x^2}$ and $\gamma^-$ misses the pole at $x=0$ of $\frac{(1-e^{-2ix})}{4x^2}$.
Therefore,
$$
\begin{align}
\int_{-\infty}^\infty\frac{\sin^2(x)}{x^2}\mathrm{d}x
&=\int_{-\infty-i}^{\infty-i}\frac{1-\cos(2x)}{2x^2}\mathrm{d}x\\
&=\int_{-\infty-i}^{\infty-i}\frac{(1-e^{2ix})+(1-e^{-2ix})}{4x^2}\mathrm{d}x\\
&=\color{green}{\int_{\gamma^+}\frac{(1-e^{2ix})}{4x^2}\mathrm{d}x}+\color{red}{\int_{\gamma^-}\frac{(1-e^{-2ix})}{4x^2}\mathrm{d}x}\\
&=\color{green}{2\pi i\frac{-2i}{4}}+\color{red}{0}\\
&=\pi
\end{align}
$$