Calculation of an improper integral in the context of complex functions I am facing the following improper integral:
$$\int_0^\infty \frac{x^5\sin x}{(1+x^2)^3}dx.$$
Clearly the expression under the integral is a meromorphic function analytic on the nonnegative part of the real line and on the upper half plane (excluding the real line). I do not know how to proceed. I expect that we need to integrate over some larger path and use some residue formula. However we cannot integrate over a the border of a semicircle in the upper half plane increasing in radius because $\sin x$ becomes large as $\operatorname{Im} x$ becomes large. Moreover I do not see how to get from there to an explicit formula of the integral since through this method we would get the value of
$$\int_{-\infty}^\infty \frac{x^5\sin x}{(1+x^2)^3}dx.$$
I do not really understand how I should proceed. I do not need a full answer but a hint (for example over which path to integrate or which formula or theory to use) should be enough.
 A: The denominator is an even function, $x\mapsto x^5$ and $\sin$ are both odd functions, hence the numerator is also an even function, and thus the integrand is even and
$$\int_0^\infty \frac{x^5\sin x}{(1+x^2)^3}\,dx = \frac{1}{2}\int_{-\infty}^\infty \frac{x^5\sin x}{(1+x^2)^3}\,dx.$$

However we cannot integrate over a the border of a semicircle in the upper half plane increasing in radius because $\sin x$ becomes large as $\operatorname{Im} x$ becomes large.

Quite. And therefore we use Euler's formula to replace the sine with ah exponential term. Here we can use $\sin x = \operatorname{Im} e^{ix}$ for $x\in \mathbb{R}$ to rewrite our integral as
$$\frac{1}{2} \operatorname{Im} \int_{-\infty}^\infty \frac{x^5 e^{ix}}{(1+x^2)^3}\,dx.$$
Since the real part of $e^{ix}$ is even, the integral of the real part vanishes, hence in fact we can write our integral as
$$\frac{1}{2i} \int_{-\infty}^\infty \frac{x^5 e^{ix}}{(1+x^2)^3}\,dx.$$
Now it is in a form where the standard semicircular contour works smoothly.
