A Question about Rational Functions I have been searching for a proof for this, but I have been unable to find one (most either state it as a fact, or don't reference it at all).
I would like to prove the sufficient condition for:
Let $f(z) = (z-z_1)^{m_1}(z-z_2)^{m_2}\cdots (z-z_n)^{m_n}$ be a rational function and let $D$ be a domain that does not contain any $z_k$ $\left(k\in \{1,2,...,n\}\right)$. For an integer $p\geq 2$, there is a branch of $\left(f(z)\right)^{\frac{1}{p}}$ if and only if $p$ divides
$$\sum_{k=1}^n m_k \ n(\gamma, z_k)$$
for every closed piecewise smooth path $\gamma$ in $D$.
I know there is a theorem about this involving $n(f\circ \gamma, 0)$, but we haven't proved that yet either (although the proof of this would help if it were available).
 A: If $f$ has a logarithm on $D$, call it $g$, then we can define a $p^{\text{th}}$ root of $f$ via
$$h(z) = \exp \biggl(\frac{g(z)}{p}\biggr).\tag{1}$$
Of course in general $f$ won't have a logarithm on $D$, but we can use $(1)$ to construct a $p^{\text{th}}$ root of $f$ nevertheless. By the fundamental theorem of calculus, for an arbitrary $\zeta \in D$ - the case $D = \varnothing$ is trivial if not forbidden - we have
$$g(z) = g(\zeta) + \int_{\zeta}^z g'(w)\,dw,$$
where the integration is over an arbitrary (piecewise smooth) path from $\zeta$ to $z$ in $D$. Since $g$ is (hypothetically) a logarithm of $f$, we have $g'(w) = \frac{f'(w)}{f(w)}$, and thus we can rewrite $(1)$ as
$$h(z) = C\cdot \exp \Biggl(\frac{1}{p} \int_{\zeta}^z \frac{f'(w)}{f(w)}\,dw\Biggr),\tag{2}$$
where $C = e^{g(\zeta)}$ is a $p^{\text{th}}$ root of $f(\zeta)$.
The formula $(2)$ does not mention the hypothetical logarithm $g$ any more, so if we can show that $(2)$ gives us a well-defined function, i.e. that
$$\exp \Biggl(\frac{1}{p}\int_{\zeta}^z \frac{f'(w)}{f(w)}\,dw\Biggr)\tag{$\ast$}$$
does not depend on the choice of path from $\zeta$ to $z$ in $D$ over which we integrate, then $(2)$ will define a $p^{\text{th}}$ root of $f$ on $D$ if $C$ is chosen so that $C^p = f(\zeta)$. That is then verified by differentiating:
\begin{align}
\frac{d}{dz}\bigl(h(z)^p\cdot f(z)^{-1}\bigr) &= C^p\frac{d}{dz}\Biggl(\exp \biggl(\int_{\zeta}^z \frac{f'(w)}{f(w)}\,dw\biggr)\cdot f(z)^{-1}\Biggr)\\
&= C^p \exp\biggl(\int_{\zeta}^z \frac{f'(w)}{f(w)}\,dw\biggr) \frac{f'(z)}{f(z)}\cdot f(z)^{-1}\\
&\qquad + C^p\exp\biggl(\int_{\zeta}^z \frac{f'(w)}{f(w)}\,dw\biggr)\cdot\bigl(-f(z)^{-2}f'(z)\bigr)\\
&= 0,
\end{align}
and since $h(\zeta)^p\cdot f(\zeta)^{-1} = 1$ it follows that indeed $h(z)^p = f(z)$ on $D$.
Thus it remains to show that $(\ast)$ is a well-defined holomorphic function on $D$. If $\gamma_1$ and $\gamma_2$ are two piecewise smooth paths from $\zeta$ to $z$ in $D$, then the composition $\gamma := \gamma_1\cdot \gamma_2^{-1}$ is a piecewise smooth closed path in $D$, and hence by assumption
\begin{align}
\frac{1}{p}\int_{\gamma_1} \frac{f'(w)}{f(w)}\,dw - \frac{1}{p}\int_{\gamma_2} \frac{f'(w)}{f(w)}\,dw
&= \frac{1}{p}\int_{\gamma} \frac{f'(w)}{f(w)}\,dw\\
&= \frac{1}{p}\int_{\gamma} \sum_{k = 1}^n \frac{m_k}{w - z_k}\,dw\\
&= \frac{1}{p}\sum_{k = 1}^n m_k \int_{\gamma} \frac{dw}{w-z_k} \\
&= \frac{2\pi i}{p} \sum_{k = 1}^n m_k\, n(\gamma,z_k)\\
&\in 2\pi i \mathbb{Z},
\end{align}
so
$$\exp \Biggl(\frac{1}{p}\int_{\gamma_1} \frac{f'(w)}{f(w)}\,dw\Biggr) = \exp \Biggl(\frac{1}{p}\int_{\gamma_2} \frac{f'(w)}{f(w)}\,dw\Biggr),$$
and indeed $(\ast)$ is independent of the choice of path from $\zeta$ to $z$. On a small disk $D_r(\zeta_0) \subset D$ we can choose a composition of a fixed path from $\zeta$ to $\zeta_0$ with the straight line segment from $\zeta_0$ to $z$ as our paths, and a standard argument shows that $(\ast)$ is thus holomorphic on $D_r(\zeta_0)$. Since $\zeta_0 \in D$ was arbitrary in the last argument, $(\ast)$ is holomorphic on $D$ and therefore $(2)$ gives us a branch of the $p^{\text{th}}$ root of $f$.
Conversely, if a branch $h$ of the $p^{\text{th}}$ root of $f$ exists on $D$, and $\gamma$ is a piecewise smooth closed path in $D$, then
\begin{align}
\sum_{k = 1}^n m_k\, n(\gamma,z_k) &= \frac{1}{2\pi i}\int_{\gamma} \frac{f'(w)}{f(w)}\,dw \\
&= \frac{p}{2\pi i} \int_{\gamma} \frac{h'(w)}{h(w)}\,dw\\
&= p\, n(h\circ\gamma,0)\\
&\in p\mathbb{Z}.
\end{align}
