Solve this complex integral Solve this complex integral
$$\lim_{\varepsilon \rightarrow 0} \int_{-\infty}^{\infty} \frac{d\omega}{2\pi i}\frac{e^{-i\omega x}}{\omega + i\varepsilon}$$
Where $\varepsilon > 0$ and $x$ is real.
I tried to integrate it in a closed complex contour, apply Jordan's Lemma and solve it using Residue Theorem, but I could not apply Jordan's Lemma, it diverged. 
 A: For $x>0$, closing the contour in the lower-half plane, invoking Jordan's Lemma, and using the residue theorem, we find that
$$\begin{align}
\frac{1}{2\pi i}\int_{-\infty}^\infty \frac{e^{-i\omega x}}{\omega +i\varepsilon}\,d\omega&=-2\pi i \frac{1}{2\pi i}\text{Res}\left(\frac{e^{-i\omega x}}{\omega +i\varepsilon}, \omega=-i\varepsilon \right)\\\\
&=-2\pi i \frac{1}{2\pi i}e^{-\epsilon x}\\\\
&=-e^{-\varepsilon x} \tag 1
\end{align}$$
For $x<0$, the integrand is analytic in and on the integration contour comprised of the real line and a semicircle in the upper-half plane centered at the origin with radius $R\to \infty$.  Invoking Jordan's Lemma and applying Cauchy's Integral Theorem, we find that  
$$\frac{1}{2\pi i}\int_{-\infty}^\infty \frac{e^{-i\omega x}}{\omega +i\varepsilon}\,d\omega=0 \tag 2$$
Putting $(1)$ and $(2)$ together yields
$$\lim_{\varepsilon\to 0^+}\frac{1}{2\pi i}\int_{-\infty}^\infty \frac{e^{-i\omega x}}{\omega +i\varepsilon}\,d\omega=-u(x)$$
where $u(x)$ is the unit step function.
A: $\newcommand{\angles}[1]{\left\langle\,{#1}\,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\iff}{\Leftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\color{#f00}{\lim_{\varepsilon \to 0^{\pm}}\int_{-\infty}^{\infty}
{\dd\omega \over 2\pi \ic}{\expo{-\ic\omega x} \over \omega + \ic\varepsilon}} =
\mathrm{P.V.}\int_{-\infty}^{\infty}{\dd\omega \over 2\pi \ic}
{\expo{-\ic\omega x} \over \omega}
+ \int_{-\infty}^{\infty}{\dd\omega \over 2\pi \ic}
\expo{-\ic\omega x}\bracks{\mp\,\pi\ic\,\delta\pars{\omega}}
\\[3mm] = &\
\bracks{\int_{0}^{\infty}{\dd\omega \over 2\pi \ic}
\pars{{\expo{-\ic\omega x} \over \omega} + {\expo{\ic\omega x} \over -\omega}}} \mp \half =
-\,{1 \over \pi}\int_{0}^{\infty}
{\sin\pars{\omega x} \over \omega}\dd\omega \mp \half
\\[3mm] = &\
-\,{1 \over \pi}\,{\pi \over 2}\,\mathrm{sgn}\pars{x} \mp \half =
\half\bracks{-\mathrm{sgn}\pars{x} \mp 1} =
\color{#f00}{\left\lbrace\begin{array}{ccrcl}
\ds{{1 \mp 1 \over 2}} & \mbox{if} & \ds{x} & \ds{<} & \ds{0}
\\[2mm]
\ds{{-1 \mp 1 \over 2}} & \mbox{if} & \ds{x} & \ds{>} & \ds{0}
\end{array}\right.}
\end{align}

That is
$$
\begin{array}{rcccl}
\ds{\color{#f00}{\lim_{\varepsilon \to 0^{-}}\int_{-\infty}^{\infty}
{\dd\omega \over 2\pi \ic}{\expo{-\ic\omega x} \over \omega + \ic\varepsilon}}}
& \ds{=} &
\color{#f00}{\braces{\begin{array}{rcrcl}
\ds{1} & \mbox{if} & \ds{x} & \ds{<} & \ds{0}
\\[2mm]
\ds{0} & \mbox{if} & \ds{x} & \ds{>} & \ds{0}
\end{array}}} & = & \phantom{-}\Theta\pars{-x}
\\[5mm]
\ds{\color{#f00}{\lim_{\varepsilon \to 0^{+}}\int_{-\infty}^{\infty}
{\dd\omega \over 2\pi \ic}{\expo{-\ic\omega x} \over \omega + \ic\varepsilon}}}
& \ds{=} &
\color{#f00}{\braces{\begin{array}{lcrcl}
\ds{0} & \mbox{if} & \ds{x} & \ds{<} & \ds{0}
\\[2mm]
\ds{-1} & \mbox{if} & \ds{x} & \ds{>} & \ds{0}
\end{array}}} & = & -\Theta\pars{x}
\end{array}
$$


$\ds{\Theta}$ is the Heaviside Step Function.

