So, I have to solve the following integral $$ \int_{0}^{\infty} \frac{\sin^{2}{x}}{x^{2}} dx$$
I'm aware that this has been asked about before on this site, but I want comments on my attempted solution.
for $x \in \mathbb{R}$, the principal part of
$$ Re\int_{0}^{\infty} \frac{1- e^{2ix}}{x^{2}}dx = \int_{0}^{\infty}\frac{1-\cos{2x}}{x^2} dx= \int_{0}^{\infty}2\frac{\sin^{2}{x}}{x^{2}}dx$$
So, I'm going to integrate $$\int_{\Gamma} \frac{1- e^{2iz}}{z^{2}}dz $$
where, $\Gamma = \gamma_{1}+\gamma_{2}+\gamma_{3}+\gamma_{4}$. $\gamma_{1} = [-R,-r], \gamma_{2} = C_{r}, \gamma_{3} = [r, R]$, and $\gamma_{4}= C_{R}$. $r,R > 0$, $r < R$, and $C_{r}$ is a clockwise oriented semicircle of radius $r$ and $C_{R}$ is a counterclockwise oriented semicircle of radius $R$.
$$ \int_{\Gamma} f(z) dz = 0 $$ by residue theorem. Furthermore,
$$ \int_{\gamma_{3}} f(z) dz = -2\pi i (-2i)= -4\pi $$. I got this from calculating the residue:
$$ \frac{1- e^{2iz}}{z^{2}} = \frac{1-(1+2iz+...}{z^{2}} = -\frac{2i}{z}+... $$
and $$ \int_{\gamma_{4}} f(z) dz = 0 $$ by Jordan's lemma and estimation. Hence, as $r \rightarrow 0, R \rightarrow \infty$, we get:
$$ 0 = \int_{-\infty}^{0} f(x)dx -4\pi + \int_{0}^{\infty} f(x) dx +0$$
$$ \int_{-\infty}^{\infty} f(x) dx = 4\pi $$.
So, $$ \int_{0}^{\infty} \frac{\sin^{2}{x}}{x^{2}} dx = \frac{1}{4} \int_{-\infty}^{\infty} f(x) dx = \frac{1}{4}(4\pi) = \pi$$. But, Wolfram Alpha says that the answer should be $\frac{\pi}{2}$. Where did I go wrong?