I have to calculate the integral $$\oint_C \frac{z^2+z+1}{(z-i)^2}dz$$ where $C$ is the positively oriented rectangle between $-1, 1, 1+2i, -1+2i$.
My attempt is to use Cauchy's integral formula, but obviously the integrand is not differentiable at $i$ which lies inside $C$ which means that it is not holomorphic. Does this matter? If yes, how do I fix it?
If this does not matter, I simply choose e.g. $z_0=1/2(1+i)$ which lies inside $C$ and calculate its index $I_C(z_0)=\frac{1}{2\pi i}\oint_C \frac{d\xi}{\xi-z_0}$ respective to $C$ and then use $$f(z_0)I_C(z_0)=\frac{1}{2\pi i}\oint_C\frac{f(\xi)}{\xi-z_0}d\xi$$
Am I on the right track?
Note the Cauchy integration is $$ f'(\zeta)=\frac{1}{2\pi i}\oint_C\frac{f(z)}{(z-\zeta)^2}dz $$ where $f(z)$ is analytic in $C$ which is a simple closed curve. Now $C$ is the four sides of a square and $z=i$ is inside $C$. Hence $$\oint_C \frac{z^2+z+1}{(z-i)^2}dz=2\pi i (z^2+z+1)'|_{z=i}=2\pi (2i+1)=2\pi+4\pi i. $$ Here