Evaluate the following improper integral Evaluate the improper integral $\displaystyle\int_{0}^{\infty}\frac{x\sin{ax}}{1+x^2}dx$, if $a\neq 0$.
 A: The following integral 
$$F(a) = \int_{0}^{\infty}\frac{\cos(ax)}{1+x^2}dx = \frac{\pi}{2}e^{-|a|}$$
is on of the standard integrals in complex analysis books. The integral can be solved by contour integration by considering the function 
$$G(z) = \frac{e^{iaz}}{z^2+1}$$
Using a half a circle in the upper half plane. 
You can refer to the post Computing $\int_{-\infty}^{\infty} \frac{\cos x}{x^{2} + a^{2}}dx$ using residue calculus
Hence by  differentiation 

$$F'(a) = \int_{0}^{\infty}\frac{x\sin(ax)}{1+x^2}dx = \frac{\pi
 a}{2|a|}e^{-|a|}$$

Note for differentiation you can consider two cases $a>0$ and $a<0$.
A: By Fourier transform, Let 
$$F(x)=\left\lbrace\begin{array}{c l}e^x,&x\leqslant0\\e^{-x},&x>0\end{array}\right.$$‎
so with the Fourier integral we have 
\begin{eqnarray}
a(\omega)&=&\frac{1}{\pi}\int_{-\infty}^\infty F(x)\cos\omega x~dx\\
&=&\frac{1}{\pi}\int_{-\infty}^0 e^x\cos\omega x~dx+\frac{1}{\pi}\int_0^\infty e^{-x}\cos\omega x~dx\\&=&\frac{2}{\pi}\frac{1}{\omega^2+1}\\
b(\omega)&=&\frac{1}{\pi}\int_{-\infty}^\infty F(x)\sin\omega x~dx\\
&=&0
\end{eqnarray}
Then 
\begin{eqnarray}
f(x)&=&\int_{0}^\infty a(\omega)\cos\omega x+b(\omega)\sin\omega x~d\omega\\
\int_{0}^\infty \frac{2}{\pi}\frac{1}{\omega^2+1}\cos\omega x+0~d\omega&=&\left\lbrace\begin{array}{c l}e^x,&x<0\\e^{-x},&x>0\end{array}\right.\\
\int_{0}^\infty \frac{\cos\omega x}{\omega^2+1}~d\omega&=&\left\lbrace\begin{array}{c l}\frac{\pi}{2}e^x,&x<0\\\frac{\pi}{2}e^{-x},&x>0\end{array}\right.\\
\end{eqnarray}
With derivative say:
\begin{eqnarray}
\int_{0}^\infty \frac{x\sin\omega x}{\omega^2+1}~d\omega&=&\left\lbrace\begin{array}{c l}-\frac{\pi}{2}e^x,&x<0\\\frac{\pi}{2}e^{-x},&x>0\end{array}\right.\\
\end{eqnarray}
