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??
 A: Using the Residue at Infinity
You need not evaluate the residues at $-1$ and $1$.  Rather, note that the Residue at $\infty$ is given by
$$\begin{align}
\text{Res}\left(\frac{z}{(z+1)(z-1)^2},z=\infty\right)&=\text{Res}\left(-\frac1{z^2}\frac{1/z}{(1/z+1)(1/z-1)^2},z=0\right)\\\\
&=-\text{Res}\left(\frac{1}{(z+1)(z-1)^2},z=0\right)\\\\
&=0\tag1
\end{align}$$
Therefore, we find using $(1)$ that
$$\begin{align}
\oint_{C}\frac{z}{(z+1)(z-1)^2}\,dz&=-2\pi i \text{Res}\left(\frac{z}{(z+1)(z-1)^2},z=\infty\right)\\\\
&=0
\end{align}$$
And we are done!


Exploiting Cauchy's Integral Theorem
Alternatively, we note that the the integrand is analytic in the region $|z|>1$.  Therefore, any integral over a contour that contains both poles at $\pm1$ will have the same value as any other such integral.  Therefore, we assert that
$$\oint_{C}\frac{z}{(z+1)(z-1)^2}\,dz=\oint_{|z|=R>1}\frac{z}{(z+1)(z-1)^2}\,dz \tag2$$
Now, letting $R\to \infty$, the right-hand side approaches $0$.  And we conclude that the value of the integral of interest is also $0$, as expected!
A: Instead of using the Cauchy integral formula, you can just use the fact that $\frac{1}{(z-1)^2}$ has an antiderivative, namely $\frac{-1}{z-1}$.  So, its integral over any closed contour (that does not pass through the singularity at $1$) is $0$.
A: 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$
A: Using Residue integral (Thanks to @J.G)
$\int_{C}^{} \frac{1}{(z-1)^2}dz$
Function $\frac{1}{(z-1)^2}$ has 2nd order pole in z=1 so, From the Residue formula ${Res} (f,c)={\frac {1}{(n-1)!}}\lim _{z\to c}{\frac {d^{n-1}}{dz^{n-1}}}\left((z-c)^{n}f(z)\right).$
Res($\frac{1}{(z-1)^2}$,2) = $\lim_{z\to1}\frac{d}{dz}1$=o
.
finally $\int_{C}^{} \frac{1}{(z-1)^2}dz$ =0
