Show that $$\int_{0}^{\infty} \frac{x - \sin(x)}{x^3} \, dx = \frac{\pi}{4}$$
My attempt is as follows: Let $$f(z) = \frac{z - i e^{iz}}{z^3}$$ and consider the contour on $[\epsilon, R]$ followed by a semicircular arc in the counter clockwise direction, then on $[-R, -\epsilon]$, then the semicircular clockwise contour avoiding the origin. We have, then, that
$$0 = \int_{\Gamma} f(z) dz = \int_{[\epsilon, R]} f(t) dt + \int_{C_R}f(Re^{it})Rie^{it}dt + \int_{[-R, -\epsilon]}f(t)dt + \int_{C_{\epsilon}}f(\epsilon e^{-it})\epsilon i e^{-it} dt$$
Then the first and third integrals ( $I_1$ and $I_3$) combine so that
$$I_1 + I_3 = 2\int_{\epsilon}^R \frac{t - \sin{t}}{t^3}\,dt$$
Further,
$$|I_{C_R}| \leq \int_0^\pi \left|\frac{Re^{it} - ie^{-R\sin{t}}e^{iRcos{t}}}{R^2 e^{2it}} \right|dt \rightarrow 0 \text{ as } R\rightarrow \infty$$
(I've omitted the details, it isn't too bad to bound)
However, I'm having trouble computing the limit
$$\lim_{\epsilon \rightarrow 0}\int_{C_{\epsilon}} f(\epsilon e^{-it})\epsilon i e^{-it} dt$$
No matter which way I look at it, it seems like this limit does not exist. Perhaps I'm seeing something wrong or have I chosen a bad $f(z)$?
METHODOLOGY $1$: Straightforward Approach
We begin by letting $I$ be the integral of interest given by
$$\begin{align}
I&=\int_0^\infty \frac{x-\sin(x)}{x^3}\,dx\\\\
&=\frac12 \text{Re}\left(\lim_{\varepsilon\to 0^+,R\to \infty}\left(\int_{-R}^{-\varepsilon} \frac{x+ie^{ix}}{x^3}\,dx+\int_\varepsilon^R \frac{x+ie^{ix}}{x^3}\,dx\right)\right)
\end{align}$$
Next, we analyze the contour integral $J_{\varepsilon,R}$
$$\begin{align}
J_{\varepsilon,R}&=\oint_{C_{\varepsilon,R}}\frac{z+ie^{iz}}{z^3}\,dz\\\\
&=\int_{-R}^{-\varepsilon} \frac{x+ie^{ix}}{x^3}\,dx+\int_\varepsilon^R \frac{x+ie^{ix}}{x^3}\,dx\\\\
&+\int_\pi^0 \frac{\varepsilon e^{i\phi}+ie^{i\varepsilon e^{i\phi}}}{(\varepsilon e^{i\phi})^3}\,i\varepsilon e^{i\phi}\,d\phi+\int_0^\pi \frac{Re^{i\phi}+ie^{iR e^{i\phi}}}{(R e^{i\phi})^3}\,iR e^{i\phi}\,d\phi
\end{align}$$
Expanding $e^{i\varepsilon e^{i\phi}}$ as
$$e^{i\varepsilon e^{i\phi}}=1+i\varepsilon e^{i\phi}-\frac12 \varepsilon^2e^{i2\phi}+O\left(\varepsilon^3\right)$$
reveals that the integration over the semicircle of radius $\epsilon$ is
$$\begin{align}
\int_\pi^0 \frac{\varepsilon e^{i\phi}+ie^{i\varepsilon e^{i\phi}}}{(\varepsilon e^{i\phi})^3}\,i\varepsilon e^{i\phi}\,d\phi&=\frac1{\varepsilon^2}\underbrace{\int_0^\pi e^{-i2\phi}\,d\phi}_{=0}-\frac12 \int_0^\pi (1)\,d\phi +O(\varepsilon)\\\\
&=-\frac\pi2 +O(\varepsilon)
\end{align}$$
Furthermore, it is easy to show that the integration over the semi-circle of radisu $R$ is
$$\begin{align}
\int_0^\pi \frac{Re^{i\phi}+ie^{iR e^{i\phi}}}{(R e^{i\phi})^3}\,iR e^{i\phi}\,d\phi=O\left(\frac1R\right)
\end{align}$$
Since $\frac{z+ie^{iz}}{z^3}$ is analytic in and on $C_{\varepsilon,R}$, Cauchy's integral theorem guarantees that $J_{\varepsilon,R}=0$. Putting everything together, we see that
$$\begin{align}
0&=J_{\varepsilon,R}\\\\
&=\int_{-R}^{-\varepsilon} \frac{x+ie^{ix}}{x^3}\,dx+\int_\varepsilon^R \frac{x+ie^{ix}}{x^3}\,dx\\\\
&-\frac\pi2+O\left(\varepsilon\right)+\left(\frac1R\right)
\end{align}$$
whereupon taking the limit as $\varepsilon\to 0^+$ and $R\to \infty$ yields
$$I=\frac\pi4$$
And we are done!
METHODOLOGY $2$: Simplifying Using Integration by Parts
We can make our life much easier if we apply successive integration by parts. We now proceed accordingly.
Let $I$ be the integral given by
$$\begin{align}
I&=\int_0^\infty \frac{x-\sin(x)}{x^3}\,dx\tag1
\end{align}$$
Integrating by parts the integral on the right-hand side of $(1)$ with $u=x-\sin(x)$ and $v=-\frac{1}{2x^2}$, we find that
$$I=\frac12\int_0^\infty \frac{1-\cos(x)}{x^2}\,dx \tag2$$
Integrating by parts the integral on the right-hand side of $(2)$ with $u=1-\cos(x)$ and $v=-\frac1x$ reveals
$$\begin{align}
I&=\frac12 \int_0^\infty \frac{\sin(x)}{x}\,dx\tag3
\end{align}$$
We will evaluate the integral in $(3)$ using contour integration.
We analyze the contour integral $J(\varepsilon,R)$, where $R>0$ and $\varepsilon>0$, as given by
$$\begin{align}
J(\varepsilon,R)&=\oint_{C_{\varepsilon,R}}\frac{e^{iz}}{z}\,dz\\\\
&=\int_{-R}^{-\varepsilon} \frac{e^{ix}}{x}\,dx+\int_\pi^0 \frac{e^{i\varepsilon e^{i\phi}}}{\varepsilon e^{i\phi}}\,i\varepsilon e^{i\phi}\,d\phi+\int_{\varepsilon}^R \frac{e^{ix}}{x}\,dx+\int_\pi^0 \frac{e^{iR e^{i\phi}}}{R e^{i\phi}}\,iR e^{i\phi}\,d\phi\tag4
\end{align}$$
Since $\frac{e^{iz}}{z}$ is analytic in and on the contour defined by $C_{\varepsilon,R}$, Cauchy's Integral Theorem guarantees that $J(\varepsilon,R)=0$.
First, note from symmetry that
$$\int_{-R}^{-\varepsilon} \frac{e^{ix}}{x}\,dx+\int_{\varepsilon}^R \frac{e^{ix}}{x}\,dx=i2\int_{\varepsilon}^R \frac{\sin(x)}{x}\,dx$$
Furthermore, we have
$$\lim_{\varepsilon\to 0,R\to \infty}\int_{\varepsilon}^R \frac{\sin(x)}{x}\,dx=\int_0^\infty \frac{\sin(x)}{x}\,dx\tag5$$
Second, it is easy to see that
$$\lim_{\varepsilon\to 0}\int_\pi^0 \frac{e^{i\varepsilon e^{i\phi}}}{\varepsilon e^{i\phi}}\,i\varepsilon e^{i\phi}\,d\phi=-i\pi \tag6$$
Third, noting that $\sin(\phi)\ge \frac{2\phi}{\pi}$ for $\phi\in [0,\pi/2]$, we see that
$$\begin{align}
\left|\int_\pi^0 \frac{e^{iR e^{i\phi}}}{R e^{i\phi}}\,iR e^{i\phi}\,d\phi\right|&=\left|\int_0^\pi ie^{iR\sin(\phi)}e^{-R\cos(\phi)}\right|\\\\
&\le\int_0^\pi e^{-R\cos(\phi)}\,d\phi\\\\
&=2\int_0^{\pi/2}e^{-R\sin(\phi)}\,d\phi\\\\
&\le 2\int_0^{\pi/2}e^{-2R\phi/\pi}\,d\phi\\\\
&=\frac{\pi(1-e^{-R})}{R}
\end{align}$$
Hence, we see that
$$\lim_{R\to \infty}\int_\pi^0 \frac{e^{iR e^{i\phi}}}{R e^{i\phi}}\,iR e^{i\phi}\,d\phi=0\tag 7$$
Finally, using $(5)-(7)$ in $(4)$ yields
$$\int_0^\infty \frac{\sin(x)}{x}\,dx=\frac{\pi}{2}$$
whence we find that
$$\int_0^\infty \frac{x-\sin(x)}{x^3}\,dx=\frac\pi4$$