# Evaluate using contour the integral $\int_\mathbb{R}\left(\frac{\sin(x)}{x}\right)^2 dx\;$

Evaluate using contour the integral $$\displaystyle\int_\mathbb{R}\left(\dfrac{\sin(x)}{x}\right)^2dx\;$$

I am using the the boundaries of a large semicircle with radius $$R$$ and a small semicircle with radius $$\varepsilon$$ for the contour and the integration over the contour breaks into four parts. I am stuck at evaluating at the piece along the small circle, namely: $$\int_\gamma\left(\frac{\sin(z)}{z}\right)^2 dz = - \int_0^\pi \frac{e^{2i\varepsilon e^{i\theta}}}{\varepsilon^2 e^{2i\theta}}i\varepsilon e^{i\theta} d\theta$$ It appears to me that the integral on the right hand side is zero due to the extra power of $$\varepsilon$$ on the denominator as $$\varepsilon \rightarrow 0$$.

I wonder how we deal with this problem?

First of all, it is never a good idea to use trigonometric functions in such exercises. It is very hard to bound them on semicircle curves. So always replace them with exponential. For example, here we have $$\frac{\sin^2x}{x^2}=\frac{1}{2}\frac{1-\cos(2x)}{x^2}$$. So the complex function you should define is $$f(z)=\frac{1}{2}\frac{1-e^{2iz}}{z^2}$$. Your choice of the contour is correct. The integral over the large semicircle clearly tends to $$0$$ as $$R\to\infty$$, the integrals over the straight lines should not present any problems.
Now let $$\gamma$$ be the small semicircle. Note that $$f$$ has a simple pole at $$z=0$$, so its Laurent series has the form $$\sum\limits_{n=-1}^\infty a_nz^n$$. So in a small neighborhood of $$0$$ we can write $$f(z)=\frac{a_{-1}}{z}+h(z)$$ where $$h$$ is a holomorphic function. So now we have:
$$\int_{\gamma}f(z)dz=a_{-1}\int_{\gamma}\frac{1}{z}dz+\int_{\gamma}h(z)dz$$
Since $$h$$ is holomorphic it is bounded near $$0$$, and so the second integral tends to $$0$$ when $$\epsilon\to 0$$. And the first integral is just $$-a_{-1}\pi i$$, this is a direct computation. Finally, $$a_{-1}$$ is the residue of $$f$$ at $$z=0$$. I believe you know how to compute residues.