We are given:
\[
f(z) = \frac{z^2}{(z - 1)^2(z + 2)}
\]
Singularities of \( f(z) \) are at \( z = 1 \) (pole of order 2) and \( z = -2 \) (simple pole).
Both singularities lie inside the circle \( |z| = 3 \).
We apply the Cauchy Residue Theorem:
\[
\oint_C f(z)\, dz = 2\pi i \cdot \left( \text{Res}_{z=1}(f) + \text{Res}_{z=-2}(f) \right)
\]
First, compute \( \text{Res}_{z = 1}(f) \). Since it is a second order pole:
Let \( g(z) = \frac{z^2}{z + 2} \), then
\[
\text{Res}_{z=1}(f) = \frac{d}{dz} \left[ \frac{z^2}{z + 2} \right]_{z = 1}
= \left( \frac{2z(z + 2) - z^2}{(z + 2)^2} \right)_{z=1}
= \frac{2(1)(3) - 1^2}{(3)^2} = \frac{6 - 1}{9} = \frac{5}{9}
\]
Next, compute \( \text{Res}_{z = -2}(f) \). This is a simple pole:
\[
\text{Res}_{z=-2}(f) = \frac{(-2)^2}{(-2 - 1)^2 \cdot (-2 + 2)} = \frac{4}{9 \cdot 0} = \text{undefined}
\]
Oops! That suggests \( z = -2 \) is a removable singularity, but it’s actually a pole. Let’s revisit:
Wait, this was incorrect reasoning. Actually:
\[
\text{Res}_{z = -2}(f) = \lim_{z \to -2} \frac{z^2}{(z - 1)^2} = \frac{4}{9}
\]
So total residue sum = \( \frac{5}{9} + \frac{4}{9} = 1 \)
Thus,
\[
\oint_C f(z)\, dz = 2\pi i \cdot 1 = 2\pi i
\]