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?
 A: 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}$
A: You can easily compute the antiderivative writing
$$\frac{x}{x^2+1}=\frac{x}{(x+i)(x-i)}=\frac{1}{2 (x+i)}+\frac{1}{2 (x-i)}$$ So, you face two integrals looking like
$$I(k)=\int \frac{\sin(x)}{x+k}\,dx$$ Make $x+k=y$ and expand the sine
$$I(k)=\cos(k)\int \frac{\sin(y)}{y}\,dy-\sin(k)\int \frac{\cos(y)}{y}\,dy$$
$$I(k)=\cos (k) \text{Si}(y)-\text{Ci}(y) \sin (k)$$
$$I(+i)=\cosh (1) \text{Si}(y)-i \sinh (1) \text{Ci}(y)$$
$$I(-i)=\cosh (1) \text{Si}(y)+i \sinh (1) \text{Ci}(y)$$ Back to $x$
$$\int \frac{x\sin(x)}{x^2+1}\,dx=\frac{i \left(e^2-1\right) (\text{Ci}(i-x)-\text{Ci}(x+i))-\left(1+e^2\right)
   (\text{Si}(i-x)+ \text{Si}(x+i))}{4 e}$$ If the lower bound is $0$, the result is $0$.
Now, using expansion for large values of $p$
$$\int_0^p \frac{x\sin(x)}{x^2+1}\,dx=\frac{\pi }{2 e}-\frac{\left(p^2-3\right) \cos (p)+p \sin (p)}{p^3}+\cdots$$
Using $p=10$, the above truncated series gives $0.664694\cdots$ while the exact value is  $0.664525\cdots$
