Integrating $(e^{iz}-1)/z$ about a semi-circle to evaluate Dirichlet integral. An exercise in the second chapter of Stein-Shakarchi's Complex Analysis, asks us to evaluate the famous integral
$$\int^{\infty}_{0}\frac{\sin(x)}{x}dx=\frac{\pi}{2}$$
We are expected to do this via Cauchy's theorem by evaluating a contour integral about an indented semi-circle. The text hints that this integral equals $\frac{1}{2i} \int^{\infty}_{-\infty} \frac{e^{ix}-1}{x}$, so I think the complex function being integrated is 
$$f(z)=\frac{e^{iz}-1}{z}$$
I am struggling with the integral about the indention, that is let $\gamma_{\epsilon}(\theta)=\epsilon e^{i\theta}$ parametrized clockwise so that the integral I am having issue with is
$$\int_{\gamma_{\epsilon}}\frac{e^{iz}-1}{z}dz.$$
If I consider the Taylor expansion of $e^{iz}-1=iz + E(z)$ where $E(z) \to 0$ as $z\to 0$ and then try to evaluate this integral, I obtain that 
$$\int_{\gamma_{\epsilon}}\frac{e^{iz}-1}{z}dz \approx -\int_{\pi}^{0} \epsilon  e^{i\theta}d\theta  $$
Where I am confused is that it looks like the later integral goes to $0$ as $\epsilon \to 0$, which is not what I am looking for.
 A: You are correct.  But recall that 
$$\begin{align}
\oint_C \frac{e^{iz}-1}{z}\,dz&=\int_{-R}^{-\epsilon}\frac{e^{ix}-1}{x}\,dx+\int_{\epsilon}^{R}\frac{e^{ix}-1}{x}\,dx\\\\
&+\int_\pi^0 \frac{e^{\epsilon e^{i\phi}}-1}{\epsilon e^{i\phi}}\,i\epsilon e^{i\phi}\,d\phi+\int_0^\pi \frac{e^{R e^{i\phi}}-1}{R e^{i\phi}}\,iR e^{i\phi}\,d\phi \tag 1
\end{align}$$
Evaluating the limit as $R\to \infty$ of the last integral on the right-hand side of $(1)$ yields
$$\begin{align}
\lim_{R\to \infty}\int_0^\pi \frac{e^{iRe^{i\phi}}-1}{Re^{i\phi}}\,iRe^{i\phi}\,d\phi&=i\lim_{R\to \infty}\int_0^\pi (e^{iRe^{i\phi}}-1)\,d\phi\\\\
&=-i\pi \tag 2
\end{align}$$
Note that in arriving at $(2)$, we used the following estimates
$$\begin{align}
\left|\int_0^\pi e^{iRe^{i\phi}}\,d\phi\right|&\le \int_0^\pi e^{-R\sin(\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\\\\
&=\pi\left(\frac{1-e^{-R}}{R}\right)\to 0\,\,\text{as}\,\,R\to \infty
\end{align}$$
Hence, we have
$$\int_0^\infty \frac{\sin(x)}{x}\,dx=\text{Re}\left(\frac{1}{2i}(i\pi )\right)=\pi/2$$
as was to be shown!
