Contour Integration Part I'm trying to evaluate the following integral, and I'm getting stuck on one part.  Here's the integral:

$$\int_{-\infty}^\infty \frac{\sin(x)}{x(x^2+1)} dx$$

Basically, I'm converting this to the complex plane and performing a contour integration over the top half of the plane (semi-circle).  Further, I'm looping around the singularity at z=0.  Now, I'm fine with all of the integrals except for the integral involving the loop around the singularity.  For this guy, I end up with the following.  I have no idea how to evaluate this in the limit as r goes to 0.  Any idea  how to proceed?

$$\int_{\pi}^0 \frac{e^{ire^{i\theta}}}{r^2e^{i2\theta}+1} d\theta$$
Write
$$f(z)=\frac{e^{iz}}{z(z^2+1)}$$
and let $C$ be the clockwise semi-circular contour of radius $r$ about $0$.  Now $f$ has a simple pole at $z=0$ with residue $1$, so
$$f(z)-\frac{1}{z}$$
has a removable singularity at $z=0$.  Therefore, for a suitable constant $c$, the function
$$g(z)=\cases{f(z)-1/z&amp;if $z\ne0$\cr c&amp;if $z=0$\cr}$$
is continuous.  Now
$$\left|\int_C g(z)\,dz\right|\le (\pi r)\max_{|z|\le r}|g(z)|\to (\pi)(0)|c|=0$$
as $r\to0$, and
$$\int_C\frac{1}{z}\,dz=\int_\pi^0 \frac{ie^{i\theta}}{e^{i\theta}}\,d\theta=-\pi i\ .$$
Therefore
$$\int_C f(z)\,dz=\int_C \Bigl(g(z)+\frac{1}{z}\Bigr) dz\to -\pi i$$
as $r\to0$.
$\newcommand{\+}{^{\dagger}}
 \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{\ceil}[1]{\,\left\lceil #1 \right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\down}{\downarrow}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\isdiv}{\,\left.\right\vert\,}
 \newcommand{\ket}[1]{\left\vert #1\right\rangle}
 \newcommand{\ol}[1]{\overline{#1}}
 \newcommand{\pars}[1]{\left( #1 \right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}
 \newcommand{\wt}[1]{\widetilde{#1}}$
\begin{align}
\color{#00f}{\large%
\int_{-\infty}^{\infty}{\sin\pars{x} \over x\pars{x^{2} + 1}}\,\dd x}&amp;=
\Im\pp\int_{-\infty}^{\infty}{\expo{\ic x} \over x\pars{x^{2} + 1}}\,\dd x
=
\Im\int_{-\infty}^{\infty}{\expo{\ic x} \over x^{2} + 1}\bracks{%
{1 \over x + \ic 0^{+}} + \ic\pi\,\delta\pars{x}}\,\dd x
\\[3mm]&amp;=
\Im\int_{-\infty}^{\infty}{\expo{\ic x} \over \pars{x + \ic 0^{+}}\pars{x^{2} + 1}}
\,\dd x + \pi
=\Im\bracks{2\pi\ic\,{\expo{\ic\pars{\ic}} \over \pars{\ic + \ic 0^{+}}
\pars{\ic + \ic}}} + \pi
\\[3mm]&amp;=-\pi\expo{-1} + \pi
=\color{#00f}{\large{\pars{-1 + \expo{}}\pi \over \expo{}}} \approx 1.9859
\end{align}


  $\ds{\Large\tt\mbox{ADDENDA}}$ ( Contour Integration ):
  \begin{align}
\color{#00f}{\large%
\pp\int_{-\infty}^{\infty}{\sin\pars{x} \over x\pars{x^{2} + 1}}\,\dd x}
&amp;=
\lim_{\epsilon \to 0^{+}}\Im\bracks{%
\int_{-\infty}^{-\epsilon}{\expo{\ic x} \over x\pars{x^{2} + 1}}\,\dd x
+
\int_{\epsilon}^{\infty}{\expo{\ic x} \over x\pars{x^{2} + 1}}\,\dd x}
\\[3mm]&amp;=\lim_{\epsilon \to 0^{+}}\Im\bracks{%
2\pi\ic\,{\expo{\ic\pars{\ic}} \over \ic\pars{\ic + \ic}}\
-\
\overbrace{\int_{\pi}^{0}
{\exp\pars{\ic\epsilon\expo{\ic\theta}}
\over
\epsilon\expo{\ic\theta}\pars{\epsilon^{2}\expo{2\ic\theta} + 1}}
\,\pars{\epsilon\expo{\ic\theta}\ic\,\dd\theta}}
^{\ds{\to -\ic\pi\ \mbox{when}\ \epsilon \to 0^{+}}}}
\\[3mm]&amp;=-\pi\expo{-1} + \pi
=\color{#00f}{\large{\pars{-1 + \expo{}}\pi \over \expo{}}} \approx 1.9859
\end{align}