# Stein and Shakarchi, Complex Analysis, Chapter 2 Example 2

I'm reading through Stein and Shakarchi's Complex Analysis textbook, but I'm a bit confused by their proof that $$\int_{0}^{\infty} \frac{1-\cos(x)}{x^2} dx = \frac{\pi}{2}$$

They consider the function $$f(z) = \frac{1-e^{iz}}{z^2}$$ and an indented semicircle as their contour

The part where I'm confused is the integral of $$f(z)$$ over $$\gamma_{\epsilon}^+$$. The way they evaluate this integral is by first noting that $$f(z) = \frac{-iz}{z^2} + E(z)$$ where $$E(z)$$ is bounded as $$z\rightarrow 0$$. I'm fine with the rest of the proof but I'm puzzled by $$E(z)$$.

My question: How is this function bounded as $$z \rightarrow 0$$?

It seems like $$E(z)$$ would just be $$E(z) = \frac{1+iz+e^{iz}}{z^2}$$

Is it because we're integrating over $$\gamma_{\epsilon}^+$$ and so $$|z| = \epsilon$$ and so

$$\left| E(z) \right| = \left| \frac{1}{z} + \frac{i}{z} + \frac{e^{iz}}{z^2} \right| \leq \left|\frac{1}{z} \right| + \left| \frac{i}{z} \right| + \left| \frac{e^{iz}}{z^2} \right| = \frac{1}{\epsilon} + \frac{1}{\epsilon^2} + \frac{1}{\epsilon^2}$$?

• For $z \neq 0$, $f(z)+{iz \over z^2} = {1+iz - e^{iz} \over z^2} = \sum_{k=2}^\infty { i^k \over k!}z^{k-2}$, the latter is analytic everywhere. Mar 2 at 19:45
• @copper Sorry your comment beat my answer. It took me 5 minutes to find a } that should have been a ). Mar 2 at 20:01
• @TedShifrin :-) np at all. Mar 2 at 20:13

No, \begin{align*} E(z) &= \frac{1-e^{iz}}{z^2} - \frac{-iz}{z^2} = \frac{1-\left(1+iz+\frac{(iz)^2}2 + \frac{(iz)^3}6 +\dots\right)}{z^2} - \frac{-iz}{z^2} \\ &= \frac{-\left(\frac{(iz)^2}2 + \frac{(iz)^3}6 +\dots\right)}{z^2} = \frac12 + O(z). \end{align*} It appears you lost a negative sign in writing down your formula for $$E(z)$$.