Find the integration of complex function $z^2 f'(z)/f(z)$ over the circle $|z|=1$ and $|z|=2$. I'm struggling to find this integral $\oint \frac{z^2\cdot f'(z)}{f(z)}dz$ over $|z|=1$ and $|z|=2$, where $f(z)=z^3-z+1$.
I could conclude using Rouche's theorem that all zeroes of $f(z)$ lie inside $|z|=2$. But I didn't found this information helpful for this problem. Also I know the Argument Principle which gives the information about the integral of  $\frac{f'(z)}{f(z)}$ for meromorphic function $f$. Is anyone of these helpful here ? If not, please suggest some hint.
 A: The generalized argument principle states that
$$
\frac{1}{2 \pi i}\oint_{|z|=r} \frac{z^2 f'(z)}{f(z)}\, dz =  \sum \{ z^2 \mid f(z) = 0, |z| < r \} \, .
$$
For $r=2$ this can be computed without knowing the exact values of the roots: You already figured out that all roots $z_1, z_2, z_3$ of $f(z) = 0$ lie in the disk $|z| < 2$, therefore we get, using Vieta's formulas:
$$
\frac{1}{2 \pi i}\oint_{|z|=2} \frac{z^2f'(z)}{f(z)}\, dz = z_1^2 + z_2^2 + z_2^3 \\
= (z_1+z_2+z_3)^2 - 2(z_1z_2 + z_1z_3 + z_2 z_3) \\
= 0^2 -2 (-1) = 2 \, .
$$
Now consider the case $r=1$: It is not difficult to see that $f(z)$ has exactly one real root $z_1$, and that is in the range $[-2, -1]$. It follows that $z_2, z_3$ are non-real and complex conjugates of each other. In particular $z_1 z_2 z_3 = -1$ implies that $|z_2| = |z_2| < 1$.
Therefore
$$
\frac{1}{2 \pi i}\oint_{|z|=1} \frac{z^2f'(z)}{f(z)}\, dz =  z_2^2 + z_2^3 = 2 - z_1^2 \, .
$$
Using Cardano's formula one can determine
$$
 z_1 = - \sqrt[3]{\frac 12 + \sqrt{\frac 14 - \frac{1}{27}}}
-  \sqrt[3]{\frac 12 - \sqrt{\frac 14 - \frac{1}{27}}}
\approx -1.3247 \, .
$$
A: Let $D$ be a bounded Jordan domain, $a_1, ..., a_n$ points in $D$, and $f$ a holomorphic function in $\overline{D} \backslash \{ a_1, ..., a_n \}$ and $g$ holomorphic in $\overline{D}$. Assume that $f$ does not vanish at any point of $\partial D$ and let $b_1, ..., b_k$ denote the zeroes of $f$ in $D$. Define $K_{\ell}$ to be the order of $b_{\ell}$ for $\ell=1, ..., k$. Then $$\int_{\partial D} g \frac{f'}{f} dz = 2\pi i \left( \sum_{\ell=1}^k K_{\ell} g(b_{\ell}) - \sum_{j=1}^n N_j g(a_j) \right).$$
