Cauchy's argument principle, trouble working simple contour integral 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.)
 A: To expand briefly on the above answers, your final integrand involves a complex variable. As such, your "independent variable" has both real and imaginary parts. If you consider it carefully, this is the problem, and can be fixed by separating the integral into its real and imaginary parts. Then, you will have two have two "real" integrals,  one of which is multiplied by i. This integral should now evaluate to the desired answer (the integral not multiplied by i will evaluate to zero - why?). Good luck.
A: The problem in your calculation is that you want to use that your "integrand" is the derivative of $\log(e^{2i\theta}-1/4)$ right? Well Cauchy formulas tells you exactly that you cannot apply (ane more importantly, how to "fix" it) the fundamental theorem of calculus to functions that are not defined everywhere. The logarithm is tipically not defined in zero. 
I mean, suppose you want to integrate $1/z=(\log(z))'$. Then you get $\log(1)-\log(1)=0$ while Cauchy integrals tell you that this number is not zero.
A: Use the residue formula. The primitive of ${f'\over f}$ is problematic (why?).
