I'm trying to teach myself Cauchy's argument principle by doing a simple example, but apparently I'm missing something, because every time I try to do the contour integral I get 0.
Cauchy's argument principle says that $$ N-P = \frac{1}{2\pi i}\int_C \!\frac{f'(z)\, \mathrm{d}z}{f(z)}$$ where $C$ is a simple closed contour, $N$ is the number of zeros inside the contour, and $P$ is the number of poles inside the contour.
I figured I would start with a trivial example: $f(z) = z^2\!-\!\frac{1}{4}$ and the unit circle. $f(z)$ has zeros at $z=\pm\frac{1}{2}$ and no poles. $f'(z) = 2 z \, \mathrm{d}z$, so I am trying to evaluate $$ \frac{1}{2\pi i} \int_C \frac{2 z \, \mathrm{d} z}{z^2\!-\!\frac{1}{4}}. $$ Let $z = e^{i\theta}$, $\mathrm{d}z = ie^{i\theta}\mathrm{d}\theta$ and we get $$ \frac{1}{\pi i} \int_{\theta=0}^{2\pi} \frac{ ie^{2i\theta} \, \mathrm{d} \theta}{e^{2i\theta}\!-\!\frac{1}{4}} = \frac{1}{\pi}(-\frac{i}{2}\log(e^{2i\theta}-\frac{1}{4}))\Big|_0^{2\pi}.$$ But $e^{4i\pi} = e^0=1$, so the result is $0$, (whereas I am expecting $2$, the number of roots inside the circle.)
Use the residue formula. The primitive of ${f'\over f}$ is problematic (why?).