Let $p: \mathbb{C} \to \mathbb{C}$ be a polynomial, and $R > 0$ large enough, so that all roots of $p$ lie within $B_R(0)$ (the open ball with radius $R$ around $0$).
I now want to determine:
$$\int_{\partial B_R(0)} \frac{p'(z)}{p(z)} dz$$
So far, I thought of setting $\gamma: [0, 2π] \to \mathbb{C}, t \mapsto R e^{i t}$ (parameterizing the circle with radius $R$), and setting $p(z) = a_n z^n + ... + a_1 z + a_0$.
Now I guess, one could solve this integral "on foot", by substituting $p(z) = a_n z^n + ... + a_1 z + a_0$ and $p'(z) = n a_n z^{n-1} + ... + a_1$ into the formula, and calculating $\int_0^{2π} \frac{p'(\gamma(t))}{p(\gamma(t))} \dot{\gamma(t)}dt$, but that looks like it would become way too complicated. Is there an elegant way (using a theorem or so) of evaluating this integral?
A better approach is to start with the complete factorization of $p$: $$ p(z) = a_n(z-z_1)\cdots(z-z_n) \, . $$ Then $$ \frac{p'(z)}{p(z)} = \frac{1}{z-z_1} + \ldots + \frac{1}{z-z_n} $$ and each integral $$ \int_{\partial B_R(0)} \frac{dz}{z-z_j} $$ can easily be computed with the residue theorem.
Alternatively, you can argue that the value of the integral does not depend on $R$ (once that $R$ is so large that all roots of $p$ lie within $B_R(0)$). And for $ |z| \to \infty$, $$ \frac{p'(z)}{p(z)} = \frac {n}{z} + O(\frac{1}{z^2}) $$