the logarithmic derivative
When you differentiate the logarithm of a function, the chain rule hands you a tidy fraction: the derivative of log f(z) is f'(z) / f(z). That ratio, f'/f, is the logarithmic derivative. It is the rate at which the function is changing, measured relative to its own current size — the same idea as a percentage growth rate rather than an absolute one. It is the central character in the argument principle.
Two features make f'/f the right tool for counting. First, it turns products into sums: the logarithmic derivative of f g is f'/f plus g'/g, because log(f g) = log f + log g. Second, and decisively, it reads off zeros and poles as simple poles with integer residues. If f has a zero of order m at z_0, write f(z) = (z - z_0)^m h(z) with h(z_0) not zero; then f'/f = m / (z - z_0) plus h'/h, and the second piece is holomorphic at z_0, so f'/f has a simple pole there with residue exactly m. The very same calculation with a pole of order k gives residue -k. The order of the zero or pole becomes a residue you can integrate.
This is why the argument principle works: integrating f'/f around a contour and dividing by 2 pi i sums these integer residues, giving (zeros) minus (poles). The logarithmic derivative also explains the link to the argument geometrically — writing f = |f| e^(i arg f), one finds f'/f dz = d(log|f|) + i d(arg f), so the imaginary part of the integral tracks the net change in arg f. The one trap: log f itself is multivalued (arg f is only defined up to 2 pi), but f'/f is perfectly single-valued, which is exactly why we work with the derivative rather than the logarithm.
For f(z) = (z - 1)^2 (z - 3), the logarithmic derivative is f'/f = 2 / (z - 1) + 1 / (z - 3). A contour enclosing both points gives integral / (2 pi i) = 2 + 1 = 3 zeros, with the double root at z = 1 correctly counted twice.
Each factor contributes a simple pole of f'/f whose residue is that factor's multiplicity.
Despite the name there is no actual logarithm to choose — f'/f is single-valued and well defined wherever f is nonzero and holomorphic, even though log f is multivalued.