the zero-counting integral
Imagine you want to know how many roots of an equation lie inside a given region but you have no formula for the roots. The zero-counting integral is the trick: you compute a single contour integral around the region, and out pops the count. It is the argument principle used as a concrete recipe rather than a statement of principle — a way to count zeros without ever solving for them.
When f is holomorphic (no poles) on and inside a simple closed contour gamma and has no zeros on gamma, the number of zeros inside, counted with multiplicity, is N = (1 / (2 pi i)) times the integral over gamma of f'(z) / f(z) dz. The method walked through: pick a contour enclosing the region of interest, form the integrand f'/f, integrate it once counterclockwise around the contour, divide by 2 pi i — the result is a nonnegative integer, the zero count. To pin down where a single zero is, you can also compute (1 / (2 pi i)) times the integral over gamma of z f'(z) / f(z) dz, which gives the sum of the zeros inside (weighted by multiplicity); with one zero inside, that sum is the zero itself.
This is the backbone of reliable numerical root-finding. Before chasing a root with Newton's method, an algorithm can use the integral to confirm a root is actually inside the chosen box, and how many — protecting against the iteration wandering off to a root somewhere else. It also proves existence cleanly: if the integral comes out positive, a zero must be in there, even if no closed-form root exists. The honest caveat is the same as for the argument principle: the contour must avoid all zeros, and if poles are present you are counting zeros minus poles, not zeros alone.
To check whether z^5 + z + 1 has any roots inside the unit disk, integrate f'/f around |z| = 1 and divide by 2 pi i; the result, an integer, tells you the count directly — no quintic formula required.
Counting roots in a region reduces to one boundary integral with integrand f'/f.
The bare counting integral assumes f has no poles inside; with poles it returns zeros minus poles. And the answer is a count, not the locations — you need the moment integral with z f'/f (or further work) to find where the zeros sit.