# Real Pole Residue theorem

I've been studying the residue theorem and I've been having a problem understanding the following result seen here (Eq.7.39) which states :

Given a regular function on the real axis, $g$, then $$\lim_{\epsilon \to 0}~\int_{-\infty}^{+\infty}\frac{g(x)}{x-x_0\mp i\epsilon}dx=PV\int_{-\infty}^{+\infty}\frac{g(x)}{x-x_0}dx \pm i\pi g(x_0)$$ where $x_0\in\mathbb R$.

What I don't understand is the factor $i\pi g(x_0)$ instead of $2i\pi g(x_0)$. Also, why $g(x_0)\equiv \operatorname{Res}(g(x),x=x_0)$ instead of $\operatorname{Res}(g(x),x=x_0\pm i\epsilon)$ in that same term?

Can anyone help me?

1) The residue is in fact $i 2 \pi g(x_0)$, but if you have that residue, then you are including the pole in the contour. In order to do that, you have to deform the contour with that semicircle around the pole, which cancels half the residue. On the other hand, if you do not include the pole and integrate around it the other way, you get the same result as if you did include it. (Basically, $i \pi - i 2 \pi = -i \pi$.)
2) You can call the pole one or the other, it doesn't matter because you are taking the limit as $\epsilon \rightarrow 0^+$.