How to calculate $ \int_0^\infty\frac{\cos (x t)+x\sin(x t)}{1+x^2}\,dx$? In calculating the inverse Fourier transform of $$F(\omega)=\frac{1}{1+i\omega}$$
I ended up with calculating
$$
\int_0^\infty\frac{\cos (x t)+x\sin(x t)}{1+x^2}\,dx\tag{*}
$$
Mathematica says:



How could one calculate (*) by hand?
 A: Let us assume $t\in\mathbb{R}\setminus \{0\}$.
You can start by noticing
$$I(t) = \int_{-\infty}^\infty \frac{e^{i x t}}{1+x^2}dx=2
\int_0^\infty \frac{\cos(xt)}{1+x^2}dx.$$
and $$J(t) = \int_{-\infty}^\infty \frac{xe^{i x t}}{1+x^2}dx=2i
\int_0^\infty \frac{x\sin(xt)}{1+x^2}dx.$$
Now note that $J(t) = -i I'(t)$ and thus your integral can be written as
$$\int_0^\infty \frac{\cos(xt)+x \sin(x t)}{1+x^2}dx= \frac12 [I(t)-i J(t)] =\frac12 [I(t)- I'(t)].$$
It is a simple exercise using the residue theorem to show that
$$I(t) =\pi e^{-|t|} $$
and thus to show that
$$ \int_0^\infty \frac{\cos(xt)+x \sin(x t)}{1+x^2}dx =\frac\pi2 e^{-|t|} [1+\operatorname{sgn}(t)] $$
A: Consider
$$I(\alpha,\beta)=\int_0^\infty\frac{\sin \alpha x}{x(\beta^2+x^2)}\,dx$$
Then we have
$$I'=\frac{\partial I}{\partial\alpha}=\int_0^\infty\frac{\cos \alpha x}{\beta^2+x^2}\,dx$$
and
$$I''=\frac{\partial^2I}{\partial \alpha^2}=-\int_0^\infty\frac{x\sin \alpha x}{\beta^2+x^2}\,dx$$
It is easy to show that
$$I''-\beta^2I=-\frac{\pi}{2}$$
where we use the fact
$$\int_0^\infty\frac{\sin\alpha x}{x}\,dx=\frac{\pi}{2}$$
Solving  the second-order linear ODE using initial conditions  $I(0)=0$ and $I'(0)=\frac{\pi}{2\beta}$, one may  deduce 
$$I(\alpha,\beta)=\frac{\pi\left(1-e^{-\alpha\beta}\right)}{2\beta^2}$$
and
$$I'(\alpha,\beta)=\frac{\partial  I}{\partial\alpha}=\int_0^\infty\frac{\cos \alpha  x}{\beta^2+x^2}\,dx=\frac{\pi e^{-\alpha\beta}}{2\beta}$$
Thus, setting $\alpha=t$ and $\beta=1$, we have
$$\int_0^\infty\frac{\cos xt}{1+x^2}\,dx=\frac{\pi e^{-t}}{2}$$
and 
$$\int_0^\infty\frac{x\sin xt}{1+x^2}\,dx$$
can be evaluated by evaluating $I''(\alpha,1)$ and setting $\alpha=t$.
A: Another approach comes from the Laplace transform. We have
$$\mathcal{L}(\cos x)=\frac{s}{s^2+1},\qquad \mathcal{L}(\sin x)=\frac{1}{s^2+1}$$
hence, assuming $t>0$,
$$ \int_{0}^{+\infty}\frac{x\sin(xt)}{x^2+1}\,dx=\int_{0}^{+\infty}\left(\mathcal{L}\sin(xt)\right)(s)\,\mathcal{L}^{-1}\left(\frac{x}{x^2+1}\right)(s)\,ds $$
(the LHS is converging by Dirichlet's test, since $\frac{x}{x^2+1}$ is decreasing towards zero from some point on and $\sin(xt)$ has a bounded primitive) leads to:
$$ \int_{0}^{+\infty}\frac{x\sin(xt)}{x^2+1}\,dx=\int_{0}^{+\infty}\frac{t\cos(s)}{t^2+s^2}\,ds\stackrel{s\mapsto tx}{=}\int_{0}^{+\infty}\frac{\cos(tx)}{x^2+1}\,dx $$
so we just need to compute:
$$ 2\int_{0}^{+\infty}\frac{\cos(tx)}{x^2+1}\,dx\stackrel{\text{parity}}{=}\text{Re}\int_{-\infty}^{+\infty}\frac{e^{isx}}{x^2+1}\,dx $$
and by the residue theorem the last integral equals
$$ \text{Re}\left[2\pi i\,\text{Res}\left(\frac{e^{itx}}{x^2+1},x=i\right)\right]=\text{Re}\left[2\pi i\lim_{x\to i}\frac{e^{itx}}{x+i}\right]=\pi e^{-t}. $$
For $t=0$ the given integral clearly equals $\frac{\pi}{2}$ and for $t<0$ the same manipulations show the given integral equals zero. Summarizing,

$$ \forall t\in\mathbb{R},\qquad \int_{0}^{+\infty}\frac{\cos(xt)+x\sin(xt)}{x^2+1}\,dx = \frac{\pi}{2}e^{-|t|}\left(1+\text{sign }t\right).$$ 

