Argument Principle -Meaning of Derivative of Complex Logarithm Intuitively in the argument principle, why does the integral of the logarithmic derivative of a meromorphic function over a closed curve give the number of zeros minus the number of poles? 
My guess is that by writing
$$\int _{ \gamma} \frac{d}{dz} \ln[f(z)]dz = \int _{ \gamma} \frac{d}{dz} \ln ( r(z)e^{i\theta (z)} ) dz =\int _{ \gamma} \frac{d}{dz} \ln(r(z)) dz + i \int _{ \gamma} \frac{d}{dz} \theta (z) dz$$
we see $\int _{ \gamma} \frac{d}{dz} \ln(r(z)) dz = 0$ because $f$ has no zero's or poles on $\gamma$ so the total change of $r(z)$ is zero.
Hence making sense of $ i \int _{ \gamma} \frac{d}{dz} \theta (z) dz$ is all that's left, but I can't see why the sum of the changes in the argument around a contour containing zero's and poles should give the number of zero's minus the number of poles. At best, using the trick you use in proving Cauchy's integral formula I can see that:

so $ i \int _{ \gamma} \frac{d}{dz} \theta (z) dz$ can be interpreted as summing up these changes, but I don't see why the arrows have to be in the direction they are by looking at $ i \int _{ \gamma} \frac{d}{dz} \theta (z) dz$.
Is there a nice rock-solid way to make sense of $ i \int _{ \gamma} \frac{d}{dz} \theta (z) dz$ ?
 A: By Cauchy's integral theorem only the internal poles of $\frac{d}{dz} \ln[f(z)]$  contribute to the contour integral $\oint {\ln[f(z)] {dz}} $
Using $\frac{d}{dz} \ln[f(z)] = \frac {f'}f$, it is clear that the poles of $\frac{d}{dz} \ln[f(z)]$ are at the zeroes of $f$ and poles of $f'$, which is just the zeroes and poles of $f$ since $f$ is meromorphic and therefore has a continuous derivative except at its poles.
If $z_0$ is a first order zero of $f$, then close to $z_0$ $f(z)$ behaves like $f'(z_0)(z-z_0))$ and $\frac {f'}f$ behaves like $\frac 1 {(z-z_0)}$. So the contribution of the zero at $z_0$ is $\oint{\frac 1 {(z-z_0)}}{dz} = 2\pi i$ .
If $z_p$ is a first order pole of $f$, then $f$ behaves like $\frac \alpha {z-z_p}$ for some constant $\alpha$ and $\frac {f'}f$ behaves like $\frac {-1} {(z-z_0)}$. So the contribution of the zero at $z_0$ is $\oint{\frac {-1} {(z-z_0)}}{dz} = -2\pi i$ .
This is essentially why $\oint {\ln[f(z)] {dz}} = 2\pi i (N-P)$ .
It is possible that $f$ has higher order poles or zeroes.
At higher order zeroes of $f$, $f(z)$ behaves like $\frac{d^n f}{dz^n}|_{z_0} (z-z_0)^n$ and so $\frac {f'}f$ behaves like $n\frac 1 {(z-z_0)}$ and its contribution to $N$, the total number of zeroes is accordingly multiplied by $n$, the order of the zero.
Similarly, At higher order poles of $f$, $f(z)$ behaves like $\alpha (z-z_0)^{-n}$ and so $\frac {f'}f$ behaves like $\frac {-n} {(z-z_0)}$ and its contribution to $P$, the total number of poles is accordingly multiplied by $n$, the order of the pole.
