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.

  • $\begingroup$ Wolfram says this. Maybe you know those functions and can find a way to get there. Otherwise just know the definite integral is given by Wolfram as $\frac{\pi}{2e}$. $\endgroup$
    – MickG
    Oct 21, 2014 at 10:15
  • $\begingroup$ This is a very difficult one, just as MickG showed ! $\endgroup$ Oct 21, 2014 at 10:26
  • 1
    $\begingroup$ Duplicate of this. Similar to this and this. Linked, by way of differentiation under the integral sign, to this, this, this, this, and this. $\endgroup$
    – Lucian
    Oct 21, 2014 at 11:52
  • $\begingroup$ possible duplicate of How would one evaluate $\int\frac{x\sin(x)}{x^2+1}$ over the real line? $\endgroup$
    – rogerl
    Oct 21, 2014 at 14:37

3 Answers 3


Since your integrand is even, this integral is equal to one half of $$ \int _{-\infty}^{\infty}\frac{x\sin x}{x^2+1}dx $$

This integral is the imaginary part of

$$ \int _{-\infty}^{\infty}\frac{x \cdot e^{ix}}{x^2+1}dx $$

This can be solved as the contour integral with contour a half disc of radius $R$ with base on the real axis, letting $R$ go to infinity. The integral along the arc goes to $0$ ( needs some showing ). The contour integral is equal to the residue at $x=i$, which is $e^{-1}\pi i$. So taking half the imaginary part, we get $\frac{\pi}{2e}$.

  • $\begingroup$ I was about to say the same thing. I do wonder though why a person would be doing an integral that requires contours but wouldn't recognize this as one that could/should be done in that way. +1 $\endgroup$ Oct 21, 2014 at 10:32

Using the result from this OP: Integral evaluation $\int_{-\infty}^{\infty}\frac{\cos (ax)}{\pi (1+x^2)}dx$. We have \begin{equation} \int_0^\infty\frac{\cos ax}{1+x^2}\,dx=\frac{\pi}{2}e^{-|a|} \end{equation} Thus, our integration is simply \begin{align} \int_0^\infty\frac{x\sin x}{1+x^2}\,dx&=-\lim_{a\to1}\partial_a\int_0^\infty\frac{\cos ax}{1+x^2}\,dx\\ &=-\frac{\pi}{2}\lim_{a\to1}\partial_a\left[e^{-|a|}\right]\\ &=\frac{\pi}{2e} \end{align}

  • $\begingroup$ I think you miss a "-" in front of $\lim_{a\rightarrow1}$. $\endgroup$ Oct 21, 2014 at 11:47
  • $\begingroup$ @AlfredChern Thanks again. Edited... (✿◠‿◠) $\endgroup$ Oct 21, 2014 at 11:50

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}$$


Not the answer you're looking for? Browse other questions tagged .