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.