Application of winding number and the roots of complex polynomial from a non simple closed cuvre There is a formula for the simple closed curve $\gamma(t)$ and complex polynomial $p(z)$. The winding number of $p(\gamma)$ around (0,0) is the sum of roots counting multiplicity of $p(z)$ within the closed curve $\gamma(t)$. This is just a direct result from the argument principle.
Now I want to ask what if the closed curve $\gamma(t)$ is NOT simple anymore which means it may have self-intersections. What will the winding number $w(p(\gamma),(0,0))$ be? I think it should be still related to the roots of $p(z)$
 A: The winding number of $p \circ \gamma $ with respect to $0$ is
$$
 I(p \circ \gamma,0) = \frac{1}{2\pi i}\int_{p \circ \gamma} \frac{dw}{w} 
= \frac{1}{2\pi i}\int_\gamma \frac{p'(z)}{p(z)} \, dz
$$
and that can be computed with the Residue theorem. If $a_1, \ldots, a_m$ are the distinct roots of $p$ with multiplicities $k_1, \ldots ,k_m$, then
$$
\frac{1}{2\pi i}\int_\gamma \frac{p'(z)}{p(z)} \, dz
 = \sum_{j=1}^m I(\gamma, a_j) \operatorname{Res}(\frac{p'}{p}, a_j)
 \, .
$$
It is relatively easy to compute that the residue of $p'/p$ at a $k$-fold zero of $p$ is $k$, so that
$$
I(p \circ \gamma,0)= \sum_{j=1}^m I(\gamma, a_j) k_j \, .
$$
This is the general formula.
For a simple positively oriented closed curve $\gamma$ the winding numbers $I(\gamma, a_j)$ are either zero or one, and the sum reduces to
$$
 I(p \circ \gamma,0) = \sum_{a_j \text{ inside } \gamma}  k_j
$$
A: I guess the answer is still right, if we replace the concept "not simple closed curve" with "the boundary $\partial D$ for an open set $\mathcal{D}$". The advantage of the latter is to avoid the choice for the direction of the "closed curve" in the cases with self-intersections. We only need to clarify the interior of the boundary $\partial D$ is just the open set $\mathcal{D}$.
Then the definition of winding number is that, $w=\frac{1}{2\pi i}\int_{\partial D}\frac{f^{\prime}(z)}{f(z)}dz=N_{zeros}-P_{poles}$, which can be easily obtained by Residue theorem in complex analysis. Here $N_{zeros}$ and $P_{poles}$ represent the number of zeros and poles inside the open set $\mathcal{D}$.
