Find the primitive of a particular complex function Let $D_1=\{|z-a|<r_1\}$,$D_2=\{|z-b|<r_2\}$,$D_3=\{|z-c|<r_3\}$ such that $D_1,D_2,D_3$ are disjoint.Let $f$ be an analytic function in $\mathbb{C}\diagdown(D_1\cup D_2\cup D_3)$.Prove that for some $A,B,C$,$f-\frac{A}{z-a}-\frac{B}{z-b}-\frac{C}{z-c}$ has a primitive in $\mathbb{C}\diagdown(D_1\cup D_2\cup D_3)$.
Instinctively I want find the explicit form of the primitive,the primitive of $f$ is the easy part,and I suppose the primitive of the fractions should take the logarithm form.But the it seems that $\mathbb{C}\diagdown(D_1\cup D_2\cup D_3)$ cannot be a analytic branch of logarithm.And I was stuck here.
**Update**Thanks to the hint by @Daniel Fischer,the statement that the primitive of $f$ is the easy part is not correct,since I just realize that $f$ is not analytic on the whole plane,then the integral over the closed loop in the domain is not necessarily zero.That been said,I think the key is to find a function of which the integral over closed loop is zero,then by the prove of Morera's theorem we can prove it's the primitive.
Any kind of help will be appreciated.
 A: Hint: $g \in \mathscr{O}(U)$ has a primitive if and only if
$$\int_\gamma g(z)\,dz = 0$$
for all closed (piecewise continuously differentiable) paths in $U$.
Setting
$$A = \frac{1}{2\pi i}\int\limits_{\lvert z-a\rvert = r_1+\varepsilon} f(z)\,dz,$$
where $\varepsilon > 0$ is small enough that the contour avoids the disks $D_2$ and $D_3$, and analogously $B,C$, we find that
$$\int_{\gamma} f(z) - \frac{A}{z-a} - \frac{B}{z-b} - \frac{C}{z-c}\,dz = 0\tag{1}$$
when $\gamma$ is one of the circles used above. Since every closed path in $U := \mathbb{C}\setminus (D_1\cup D_2\cup D_3)$ is homologous to a linear combination of these circles, Cauchy's integral theorem asserts that $(1)$ holds for all closed paths in $U$. Fixing an arbitrary $z_0\in U$,
$$F(z) = \int_{\gamma_z} f(\zeta)- \frac{A}{\zeta-a} - \frac{B}{\zeta-b}-\frac{C}{\zeta-c}\,d\zeta,$$
where $\gamma_z$ is an arbitrary path from $z_0$ to $z$ in $U$, is well-defined, and of course $F'(z) = f(z) - \frac{A}{z-a} - \frac{B}{z-b} - \frac{C}{z-c}$.
