problems to calculate $\int_\gamma \frac{e^{iz}}{z^2}dz$ Some ideas to may begin to calculate $\int_\gamma \frac{e^{iz}}{z^2}dz$?(where $\gamma:[0,2\pi]\to\mathbb{C}$ def by $\gamma(t)=e^{it}$). Trying by definition I obtain an expression like $e^{ie^{it}}$ which is weird.
 A: Note that the function $$f(z) = \frac{e^{iz}}{z^2}$$ is analytic on all $\mathbb{C}/{0}$. The function has a pole of order two in $0$. The contour you're integrating on contains the pole of the function so you can use the residue theorem to evaluate your integral: $$\int_{\gamma}\frac{e^{iz}}{z^2} = 2\pi i\operatorname{Res}(f(z),0)\tag1$$
Now it's just a matter to evaluate your resiude. Being $0$ a pole of order $2$ we can evaluate it in the following manner $$\operatorname{Res}(f(z),0) = \lim_{z\rightarrow 0}\frac{d}{dz}\left(z^2\frac{e^{iz}}{z^2}\right) = \lim_{z\rightarrow 0}\frac{d}{dz}\left(e^{iz}\right) = \lim_{z\rightarrow 0}(ie^{iz}) = i$$
Or we could evaluate it by the Laurent series around $0$ of the function, which can be easily found by the Taylor series of $e^{iz}$ $$e^{iz} = \sum_{n=0}^\infty \frac{(iz)^n}{n!} = 1+iz-\frac{z^2}{2}-\frac{iz^3}{6}+O(z^4)$$ dividing it by $z^2$ we get the Laurent series of $f(z)$ $$\frac{e^{iz}}{z^2} = \sum_{n=0}^\infty i^n\frac{z^{n-2}}{n!} = \frac{1}{z^2}+\color{red}{i}\frac{1}{z}-{1\over 2}-\cdots$$
the $\color{red}{\text{red}}$ coloured coefficient is the residue at $z=0$
In both cases we found out that the residue evaluates to $i$ so plugging it back into $(1)$ we get the value of the integral $$\int_{\gamma}\frac{e^{iz}}{z^2} = 2\pi i\operatorname{Res}(f(z),0) =  2\pi i\color{red}{i} = -2\pi$$
A: We denote $f(z)=\dfrac{e^{iz}}{z^2}.$ Using the Residue theorem we get
$$\int_{\gamma} f(z)dz=2\pi i Res(f,0)$$ since the only singularity of $f$ is a pole of order $2$ at $0$ (which lies in the interior of $\gamma$).
Now
$$f(z)=\dfrac{1+iz-\dfrac{z^2}{2}+o(z^2)}{z^2}=\dfrac{1}{z^2}+\dfrac{\color{red}{i}}{z}-\dfrac 12+o(1)$$ from where 
$$Res(f,0)=i.$$
So, we have 
$$\int_{\gamma} f(z)dz=2\pi i Res(f,0)=-2\pi.$$
