Simplify fraction I'm trying to calculate $$\oint_{\gamma}^{}\frac{1}{z^2(z-1)^3}dz$$ using the limit formula for higher order poles.
$\gamma$ is a circle centered at the origin with radius of 2.
I know that there are two poles. $0$ is a order 2 pole and $1$ is a order 3 pole. Lets focus on $0$.
To calculate the integral I need to calculate the $Res(f,0)$. I'm doing this:
$$\frac{1}{(2-1)!}\lim_{z \to 0}\left (\frac{(z^2)^2}{z^2(z-1)^3}\right )'$$
Using the quotient rule I'm getting 
$$\lim_{z \to 0}\frac{2z(z-1)^3-3(z-1)^2z^2}{(z-1)^6}$$
The problem is here. I'm getting an error doing the simplification. I'm doing $$\lim_{z \to 0}\frac{2z-3(z-1)^2z^2}{(z-1)^3}\Rightarrow\lim_{z \to 0}\frac{2z-3z^2}{(z-1)}$$ but I know that this is wrong. Can someone tell me how to simplify correctly?
And I believe I'm also making a mistake in the residue formula but don't know what
 A: In cases like this it is faster many times to go directly to Laurent expansions, remembering we're only interested in the term that gives us the residue, i.e. $\,a_{-1}\,$:
$$\frac1{z^2(z-1)^3}=-\frac1{z^2}\left(\frac1{(1-z)}\right)^3=-\frac1{z^2}\left(1+z+z^2+\ldots\right)^3=$$
$$=-\frac1{z^2}\left(1+3z+\ldots\right)=-\frac1{z^2}-\frac3z-\ldots$$
And the residue at zero is $\;-3\;$ .
Now
$$\frac1{z^2(z-1)^3}=\frac1{(z-1)^3}\left(\frac1{1+(z-1)}\right)^2=$$
$$=\frac1{(z-1)^3}\left(1-(z-1)+(z-1)^2-(z-1)^3+\ldots\right)^2=$$
$$=\frac1{(z-1)^3}\left(1-2(z-1)+3(z-1)^2+\ldots\right)=\ldots+\frac3{z-1}+\ldots$$
and the residue at one is $\;3\;$ .
A: The generic formula for $n$-th order poles is
$$ Res(f, z_{0}) = \frac{1}{(n-1)!} \lim_{z \to z_0} \frac{d^{n-1}}{dz^{n-1}} \left( (z-z_0)^n f(z) \right) $$
Which, in your case, gives
$$\begin{aligned}
   Res(f, 0) & = \lim_{z \to 0} \,\frac{d}{dz} \left( \frac{1}{(z-1)^3} \right) \\
             & = - \lim_{z\to 0} \, \frac{3(z-1)^2}{(z-1)^6} \\
             & = - 3
\end{aligned}$$
A: Your mistake in the residue formula is that the numerator should be simply $z^2$, not $(z^2)^2$: the idea is to get rid of the term corresponding to the pole.
About the banal mistake in simplifying the (wrong) fraction:
$$ \frac{2z(z-1)^3-3(z-1)^2z^2}{(z-1)^6} = \frac{2z(z-1)-3z^2}{(z-1)^4} = \frac{2z}{(z-1)^3}-\frac{3z^2}{(z-1)^4}$$
That said, Henry's correction and DonAntonio's alternative answer should let you finish on your own.
