# two disjoint compact sets, holomorphic function there exists a decomposition $f=f_1+f_2$

Let $$D_1$$ and $$D_2$$ be two compact sets in $$\Bbb C$$, $$D_1\cap D_2=\emptyset$$, and $$f\colon \Bbb C\setminus(D_1\cup D_2)\to\Bbb C$$ be a holomorphic function. Show that there exist two holomorphic functions $$f_1\colon \Bbb C\setminus D_1\to\Bbb C$$ and $$f_2\colon \Bbb C\setminus D_2\to\Bbb C$$ such that $$f=f_1+f_2$$ for all $$z\in C\setminus(D_1\cup D_2)$$.

I think about Cauchy integral formula. A similar question : Lemma 1 Math 246A, Notes 4: singularities of holomorphic functions

For $$r$$ small take some closed loop $$C_r$$ enclosing $$D_1$$ at a distance $$< r$$ and let $$g(z)=\frac1{2i\pi} \left[\;\,\int\limits_{|z|=1/r} \frac{f(s)}{s-z}ds -\int\limits_{C_r} \frac{f(s)}{s-z}ds\right]$$ $$g$$ is analytic in the region between $$C_r$$ and $$|z|=1/r$$ and it doesn't depend on $$r$$, thus it is analytic on $$\Bbb{C}-D_1$$. $$f(z)=g(z)+(f(z)-g(z))$$ Do you see why $$f(z)-g(z)$$ is analytic on $$\Bbb{C}-D_2$$ ?