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.
No, it's not just for boundaries of circles. Rectangles are fine here. On the other hand, the best approach here is perhaps to use the residue theorem. It tells you that your integral is equal to$$2\pi i\left(\operatorname{res}_{z=-1}\left(\frac z{z^3+1}\right)+\operatorname{res}_{z=\omega}\left(\frac z{z^3+1}\right)+\operatorname{res}_{z=\omega^\star}\left(\frac z{z^3+1}\right)\right),$$where $\omega$ and $\omega^\star$ are the cube roots of $-1$ distinct from $-1$.
You can also use partial fraction decomposition, write$$\frac z{z^3-1}=\frac A{z+1}+\frac B{z-\omega}+\frac C{z-\omega^\star},$$for an appropriate choice of $A$, $B$, and $C$, and apply three time Cauchy's integral formula.