<s>[INST] Evaluate $\oint_C \frac{z}{(z+1)(z+3)} dz$ I want to evaluate $\oint \frac{z}{(z+1)(z+3)} dz$ where $C$ is the rectangle with the edges $2\pm i$, $-2\pm i$.

My attempt:
I used partial fraction expansion to express $\frac{z}{(z+1)(z+3)} = -\frac{1}{2(z+1)} +\frac{3}{2(z+3)}$.
Therefore,
\begin{align*}
\oint_C \frac{z}{(z+1)(z+3)} dz = \oint_C \frac{3}{2(z+3)} dz - \oint_C \frac{1}{2(z+1)} dz
\end{align*}
Since $-1$ is an interior point of the rectangle, it is easy to calculate this integral with Cauchy Integral Formula
\begin{align*}
- \oint_C \frac{1}{2(z+1)} dz = -2\pi i\cdot f(-1) = -\pi i
\end{align*}
where $f(z)= 1/2$ constant.
I cannot do the same for the other integral, since $-3$ is not an interior point.
So I think I can express
\begin{align*}
C = \begin{cases}
C_1 = \{z:z=x-i, x\in[-2,2]\}\\
C_2 = \{z:z=2+iy, y\in [-1,1]\}\\
C_3 =\{z:z=x+i, x\in[2,-2]\} \\
C_4 = \{z:z=-2+iy, y\in[1,-1]\}
\end{cases}
\end{align*}
Therefore,
\begin{align*}
\frac{3}{2} \oint_C \frac{1}{(z+3)} dz = \frac{3}{2} (\log(x-i+3)|_{-2}^2+i\log(2+iy+3)|_{-1}^1 + \log(x+i+3)|_2^{-2} + i\log(-2+iy+3)|_1^{-1})
\end{align*}
But I can't really simplify this. Does anyone know how to proceed?
 [/INST] Since $-3$ is not an interior point (as you wrote), the integral is $0$, by the Cauchy integral theorem.
</s>