Related to this question I asked previously, I would like to obtain an expansion of a meromorphic function in terms of its poles plus a holomorphic "remainder".
For simple poles, assuming $f(w)$ has no pole at $z$, one has that
$$ \int_{d\Omega} \frac{f(w)}{z-w} dw = -f(z)+\sum_k \frac{a_k^{-1}}{z-z_k} $$
where $z_k, a_k^{-1}$ are all the poles and associated residues of $f$ in $\Omega$. Then
$$ f(z) = \left(\sum_k \frac{a_k^{-1}}{z-z_k}\right)+\int_{d\Omega} \frac{f(w)}{w-z} dw \, . $$
The intergral is a function of $z$ and is the desired remainder.
How can this be generalized to second-order poles, producing an expansion like
$$ f(z)=h(z)+\sum_k \left( \frac{a_k^{-1}}{z-z_k} + \frac{a_k^{-2}}{(z-z_k)^2} \right) $$
where $h$ is holomorphic? I have not been able to think of a solution. An integral like the one used for simple poles won't pick out the $a_k^{-2}$ terms. All I could think of was an integrand with something like $\frac{(w-z_k)f(w)}{(w-z)^2}$ to reduce the pole to first order so it would be caught as a residue, but then I would have undesired residues OTF $\frac{(z_m-z_k)a_m^{-1}}{(z-z_m)^2}$ for $m \ne k$.