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?
 A: Your question has 2 parts, so let me answer them in turn.  If you want my opinion, my fellow physicists have made a muck of this subject with this operator notation, but I digress.
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^+$.
A: $\newcommand{\bbx}[1]{\,\bbox[15px,border:1px groove navy]{\displaystyle{#1}}\,}
 \newcommand{\braces}[1]{\left\lbrace\,{#1}\,\right\rbrace}
 \newcommand{\bracks}[1]{\left\lbrack\,{#1}\,\right\rbrack}
 \newcommand{\dd}{\mathrm{d}}
 \newcommand{\ds}[1]{\displaystyle{#1}}
 \newcommand{\expo}[1]{\,\mathrm{e}^{#1}\,}
 \newcommand{\ic}{\mathrm{i}}
 \newcommand{\mc}[1]{\mathcal{#1}}
 \newcommand{\mrm}[1]{\mathrm{#1}}
 \newcommand{\on}[1]{\operatorname{#1}}
 \newcommand{\pars}[1]{\left(\,{#1}\,\right)}
 \newcommand{\partiald}[3][]{\frac{\partial^{#1} #2}{\partial #3^{#1}}}
 \newcommand{\root}[2][]{\,\sqrt[#1]{\,{#2}\,}\,}
 \newcommand{\totald}[3][]{\frac{\mathrm{d}^{#1} #2}{\mathrm{d} #3^{#1}}}
 \newcommand{\verts}[1]{\left\vert\,{#1}\,\right\vert}$
Usually
\begin{align}
\int_{-\infty}^{\infty}{\on{f}\pars{x} \over x \pm \ic \epsilon}
\,\dd x
& =
\int_{-\infty}^{\infty}\on{f}\pars{x}\,
{x \over x^{2} + \epsilon^{2}}\,\dd x\ \mp\
\ic\pi\int_{-\infty}^{\infty}\on{f}\pars{x}\,
{\epsilon/\pi \over x^{2} + \epsilon^{2}}\,\dd x
\end{align}
As $\ds{\epsilon \to 0^{+}}$, $\ds{{\epsilon/\pi \over x^{2} + \epsilon^{2}}}$ is a "Delta Dirac Representation" $\ds{\delta\pars{x}}$ and the RHS first integral becomes a Principal Value.
\begin{align}
\int_{-\infty}^{\infty}{\on{f}\pars{x} \over x \pm \ic \epsilon}
\,\dd x
& =
{\rm P.V.}\int_{-\infty}^{\infty}{\on{f}\pars{x}
\over x}\,\dd x\ \mp\
\int_{-\infty}^{\infty}\on{f}\pars{x}\,
\ic\pi\,\delta\pars{x}\dd x\ \mbox{as}\ \epsilon \to 0^{+}
\end{align}
