<s>[INST] Existence of $\int_0^{\infty} \frac{x\sin(x)}{x^2+1}\ \mathrm{d}x$ I am currently reading some lecture notes where the calculation of
\begin{align}
\int_{-\infty}^{\infty} \frac{x\sin(x)}{x^2+1}\ \mathrm{d}x
\end{align}
using residues is explained. The existence of $\lim_{R\to \infty}\int_0^{\infty} \frac{x\sin(x)}{x^2+1}\ \mathrm{d}x$ is only briefly discussed by stating that it can be shown using integration by parts. I do not see that.
How can I use integration by parts to proof the existence of this limit?
 [/INST] Note that the derivative of $x \mapsto \frac{x}{x^2+1}$ is pointwise equal to $\frac{1-x^2}{(1+x^2)^2}$, hence by integration by parts $$ \int_0^\infty \frac{x}{x^2+1}\sin(x)dx = -\cos(x)\frac{x}{x^2+1}\Big|_{x=0}^{x=+\infty} + \int_0^\infty \frac{1-x^2}{(1+x^2)^2}\cos(x) dx $$
The "boundary" term is $0$ (i.e this term without integral, which can be easily seen). So the convergence of our integral is equivalent with convergence of $$\int_0^\infty \frac{1-x^2}{(1+x^2)^2}\cos(x)dx $$
And the latter is even absolutelly convergent, because (by $|\cos(x)| \le 1$ and triangle inequality) $\frac{|1-x^2|
}{(1+x^2)^2}|\cos(x)| \le  \frac{1}{(1+x^2)^2} + \frac{x^2}{(1+x^2)^2}$
</s>