Calculate $\int_{0}^{\infty} \frac{x-\sin(x)}{x^3(1+x^2)}$ Calculate $$\int_{0}^{\infty} \frac{x-\sin(x)}{x^3(1+x^2)}$$
I know i am supposed to use residue theorem. However, I am having trouble with the pole at $z=0$ normally i would try the funciton $$f(z)=\frac{z-e^{iz}}{z^3(1+z^2)}$$ but this clearly is not working  as this function has a pole of order 3 at $z=0$. if i try to reduce the order of the pole i would need to do something along those lines:
$$f(z)=\frac{z-ie^{iz}+i}{z^3(1+z^2)}$$ and here the pole is simple, but integrating this function will not give me the desired integral, I don' think. What do I do?
Edit:
Perhaps $y=x^2$ substitution and keyhole integration would work. I will have to check.
 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]{\int_{0}^{\infty}{x - \sin\pars{x} \over
x^{3}\pars{1 + x^{2}}}\,\dd x}=
{1 \over 2}\,\Im\int_{-\infty}^{\infty}{\ic x - \expo{\ic x} + 1 - x^{2}/2 \over
x^{3}\pars{1 + x^{2}}}\,\dd x
\\[5mm] = &\
{1 \over 2}\,\Im\braces{2\pi\ic\,%
{\ic\pars{\ic} - \expo{\ic\pars{\ic}} + 1 - \ic^{2}/2 \over 
\ic^{3}\pars{\ic + \ic}}} = \bbx{\large{\expo{} -2 \over 4\expo{}}\,\pi} \\ &
\end{align}

The $\ds{\large\left. contribution\ from\ the\ arc\  R\expo{\ic\pars{0,\pi}}\,\right\vert_{\ R\ >\ 1}}$:

\begin{align}
0 & < \verts{\int_{0}^{\pi}
{\ic R\expo{\ic\theta} -
\expo{\ic R\cos\pars{\theta}}\expo{-R\sin\pars{\theta}} + 1 -
R^{2}\expo{2\ic\theta} \over
R^{3}\expo{3\ic\theta}\pars{1 + R^{2}\expo{2\ic\theta}}}\,R\expo{\ic\theta}\ic\,\dd\theta}
\\[5mm] & <
\int_{0}^{\pi}{R + \expo{-R\sin\pars{\theta}} + 1 + R^{2} \over
R^{3}\pars{R^{2} - 1}}\,R\,\dd\theta
\\[5mm] & =
{R^{2} + R + 1 \over R^{2}\pars{R^{2} - 1}}\,\pi +
{1 \over R^{2}\pars{R^{2} - 1}}
\int_{-\pi/2}^{\pi/2}\expo{-R\cos\pars{\theta}}\dd\theta
\\[5mm] & \stackrel{\mrm{as}\ R\ \to\ \infty}{\sim}\,\,\,
{2 \over R^{4}}
\int_{0}^{\pi/2}\expo{-R\sin\pars{\theta}}\dd\theta <
{2 \over R^{4}}
\int_{0}^{\pi/2}\expo{-2R\theta/\pi}\dd\theta
\\[5mm] & =
\pi\,{1 - \expo{-R} \over R^{5}}
\,\,\,\stackrel{\mrm{as}\ R\ \to\ \infty}{\LARGE\to}\,\,\,
{\large\color{red}{0}}
\end{align}
A: Define
$$ I(a)=\int_{0}^{\infty} \frac{ax-\sin(ax)}{x^3(1+x^2)}dx. $$
Then
\begin{eqnarray}
I'(a)&=&\int_{0}^{\infty} \frac{1-\cos(ax)}{x^2(1+x^2)}dx\\
I''(a)&=& \int_{0}^{\infty} \frac{\sin(ax)}{x(1+x^2)}dx\\
I'''(a)&=&\int_{0}^{\infty} \frac{\cos(ax)}{1+x^2}dx=\frac\pi2 e^{-a}
\end{eqnarray}
and hence
\begin{eqnarray}
I''(a)&=&\int_0^a\frac\pi2 e^{-s}ds=\frac\pi2(1-e^{-a})\\
I'(a)&=&\int_0^a\frac\pi2(1-e^{-s})ds=\frac\pi2(a-1+e^{-a})\\
I(1)&=&\int_0^1\frac\pi2(a-1+e^{-a})da=\frac{(e-2)\pi}{4e}.
\end{eqnarray}
A: Here is an elementary evaluation
\begin{align}
&\int_{0}^{\infty} \frac{x-\sin x}{x^3(1+x^2)}dx\\
=& \int_{0}^{\infty} \frac{x-\sin x}{x^3}dx
 - \int_{0}^{\infty} \frac{1}{1+x^2}dx
+\int_{0}^{\infty} \frac{\sin x}{x(1+x^2)}dx\\
=&\ \frac\pi4-\frac\pi2+\frac{(e-1)\pi}{2e}=\frac{(e-2)\pi}{4e}
\end{align}
