Question: I'm working through a contour integral question, which is rounded off by finding the integral:

$$\int^{\infty}\_{0} \frac{x-\sin(x)}{x^3} dx$$

I have already shown that the residue at $0$ of the function

$$f(z)=\frac{1+iz-e^{iz}}{z^3}$$

on $\mathbb{C} - \{0\}$ is $\frac{1}{2}$, and that 

$$\int\_{\gamma\_R} f(z) dz \longrightarrow 0$$ as $R \longrightarrow 0$ where $\gamma\_R:[0,\pi]\rightarrow \mathbb{C}$ is given by $\gamma\_R(t)=Re^{it}$. 

> 
> 
> > 
> > Problem
> > 
> > 
> > 
> 
> 
> 

How do I progress from here to finding the required integral? It's an odd function, so clearly all that is left is to integrate from $R$ to $-R$ along the real axis and half it to find the integral, but I can't see how to pull out the '$x-\sin(x)$' and replace '$z^3$' with '$x^3$'.

An explanation of how to finish this off would be much appreciated. Thanks in advance.

Answer: 
Since the integrand is even,
$$
\int^{\infty}\_{0} \frac{x-\sin(x)}{x^3}\,dx=\frac12\int^{\infty}\_{-\infty} \frac{x-\sin(x)}{x^3}\,dx.
$$
Take $\epsilon>0$ small and $R>0$ large. The integral of $f(z)$ along the closed path formed by the segment $[\epsilon,R]$, the semi-circumference $\gamma\_R$ counterclockwise, the segment $[-R,-\epsilon]$ and the semi-circumference $\gamma\_\epsilon$ of radius $\epsilon$ (in the upper half-plane) clockwise is equal to $0$. Then
$$
\Bigl(\int\_{-R}^{-\epsilon}+\int\_{\epsilon}^{R}\Bigr)f(x)\,dx+\int\_{\gamma\_R}f(z)\,dz+\int\_{\gamma\_\epsilon}f(z)\,dz=0.
$$
As $R\to\infty$ and $\epsilon\to0$,
$$
\Bigl(\int\_{-R}^{-\epsilon}+\int\_{\epsilon}^{R}\Bigr)f(x)\,dx\to\int^{\infty}\_{-\infty} \frac{1-\cos(x)}{x^3} dx+i\int^{\infty}\_{-\infty} \frac{x-\sin(x)}{x^3}\,dx.
$$
You already know that $\lim\_{R\to\infty}\int\_{\gamma\_R}f(z)\,dz=0$. All is left is to find $\lim\_{\epsilon\to0}\int\_{\gamma\_\epsilon}f(z)\,dz$.
Since the integrand has no singularities and the it vanishes on $x+it$ for $t\in[-1,0]$ as $|x|\to\infty$, we get
$$
\begin{align}
\int\_0^\infty\frac{x-\sin(x)}{x^3}\mathrm{d}x
&=\frac12\int\_{-\infty}^\infty\frac{x-\sin(x)}{x^3}\mathrm{d}x\\
&=\frac12\int\_{-\infty-i}^{\infty-i}\frac{x-\sin(x)}{x^3}\mathrm{d}x\\
&=\frac12\int\_{-\infty-i}^{\infty-i}\frac{\mathrm{d}x}{x^2}
-\frac1{4i}\int\_{-\infty-i}^{\infty-i}\frac{e^{ix}}{x^3}\mathrm{d}x
+\frac1{4i}\int\_{-\infty-i}^{\infty-i}\frac{e^{-ix}}{x^3}\mathrm{d}x\\
&=\frac12\int\_{\gamma^+}\frac{\mathrm{d}z}{z^2}
-\frac1{4i}\int\_{\gamma^+}\frac{e^{iz}}{z^3}\mathrm{d}z
+\frac1{4i}\int\_{\gamma^-}\frac{e^{-iz}}{z^3}\mathrm{d}z\\
&=0-\frac\pi2\left(-\frac12\right)+0\\[6pt]
&=\frac\pi4
\end{align}
$$
$\gamma^+$ follows $(-\infty-i)$ to $(\infty-i)$ then circles back counter-clockwise through the upper half-plane along the circle centered at $-i$.

$\gamma^-$ follows $(-\infty-i)$ to $(\infty-i)$ then circles back clockwise through the lower half-plane along the circle centered at $-i$.

The residue of $\dfrac1{z^2}$ at $z=0$ is $0$ and its integral is $0$ along the circular arc of $\gamma^+$.

The residue of $\dfrac{e^{iz}}{z^3}$ at $z=0$ is $-\dfrac12$ and its integral is $0$ along the circular arc of $\gamma^+$.

$\dfrac{e^{-iz}}{z^3}$ has no residues in $\gamma^-$ and its integral is $0$ along the circular arc of $\gamma^-$.