Determine the line/contour integral of:
$$\int_{\gamma}\frac {z}{z^3+1}dz$$ where $\gamma$ is the boundary of a rectangle defined for $0\leq x\leq 2$ and $-2\leq y\leq 2$.
I am almost certain we have to apply Cauchy's Integral Theorem, that is, if $D\subset \mathbb{C}$ is open and $f:D\rightarrow \mathbb{C}$ is holomorphic, then for $z_0\in D$ and $r>0$ with $B_r[z_0]\subset D$, we have:
$$f(z)=\frac {1}{2\pi i}\int_{\partial B_r(z_0)}\frac {f(\zeta)}{\zeta-z}d\zeta$$
But doesn't this only apply to the boundary of circles? How can we apply this for the boundary of a rectangle? I am quite new learning this concept and would appreciate any help.