The question is $$I=\int_{-\infty}^{\infty} \frac{\sin^2{x}}{x^2} dx$$
My attempt: $$I=-\frac{1}{4}\int_{-\infty}^{\infty} \frac{e^{2ix}-2+e^{-2ix}}{x^2} dx$$
$$I=-\frac{1}{4} \Big[ \int_{-\infty}^{\infty} \frac{e^{2ix}}{x^2} dx - \int_{-\infty}^{\infty} \frac{2}{x^2} dx +\int_{-\infty}^{\infty} \frac{e^{-2ix}}{x^2} dx \Big] $$
Now I use contours as mentioned in this question.
If we write $$I=-\frac{1}{4}\Big[A+B+C\Big]$$ where $A,B,C$ are the corresponding integrals.
For, $A$, and $C$ they can be worked out using Jordan's lemma and the residue theorem.
I run into a problem with $B$, as it does not converge. Any ideas?
Consider,
$$j(a) = \int_{0}^{\infty} e^{-ax^2}\sin^2(x)\mathrm{d}x$$ $$= \int_{0}^{\infty} e^{-ax^2}\frac{1-\cos(2x)}{2}\mathrm{d}x$$ $$= \int_{0}^{\infty} e^{-ax^2}\frac{1-\cos(2x)}{2}\mathrm{d}x$$ $$= \frac{\sqrt{\pi}}{4} a^{-1/2} - \frac{\sqrt{\pi}}{4} e^{-1/a} a^{-1/2}. $$
Now let $J(a)$ be an antiderivative of $j(a)$.
$$ J(a) = \frac{\sqrt{\pi}}{2} a^{1/2} - \frac{\pi}{2} \mathrm{erf}(1/\sqrt{a})-\frac{\sqrt{\pi}}{2}\sqrt{a}e^{-1/a}+C$$
$$= \frac{\sqrt{\pi}}{2} a^{1/2}\left(1-e^{-1/a}\right) - \frac{\pi}{2} \mathrm{erf}(1/\sqrt{a})+C$$
We can see that, $$\lim_{a\rightarrow \infty} J(a) = C. $$
The definition of $J$ suggests that we can identify it with the integral,
$$ J(a)=-\int_{0}^{\infty} e^{-ax^2} \frac{\sin^2(x)}{x^2} \mathrm{d}x,$$
this integral clearly goes to $0$ in the limit as $a\rightarrow \infty$ so we choose $C=0$.
$$ J(a) = \frac{\sqrt{\pi}}{2} a^{1/2}\left(1-e^{-1/a}\right) - \frac{\pi}{2} \mathrm{erf}(1/\sqrt{a}) $$
Now assuming that $J(a)$ equals the integral we get,
$$ \int_{0}^{\infty} \frac{\sin^2(x)}{x^2} \mathrm{d}x =- \lim_{a\rightarrow 0} J(a)$$ $$ = -\lim_{a\rightarrow 0} \left(\frac{\sqrt{\pi}}{2} a^{1/2}\left(1-e^{-1/a}\right) - \frac{\pi}{2} \mathrm{erf}(1/\sqrt{a})\right),$$
$$ = \pi/2 $$