Computing $\int_{\gamma}\frac{\sin(\pi z)}{(z^2-1)^2} dt$ 
Compute the integral $I=\int_{\gamma}f(z)dz$, where $$f(z)=\frac{\sin(\pi z)}{(z^2-1)^2}$$
  and $\gamma=\{z:|z-1|=1\}$

I thought of using the formula 
$$f^{(k)}(z_0)=\frac{k!}{2\pi i}\int\limits_{\gamma} \frac{f(t)}{(t-z_0)^{k+1}}dt$$
Then $\int \frac{f(t)}{(t-z_0)^{k+1}}dt=\frac{2\pi i}{k!}f^{(k)}(z_0)$
The replacing $k=1$ and $f(t)=\sin(\pi z)$
$f'(1)=\cos(1\pi)=-1$ then $\int_{\gamma}\frac{\sin(\pi z)}{(z^2-1)^2} dt=2\pi i(-1)=-2\pi i$
However this result is wrong according to the solution it is $-\frac{\pi i}{2}$.
Question:
What am I doing wrong? ´
Thanks in advance!
 A: Yes, you can use Cauchy's integral formula:
$$f^{(n)}(a)=\frac{n!}{2\pi i} \int\limits_{\gamma}\frac{f(z)}{(z-a)^{n+1}}dz$$
but the function is different, $f(z)=\frac{\sin{(\pi z)}}{(z+1)^2}$ and then, given $z=-1$ is outside $|z-1|\leq1$
$$\int\limits_{|z-1|=1}\frac{\sin{(\pi z)}}{(z^2-1)^2}dz=
\int\limits_{|z-1|=1}\frac{\sin{(\pi z)}}{(z+1)^2(z-1)^2}dz=
\int\limits_{|z-1|=1}\frac{f(z)}{(z-1)^2}=\color{red}{2\pi i f'(1)=...}$$
where 
$$f'(z)= \frac{\pi (z + 1)\cos(\pi z) - 2 \sin(\pi z)}{(z + 1)^3}$$
thus
$$f'(1)=-\frac{\pi}{4}$$
and finally
$$\color{red}{...=-\frac{i\pi^2}{2}}$$
A: Letting $z=1+\zeta$ we now have a contour around the origin in the $\zeta$-plane.
Now $\sin(\pi z) = \sin(\pi + \pi \zeta)= - \sin(\pi \zeta)$ and $(z^2-1)^2 \simeq 4 \zeta^{2}$ for $|\zeta|<<1$ which is arbitrarily exact if we contract the contour sufficiently close to the origin which in turn is permitted as there are no singularities in the contour except for the origin.
Then the integral becomes
$$I(z)=- \int_{|\zeta|=\epsilon<<1} \frac{\sin(\pi \zeta)}{\zeta}\frac{1}{4\zeta}\,d\zeta$$
Since $\frac{\sin(\pi \zeta)}{\zeta}\to\pi$ for $|\zeta |\to 0$ 
$$I(z)=-\frac{\pi}{4} \int_{|\zeta|=\epsilon<<1} \frac{1}{\zeta}\,d\zeta=-\frac{\pi}{4} 2 \pi i= - \frac{i}{2} \pi^2$$
A: Because you have $(z^2-1)^2$ in the denominator, not $(z-1)^2.$ You need to use partial fraction decomposition to get rid of this nuisance. To get started, use:
$$\dfrac{2}{z^2-1} = \dfrac{1}{z-1} - \dfrac{1}{z+1}.$$
Then square it and then use the decomposition again in the middle term. 
