Showing there exists a function $h$ such that $h'(z) = f(z)$, when $f$ two poles with residues that sum to 0 I'm reviewing some complex analysis for finals season, and I ran into this problem in a chapter about the residue theorem. 
Let $f$ be analytic on $\mathbb{C}$ except for poles at 1 and -1. Assume further that $Res(f; 1) = -Res(f;-1)$. Then show there exists an analytic function $h$ on $\mathbb{C}\setminus [-1,1]$ such that $h'(z) = f(z)$.
I can't seem to make any headway. My first thought was to have $h$ be the integral of $f$ along some closed curve. But as the residues of $f$ sum to 0, that will always be 0, which isn't very helpful.
 A: Let's glibly try to define
$$h(z) = \int_a^z f(w) \, dw,$$
where $a$ is some fixed point in $\mathbf{C} \setminus [-1,1]$. Clearly if we can do this, $h'(z)=f(z)$. The key question is, is this well-defined?
It is path-independent provided we can deform one path into another, by Cauchy's Theorem. What about if we take two paths, $\gamma, \gamma'$ whose difference (go along $\gamma$, then back along $\gamma'$) encloses $[-1,1]$ (i.e., one path is the other plus a loop about the excluded interval)? Then
$$ \int_{\gamma} f(w) \, dw - \int_{\gamma'} f(w) \, dw = \int_{\Gamma} f(w) \, dw, $$
$\Gamma$ a closed loop around $[-1,1]$. But the Residue Theorem implies this last integral is zero, because the residues cancel.
Since any two paths in $\mathbf{C} \setminus [-1,1]$ differ only by an integer number of loops around the excluded interval (the key phrase here being winding number), their difference is a sum of an integer number of traversals of $\Gamma$. But the integral around $\Gamma$ is zero, so the integral is always the same, no matter what path we use. Hence $h$ is well-defined by the integral.
