# Residue Theorem with winding number

Let $\gamma$ be a closed path in a domain $D$ such that $W(\gamma,\zeta)=0$ (winding number) for all $\zeta\notin D$. Suppose that $f$ is analytic on $D$ except at isolated singularities $z_1,...z_m\in D\backslash \text{Im}(\gamma)$. Then, $\displaystyle \int_\gamma f(z) dz=2\pi i\sum W(\gamma,z_k)\text{Res}[f,z_k]$.

I am supposed to use the Laurent decomposition, at each $z_k$. I know I want to do something similar to the classic proof for the residue theorem for $\int_{\partial D} f$ and find a sufficiently small circle $\gamma_k$ around each singularity and then use the Laurent decomposition to end up with something like

$\displaystyle\int_\gamma f \ dz=\sum_{k=1}^m \left(\int_\gamma\sum_{-\infty}^{-1} a_{k_n}(z-z_k)^n\right)\int_{\gamma_k} f\ dz$

where $\sum_{-\infty}^\infty a_{k_n}(z-z_k)^n$ is the Laurent series of $f$ at $z_k$. I can see what to do given this equality; however, I can't see how to get to this equality. Any guidance would be greatly appreciated.

Break up each small circle $\gamma_k$ in some points and connect them to each other or to a point in the outer loop $\gamma$ in order to get paths (using both the inner and the outer circles) which don't surround any singularities. This will lead to $$\int_\gamma f\,dz=\sum_k \left( W(\gamma,z_k)\, \int_{\gamma_k}f\,dz\right)$$ if $\gamma_k$ is assumed to surround $z_k$ once, in positive direction (i.e. $W(\gamma_k,z_k)=1$).
If $\ f(z)=\sum_{n=-\infty}^{+\infty} a_{k,n}(z-z_k)^n$ then ${\rm Res}_{z_k}(f)=a_{k,-1}$ and this is basically because $\oint \frac1zdz=2\pi i$ around $0$, but all other powers of $z$ have a primitive function ($\frac{z^{n+1}}{n+1}$) which have unique values, as opposed to $\log(z)$, so that $\oint z^n\,dz=0$ if $n\ne -1$.