Theorem (Argument Principle). Suppose $f$ is meromorphic on an open region $R$ enclosed by a contour $C$. Then $\displaystyle \frac{1}{2\pi i} \int_C \frac{f'(z)}{f(z)} dz = N – M$, where $N$ is the number of zeroes (with multiplicity) enclosed by $C$ and $M$ is the number of poles (with multiplicity) enclosed by $C$.
Proof. At any point $z$ where $f(z)$ is holomorphic and nonzero, then the integrand is also holomorphic. So the only possible poles of the integrand occur at the zeros and the poles of $f$.
Let’s look at the residues of the zeroes first. Around any zero $z_0 \in R$ of multiplicity $m$, we can write $f(z) =(z – z_0)^mg(z)$, where $g$ is holomorphic and nonzero on some closed disk $E$ centered on $z_0$. Then $f'(z) = m(z – z_0)^{m-1}g(z) + (z – z_0)^mg'(z)$ and so $\frac{f'(z)}{f(z)} = \frac{m}{z – z_0} + \frac{g'(z)}{g(z)}$. The second term of this sum is holomorphic on $E$ and so the requisite integral around $E$ just equals $m$.
Next, let’s suppose $z_0$ is a pole of $f$ of order $m$. We can then write $f(z) = (z – z_0)^{-m}g(z)$ on some closed disk $E$ as before. Differentiating, we now get
$$
f'(z) = -m(z – z_0)^{-m-1}g(z) + (z – z_0)^{-m}g'(z)
$$
and so $\frac{f'(z)}{f(z)} = \frac{-m}{z – z_0} + \frac{g'(z)}{g(z)}$. This makes the integral around $E$ equal $-m$ (as $g$ is again holomorphic and nonzero).
The Residue Theorem then gives us the result. $\blacksquare$
Theorem (Rouché). Suppose $f$ is holomorphic on some compact region $R$ and $|g| < |f|$. Then $f + g$ has the same number of zeros as $f$ inside $R$.
Proof. Let $h_a(z) = \frac{f’ + g’}{f + ag}$ for $a \in [0, 1]$. It can be shown through simple algebra that $h_x(z) – h_y(z) = (y- x)g\frac{f’+ g’}{(f + xg)(f + yg)}$. Our assumptions about the behavior of $f$ and $g$ on the boundary ensure that the latter fraction can be bounded in magnitude by some constant $M$ uniformly in $z$. Hence we have $|\int_{\partial R} h_x – h_y dz| \leq |x – y|M l(\partial R)$ which implies continuity of $H(x) = \int_{\partial R} h_x dz$ as a function of $x$. But $H(x)$ is integer-valued, so it’s constant, so it equals $H(0)$, which is the number of zeros of $f$ in $R$.