How to do this contour integral in literature? I'm trying to figure out a loop integral in a paper
$$\int_{0}^{2 \pi} \frac{\mathrm{d} \phi}{(z-z')^{2}}=\frac{\pi}{z'^{2}}\left[2 \mathrm{H}(|z'|-|z|)-|z'| \delta(|z|-|z'|)\right].\tag{1}$$
Here, $z'$ is a constant complex number; $z=|z|e^{i\phi}$. Note that the integrated angle is the polar angle of $z$, so this integral depends on the length of $z$. H is the Heaviside step function.
When $|z|>|z'|$, there are two poles inside the loop ($z=0$ and $z=z'$); while if $|z|<|z'|$, there is only one pole ($z=0$). I figure out the first term in the RHS with residue theorem but I'm confused with the second one with the Dirac Delta function. The integral diverges when $|z|=|z'|$, but how could one know that it is the Delta function with associated factor $|z'|$?
The paper is https://arxiv.org/abs/astro-ph/9601039v2. The equation is Eq.13, with notations modified.
 A: Let $z\equiv re^{i\phi}$ and $z_0\equiv r_0e^{i\phi_0}$. Assume $r>0$ and $r_0>0$. Consider first the integral
$$\begin{align}I_1(r,z_0)
~:=~&{\rm PV} \int_0^{2\pi} \!\frac{\mathrm{d}\phi}{re^{i\phi}-z_0}\cr
~=~&{\rm PV}\oint_{|z|=r} \!\frac{\mathrm{d} z}{iz(z-z_0)}\cr
~=~&\frac{1}{iz_0}{\rm PV}\oint_{|z|=r} \!\mathrm{d}z \left(\frac{1}{z-z_0}-\frac{1}{z}\right)\cr
~=~&\frac{2\pi}{z_0} \left(H(r\!-\!r_0)-1\right)\cr
~=~&-\frac{2\pi}{z_0} H(r_0\!-\!r),\tag{A}
\end{align}$$
where $H(0)=\frac{1}{2}$. The result (A) can be seen as a distribution.
Next OP's integral can be found via Feynman's trick of differentiating under the integral sign:
$$\begin{align}I_2(r,z_0)
~=~& \int_0^{2\pi} \!\frac{\mathrm{d}\phi}{(re^{i\phi}-z_0)^2}\cr
~\stackrel{(A)}{=}~&e^{-i\phi_0}\frac{dI_1(r,z_0)}{dr_0}\cr
~\stackrel{(A)}{=}~&\frac{2\pi}{z_0^2} \left[ H(r_0\!-\!r)-r_0\delta(r_0\!-\!r)\right].\tag{B}
\end{align}$$
In other words, we suggest to define OP's integral via the second line of eq. (B) as a derivative of a distribution.
If we compare our result (B), our Dirac delta distribution contribution is twice as big as Ref. 1. Our argument of the Heaviside step function is the same as OP's formula (1) but opposite Ref. 1.
References:

*

*Peter Schneider, arXiv:astro-ph/9601039; eq. (13).

