Application of residue theorem for improper integrals While i am reading one example in the book, i came across the book teaching me how to evaluate $\int_{-\infty}^{\infty}\dfrac{\sin x}{x}dx$ by using residue theorem.
However, while they say we still construct a semi circle with radius $R$ and centered at $0$, and by letting $\int_{C_R}\dfrac{e^{iz}-1}{z}dz$, we can slowly solve the question.
However, they claimed that $\int_{C_R}\dfrac{e^{iz}-1}{z}dz = 0$ for the closed semi circle $C_R(0,R)$. I have some confusion here as i thought that $z = 0$ is a point where the function is not analytic? I do understand now that if $z=0$ is a removable singularity of the function, then when you integrate, you will get $0$. However, $0$ seems to lie on  the boundary of the closed semi circle. So i am not sure if $z=0$ is a singularity or not
Please enlighten
The example is from the book Bak and Newman on application of residue theorem
 A: They key idea is that removable singularities aren't really singularities at all. You can extend $f$ to the point $0$ such that this extension is holomorphic. When the author writes $\frac{e^{iz} -1}{z}$, they really mean the extended version of this function. To be specific, 
$$f(z) = \frac{e^{iz} -1}{z}$$
can be thought of as the entire (i.e holomorphic on $\mathbb{C}$) function given by the Taylor series
$$\sum_{n=0}^{\infty} i^{n} \ \frac{z^{n}}{(n+1)!}.$$
You're correct in thinking that you can't take the line integral of a function $g$, when the curve you're integrating over goes through a singularity of $g$ (that was a mouthful!). However, in this case $0$ isn't really a singularity of $f$ at all - i.e there's no issue calculating the line integral
$$\int_C f(z) \ dz,$$
where $C$ is a curve that passes through $0$.
The main point to take away, is that when the author writes
$$\frac{e^{iz} -1}{z},$$
they really mean the 'extended', holomorphic everywhere version of this function. 
