<s>[INST] Complex contour integral using Cauchy integral formula I am trying to get integral in contour  ​​​​​​​$C=\left \{ 3\cos(t)+2i\sin(t) : 0\leq t\leq 2\pi \right \}$
$$\oint_{C} \frac{z}{(z+1)(z-1)^2}dz$$
What I tried was using partial fractions and integrate them separately
$$\oint_{C} \frac{z}{(z+1)(z-1)^2}dz =\oint_{C} \frac{1}{4(z-1)}dz +\oint_{C} \frac{1}{-4(z+1)}dz+\oint_{C} \frac{1}{2(z-1)^2}dz$$
For $\int_{C}^{} \frac{1}{4(z+1)}dz$ +$\int_{C}^{} \frac{1}{-4(z-1)}dz$, using Cauchy's integral fomula they are zero.
For $\int_{C}^{} \frac{1}{2(z-1)^2}dz$, I tried to use Cauchy's integral formula like:
$$\frac{1}{2}\int_{C}^{} \frac{\frac{1}{(z-1)}}{(z-1)}dz$$
but can't solve it... What am I missing??
 [/INST] The contour is simply an ellipse $\frac{x^2}{3^2}+\frac{y^2}{2^2}=1$ that encloses both the singularities viz. $z=-1$ and $z=1$ of $f(z)$.
Use deformation principle to see
$\oint_C f(z)dz=\oint_{C_1}\frac{z/(z+1)}{(z-1)^2}dz+\oint_{C_2}\frac{z/(z-1)^2}{(z+1)}dz$
where $C_1$ and $C_2$ are circles enclosing the singularities $z=1$ and $z=-1$ respectively.
$\oint_C f(z)dz=2\pi i\left [\frac{d}{dz}\left (\frac{z}{z+1} \right ) \right ]_{z=1}+2\pi i\left [ \frac{z}{(z-1)^2} \right ]_{z=-1}=2\pi i\times (-1/4)+2\pi i\times (1/4)=0$
</s>