Cauchys integral formula on function with pole of order 2 I want to compute the integral
$$\int_{|z - 1| = 1/2}  \frac{e^{iz}}{(z^2-1)^2} \mathrm{d}z$$
using Cauchy's integral formula (residual theorem is not allowed). Examining the integrand one gets
$$ \frac{e^{iz}}{(z^2-1)^2} = \frac{e^{iz}}{(z-1)^2(z+1)^2}.$$
The problem is that I can't decompose the integrand as
$$f(z) \frac{1}{1-z}$$
since $f$ won't be holomorphic on $B_{1/2}(1)$ because the singularity of the integrand at $z=1$ is a pole of order $2$. I think a partial fraction decomposition won't help.
How should I proceed?
 A: Recall Cauchy Integral Formula for Higher Derivatives: $f^{(n)}(z) = \frac{n!}{2\pi i} \displaystyle\int_\gamma \frac{f(\zeta)}{(\zeta-z)^{n+1}}\ d\zeta$.
Let $g(z)=\dfrac{e^{iz}}{(z+1)^2}$. Since $g$ is analytic on $\gamma: |z-1|=\frac{1}{2}$, $g'(1)=\frac{1}{2\pi i}\displaystyle\int_\gamma \frac{g(z)}{(z-1)^2}\ dz=\frac{1}{2\pi i}\displaystyle\int_\gamma \frac{e^{iz}}{(z^2-1)^2}\ dz$. Thus, the value of the integral is $2\pi i\cdot g'(1)$.
A: Notice, we have $$\int_{|z-1|=1/2}\frac{e^{iz}}{(z^2-1)^2}dz$$
$$\int_{|z-1|=1/2}\frac{e^{iz}}{(z-1)^2(z+1)^2}dz$$
Since, $z=1$ is inside the circle $|z-1|=1/2$ hence it is the pole of second order Hence we have
$$f(z)=\frac{e^{iz}}{(z+1)^2}$$
Now, using Cauchy Integral Formula, we get 
$$\int_{|z-1|=1/2}\frac{e^{iz}}{(z-1)^2(z+1)^2}dz=\frac{2\pi i}{1!}\lim_{z\to 1}\left[\frac{d}{dz}\left(\frac{e^{iz}}{(z+1)^2}\right)\right]$$
$$=2\pi i\lim_{z\to 1}\left[\frac{e^{iz}(i(z+1)^2-2z-2)}{(z+1)^4}\right]$$
$$=2\pi i\left[\frac{e^{i\times 1}(i(1+1)^2-2\times 1-2)}{(1+1)^4}\right]$$
$$=2\pi i\left[\frac{e^{i}(4i-4)}{16}\right]$$
$$=-\frac{\pi}{2}e^{i}(1+i)$$
A: Let $$f(u) =\frac{e^{iu}}{(u+1)^2}$$ then $$\oint_{\left|z-1\right| =\frac{1}{2} }\frac{e^{iz}}{(z^2 -1 )^2}dz =\oint_{\left|z-1\right| =\frac{1}{2} }\frac{f(z)}{(z-1)^2} dz =\frac{2\pi i}{1!} f' (1)=\frac{-\pi e^i (i+1)}{2}$$
