TITLE: How to prove $\int_0^{\infty}\frac{x^2+3x+3}{(x+1)^3} e^{-x}\sin x\, dx = \frac{1}{2}.$
QUESTION [17 upvotes]: I've just seen this integral crop up on another site and I can't see an obvious way to prove it. 
Any suggestions?

$$\int_0^{\infty}\frac{x^2+3x+3}{(x+1)^3} e^{-x}\sin x\, dx = \frac{1}{2}.$$

REPLY [6 votes]: $\newcommand{\angles}[1]{\left\langle\, #1 \,\right\rangle}
 \newcommand{\braces}[1]{\left\lbrace\, #1 \,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\, #1 \,\right\rbrack}
 \newcommand{\ceil}[1]{\,\left\lceil\, #1 \,\right\rceil\,}
 \newcommand{\dd}{{\rm d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\dsc}[1]{\displaystyle{\color{red}{#1}}}
 \newcommand{\expo}[1]{\,{\rm e}^{#1}\,}
 \newcommand{\fermi}{\,{\rm f}}
 \newcommand{\floor}[1]{\,\left\lfloor #1 \right\rfloor\,}
 \newcommand{\half}{{1 \over 2}}
 \newcommand{\ic}{{\rm i}}
 \newcommand{\iff}{\Longleftrightarrow}
 \newcommand{\imp}{\Longrightarrow}
 \newcommand{\Li}[1]{\,{\rm Li}_{#1}}
 \newcommand{\pars}[1]{\left(\, #1 \,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\pp}{{\cal P}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\vphantom{\large A}\,#2\,}\,}
 \newcommand{\sech}{\,{\rm sech}}
 \newcommand{\sgn}{\,{\rm sgn}}
 \newcommand{\totald}[3][]{\frac{{\rm d}^{#1} #2}{{\rm d} #3^{#1}}}
 \newcommand{\ul}[1]{\underline{#1}}
 \newcommand{\verts}[1]{\left\vert\, #1 \,\right\vert}$
$\ds{\int_{0}^{\infty}{x^{2} + 3x + 3 \over \pars{x + 1}^{3}}\,
     \expo{-x}\sin\pars{x}\,\dd x = \half:\ {\large ?}}$

With $\ds{a \equiv 1 - \ic}$:
\begin{align}
&\color{#66f}{\large%
\int_{0}^{\infty}{x^{2} + 3x + 3 \over
\pars{x + 1}^{3}}\,\expo{-x}\sin\pars{x}
\,\dd x}
\\[5mm] = &\
\Im\int_{0}^{\infty}{1 + \pars{x + 1} + \pars{x + 1}^{2} \over \pars{x + 1}^{3}}\,
\expo{-ax}\,\dd x
\\[5mm] = &\
\sum_{n\ =\ 0}^{2}\Im\int_{0}^{\infty}
{\expo{-ax} \over \pars{x + 1}^{n + 1}}\,\dd x
\\ = &\
\sum_{n\ =\ 0}^{2}\Im\int_{0}^{\infty}
\expo{-ax}\,\ \overbrace{%
{1 \over n!}\int_{0}^{\infty}t^{n}\expo{-\pars{x + 1}t}\,\dd t}
^{\dsc{1 \over \pars{x +1}^{n + 1}}}\ \,\dd x
\\[5mm] = &\
\sum_{n\ =\ 0}^{2}{1 \over n!}\,\Im\int_{0}^{\infty}t^{n}\expo{-t}
\int_{0}^{\infty}\expo{-\pars{a + t}x}\,\dd x\,\dd t
\\[5mm] = &\
\sum_{n\ =\ 0}^{2}{1 \over n!}\,
\Im\int_{0}^{\infty}{t^{n}\expo{-t} \over a + t}\,\dd t
\\[5mm] = &\
\sum_{n\ =\ 0}^{2}{1 \over n!}\,
\int_{0}^{\infty}{t^{n}\expo{-t} \over \pars{t + 1}^{2} + 1}\,\dd t
\\[5mm] = &\
\half\int_{0}^{\infty}{%
2\sum_{n\ =\ 0}^{2}\,\,t^{n}/n! \over
\pars{t + 1}^{2} + 1}\,\expo{-t}\,\dd t
\\[5mm] = &\
\half\int_{0}^{\infty}
{2 + 2t+ t^{2}\over t^{2} + 2t + 2}\,
\expo{-t}\,\dd t =
\half\int_{0}^{\infty}\expo{-t}\,\dd t=
\color{#66f}{\Large\half}
\end{align}