Calculating improper complex integral $\int_0^{+\infty}(x^2+2x)\exp(\omega x)\sin(x) \mathrm{dx}$ $$\int_0^{+\infty}(x^2+2x)\exp(\omega x)\sin(x) \mathrm{dx}$$
$$\omega \in \mathbb{C}, \mathrm{Re}(\omega)<0$$
How do I solve this - what's the best way to calculate this integral? Looking at real part and imaginary part separately?
 A: First, let's rename the variable $\omega =-s$ such that we obtain
$$\int_0^{+\infty}(x^2+2x)\exp(-s x)\sin(x) \mathrm{dx}.$$
Then use $s=a+jb$ and Euler's formula as a substitution to obtain
$$\int_0^{+\infty}(x^2+2x)\exp(-a x-jbx)\sin(x) \mathrm{dx}=\int_0^{+\infty}(x^2+2x)\exp(-a x)\exp(-jbx)\sin(x) \mathrm{dx}$$
$$=\int_0^{+\infty}(x^2+2x)\exp(-a x)\left[\cos(bx)-j\sin(bx)\right]\sin(x) \mathrm{dx}$$
$$=\int_0^{+\infty}(x^2+2x)\exp(-a x)\cos(bx)\sin(x) \mathrm{dx}$$
$$-j\int_0^{+\infty}(x^2+2x)\exp(-a x)\sin(bx)\sin(x) \mathrm{dx}.$$
In the next step apply 
$$\sin u \cos v= \dfrac{1}{2}\left[\sin(u-v)+\sin(u+v) \right]$$
$$\sin u \sin v= \dfrac{1}{2}\left[\cos(u-v)+\cos(u+v) \right]$$
to turn the products of trigonometric functions into sums of trigonometric functions. 
Then apply Euler's integral formulas to obtain the solutions to the appearing integrals.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
\begin{align}
&\bbox[10px,#ffd]{\ds{\left.\int_{0}^{\infty}\pars{x^{2} + 2x}
\exp\pars{\omega x}\sin\pars{x}\,\dd x\,\right\vert_{\ \Re\pars{\omega}\ <\ 0}}}
\\[5mm] = &\
\pars{\partiald[2]{}{\omega} + 2\,\partiald{}{\omega}}
\int_{0}^{\infty}\exp\pars{\omega x}\,{\expo{\ic x} - \expo{-\ic x} \over 2\ic}\,\dd x =
-\,{1 \over 2}\,\ic\pars{\partiald[2]{}{\omega} + 2\,\partiald{}{\omega}}
\pars{{-1 \over \omega + \ic} - {-1 \over \omega - \ic}}
\\[5mm] = &\
-\,{1 \over 2}\,\ic\pars{\partiald{}{\omega} + 2}
\bracks{{1 \over \pars{\omega + \ic}^{2}} - {1 \over \pars{\omega - \ic}^{2}}}
\\[5mm] = &\
-\,{1 \over 2}\,\ic
\bracks{-\,{2 \over \pars{\omega + \ic}^{3}} +
{2 \over \pars{\omega - \ic}^{3}} + {2 \over \pars{\omega + \ic}^{2}} -
{2 \over \pars{\omega - \ic}^{2}}}
\\[5mm] = &\
\bbx{{\ic \over \pars{\omega + \ic}^{3}} -
{\ic \over \pars{\omega - \ic}^{3}} - {\ic \over \pars{\omega + \ic}^{2}} +
{\ic \over \pars{\omega - \ic}^{2}}}
\end{align}
