How to show $\int^{\infty}_{-\infty}\frac{\sin(ax)}{x(x^2+1)}dx=\pi(1-e^{-a})$? ($a\ge0$) 
$$\int^{\infty}_{-\infty}\frac{\sin(ax)}{x(x^2+1)}dx=\pi(1-e^{-a}), \ a\ge0$$

I tried to solve but came up with $\pi(2-e^{-a}) $. Could you tell me where did I do the mistake? 
if $x=z$ then $dz=dx$
$$\int_\gamma \frac{e^{iaz}}{z(z^2+1)}\quad and\quad z(z+i)(z-i)=0\quad \rightarrow z=0,z=\pm i$$ 
for $ z=0$ $$Res(f,0)=\lim_{z\to 0}\frac{z.e^{iaz}}{z(z^2+1)}=1$$
for $z=1$
$$Res(f,i)=\lim_{z\to i}\frac{(z-i).e^{iaz}}{z(z+i)(z-i)}=\lim_{z\to i}\frac{e^{iaz}}{z(z+i)}=\frac{e^{-a}}{-2}$$
$$\int_\gamma \frac{e^{iaz}}{z(z^2+1)}=\int_{-R}^{R}\frac{e^{iax}}{x(x^2+1)}dx+\int_\gamma \frac{e^{iaz}}{z(z^2+1)}=\pi i(1-\frac{e^{-a}}{-2})$$
$$\int_{-R}^{R}\frac{e^{iax}}{x(x^2+1)}=\int^{R}_{-R}\frac{\cos(ax)}{x(x^2+1)}dx+i\int_{-R}^R \frac{\sin(ax)}{x(x^2+1)}=i(2\pi - 2\pi \frac{e^{-a}}{2})$$
$$\rightarrow \int_{-R}^R\frac{\sin(ax)}{x(x^2+1)}=2\pi -2\pi \frac{e^{-a}}{2}=\pi(2-e^{-a}) $$
 A: The integral depends on the value of $a$, which I assume is a real number.
Assuming that $a\ge 0$, You can use this kind of contour to integrate $f(z) = \dfrac{e^{iaz}}{z(z^2+1)}$. The point is that you have to go around the singularity at $z=0$. (An alternative is to follow Did's suggestion).
Using this contour, you obtain:
$$2\pi i Res(f,i) = \left(\int_R - \int_\epsilon\right) + \left(\int_r^R f(x) dx + \int_{-R}^{-r} f(x) dx\right),$$
$\int_R$ and $\int_\epsilon$ both represent integral of $f$ over the respective semicircles. A quick computation shows that $R\to \infty$ makes $\int_R\to 0$ and $\epsilon \to 0$ makes $\int_\epsilon\to i\pi$.
Therefore,
$$2\pi i Res(f,i) = - i\pi + \int_{-\infty}^\infty f(x) dx$$
Computing the residue and solving for the integral gives:
$$ \int \dfrac{\sin(ax)}{x(x^2+1)} dx = \pi (1-e^{-a})$$
For $a<0$, you can use a similar contour, but it has to be upside down from the one used above in order for the big $R$ contour to vanish as $R\to \infty$. The answer comes out to be $\pi (e^a -1)$.
A: I will assume $a > 0$. Call the integral $I(a)$. Differentiate w.r.t. $a$,
$$ I'(a) = \int_{-\infty}^{\infty} \frac{\cos(a x)}{1+x^2} \ \mathrm{d}x = 2\int_{0}^{\infty}\frac{\cos(a x)}{1+x^2} \ \mathrm{d}x,$$
then note that
$$\mathcal{L}(I'(a)) = 2\int_{0}^{\infty}\int_{0}^{\infty} \frac{\cos(a x)}{1+x^2}\exp(-as) \ \mathrm{d}a \ \mathrm{d}x,$$ 
$$\mathcal{L}(I'(a)) = 2\int_{0}^{\infty} \frac{s}{(x^2+s^2)(1+x^2)} \ \mathrm{d}x.$$
Using partial fractions and integrating, 
$$\mathcal{L}(I'(a)) = \frac{\pi}{s+1},$$
taking the inverse transform gives 
$$
I'(a) = \pi \mathrm{e}^{-a},
$$
integrate to obtain
$$
I(a) = -\pi \mathrm{e}^{-a} + c,
$$
and using $I(0) = 0$, we see that $c=\pi$ and 
$$
I(a) = \pi(1-\mathrm{e}^{-a}).
$$
A: $\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}}$
$\ds{\int_{-\infty}^{\infty}{\sin\pars{ax} \over x\pars{x^{2} + 1}}\,\dd x
     =\pi\sgn\pars{a}\pars{1 - \expo{-\verts{a}}}:\ {\large ?}.\qquad a \in {\mathbb R}}$

\begin{align}
&\bbox[#ffd,5mm]{\int_{-\infty}^{\infty}{\sin\pars{ax} \over x\pars{x^{2} + 1}}\,\dd x}
= a\int_{-\infty}^{\infty}{1 \over x^{2} + 1}\,
{\sin\pars{ax} \over ax}\,\dd x
\\[5mm] = &\
a\int_{-\infty}^{\infty}{1 \over x^{2} + 1}\,
\pars{\half\int_{-1}^{1}\expo{\ic kax}\,\dd k}\,\dd x
\\[5mm] = &\
\half\,a\int_{-1}^{1}\pars{%
\int_{-\infty}^{\infty}{\expo{\ic\verts{ka}x} \over
x^{2} + 1}\,\dd x}\,\dd k
\\[5mm] = &\
\half\,a\int_{-1}^{1}\pars{%
2\pi\ic\,{\expo{\ic\verts{ka}\ic} \over 2\ic}}\,\dd k
\\[5mm] = &\
\half\,\pi a\int_{-1}^{1}\expo{-\verts{ka}}\,\dd k
=
\pi a\int_{0}^{1}\expo{-\verts{a}k}\,\dd k =
\pi a\,{\expo{-\verts{a}} - 1 \over -\verts{a}}
\\[5mm] = &\
\bbox[15px,border:1px groove navy]{\pi\sgn\pars{a}
\pars{1 - \expo{-\verts{a}}}} \\ &
\end{align}
