<s>[INST] Improper integral : $\int_0^{+\infty}\frac{x\sin x}{x^2+1}$ How to evaluate the following improper integral : $$\int_0^{+\infty}\frac{x\sin x}{x^2+1}\,dx$$
I have tried integration by parts and variable substitution, but it didn't work.
 [/INST] According to the residue theory, 
$$
    \int_0^{+\infty}\frac{1}{s^2+x^2}\mathrm{d}x=\frac{\pi}{2s} ~ , ~
    I(\alpha)=\int_0^{+\infty}\frac{x\sin \alpha x}{1+x^2}\mathrm{d}x
$$
Laplace transform:
\begin{align}
    \mathcal{L}\left[ I(\alpha)\right] &= \int_0^{+\infty}\frac{x}{1+x^2}\cdot \frac{x}{s^2+x^2}\mathrm{d}x \\
    &= \int_0^{+\infty}\frac{x^2+1-1}{1+x^2} \cdot \frac{1}{s^2+x^2} \mathrm{d}x \\
    &= \int_0^{+\infty}\frac{1}{s^2+x^2} \mathrm{d}x - \int_0^{+\infty}\frac{1}{1+x^2} \cdot \frac{1}{s^2+x^2} \mathrm{d}x \\
    &= \int_0^{+\infty}\frac{1}{s^2+x^2} \mathrm{d}x - \frac{1}{s^2-1}\int_0^{+\infty}\left( \frac{1}{1+x^2} - \frac{1}{s^2+x^2} \right) \mathrm{d}x \\
    &= \frac{\pi}{2} \cdot \frac{1}{s+1}
\end{align}
Inverse transform:
$$\mathcal{L}^{-1}\left[ I(\alpha)\right] = \frac{\pi}{2}e^{-\alpha} \Longrightarrow I(1)=\int_0^{+\infty}\frac{x\sin x}{1+x^2} \mathrm{d}x=\frac{\pi}{2e}$$
</s>