Parameterizing divots in contour integrals I have recently attempted to pick up complex analysis and have been stuck on this problem for a few days:
$$\int_{-\infty}^\infty \frac{\sin^2x}{x^2}\mathrm{d}x$$
Fortunately, it would seem that this question has already been answered here.
Unfortunately, I have tried to replicate the steps taken, only to find myself stuck.
In particular, computing the following is where I'm having difficulties:
$$PV \int_{-\infty}^{\infty} \mathrm{d}x \frac{e^{i 2 x}}{x^2} + i \epsilon \int_{\pi}^0 \mathrm{d}\phi \, e^{i \phi} \frac{1+i 2 \epsilon e^{i \phi} + \cdots}{\epsilon^2 e^{i 2 \phi}} = 0$$
And in particular, the second integrand. From my understanding, the aforementioned integral is due to a pole at $x=0$ and therefore the need to integrate around it. My understanding of the derivation of it is as follows:
$$\begin{align}
\int_{divot} \mathrm{d}x \frac{e^{i 2 x}}{x^2}
&=\lim_{\epsilon \to0} {\int_{-\epsilon}^{\epsilon} \mathrm{d}x \frac{e^{i 2 x}}{x^2}}\\
&=\lim_{\epsilon \to0} {\int_{\pi}^0 \mathrm{d}\phi*i\epsilon e^{i \phi}
\frac{e^{2i\epsilon\exp(i\theta)}}{\epsilon^2 e^{i 2 \phi}}}\\
&=\lim_{\epsilon \to0} {i\int_{\pi}^0 \mathrm{d}\phi\frac{1+i 2 \epsilon e^{i \phi} + \cdots}{\epsilon e^{i\phi}}}\\
&=\lim_{\epsilon \to0} {i\int_{\pi}^0 \mathrm{d}\phi\frac{1}{\epsilon e^{i\phi}}+2i+\cdots}\\
&\approx \lim_{\epsilon \to0} {i} \bigg[i\frac{1}{\epsilon e^{i\phi}} + 2i\phi \bigg]_\pi^0\\
&=\lim_{\epsilon \to0} i \bigg[\frac{2i}{\epsilon} -2\pi i \bigg]
\end{align}$$
But as $\epsilon \to 0$, the result tends to $\infty$. In fact, I've been having similar issues with other integrals where $\epsilon$ appears in the denominator of the limit.
I suspect this is due to a lack of understanding on my end, but amusingly I lack the understanding to see where my reasoning is flawed. Any and all help is appreciated.
 A: $$\int_0^\infty\frac{\sin x}{x} dx =  \int_0^\infty\frac{\sin 2u}{2u} d(2u) =\int_0^\infty\frac{\sin 2u}{u} du$$
Apply Integration by parts 
$$\int_{0}^\infty \frac{\sin^2x}{x^2}\mathrm{d}x=\frac{\sin^2x}{x(-1)}\biggr|_{0}^{\infty}+\int_{0}^{\infty}\frac{2 \sin x \cos x }{x}\mathrm{d}x =\int_{0}^{\infty}\frac{\sin(2x)}{x}\mathrm{d}x$$
$\int_{0}^{\infty}\dfrac {\sin x} x dx =\dfrac{\pi}{2}$
To calculate $\int_{0}^{\infty}\frac {\sin x} x dx\hspace{10pt}$follow this post it already has 26 answers.
$$\int_{-\infty}^\infty \frac{\sin^2x}{x^2}\mathrm{d}x=2\int_{0}^\infty \frac{\sin^2x}{x^2}\mathrm{d}x=\pi$$
A: $$I=\frac{1}{2}\int_{-\infty}^\infty\frac{1-\cos(2x)}{x^2}dx=\frac{1}{2}\int_{-\infty}^\infty\frac{1}{x^2}dx-\frac{1}{2}\int_{-\infty}^\infty\frac{\cos(2x)}{x^2}dx$$
$$I=-\frac{1}{2}\int_{-\infty}^\infty\frac{\cos(2x)}{x^2}dx$$
$$u=2x\,,dx=\frac{du}{2}$$
$$I=-2\int_{0}^\infty\frac{\cos(u)}{u^2}du-2\Re\int_{0}^\infty\frac{e^{iu}}{u^2}du$$
then maybe:
$$I(a)=-2\Re\int_0^\infty\frac{e^{iu}e^{-au^2}}{u^2}du$$
so:
$$I'(a)=2\Re\int_0^\infty e^{iu}e^{-au^2}du=2\Re\int_0^\infty e^{-au^2+iu}du$$
$$I'(a)=2\Re\left(e^{-\frac{1}{4a}}\int_0^\infty e^{-\left(\sqrt{a}u-\frac{i}{2\sqrt{a}}\right)^2}du\right)$$
And this can then be solved through manipulation of the error function, although getting back to $I(a)$ and evaluating $\lim_{a\to 0}I(a)$ could be difficult.
