Upper-half-plane indentation rule (source code)

= Upper-half-plane indentation rule

Suppose a contour follows the <real line>[real axis], closes in the upper half-plane, and avoids each simple real pole $a_j$ by a small semicircle above it. Each indentation is clockwise and tends to
$$
-i\pi\operatorname{Res}(f,a_j).
$$
If the large arc vanishes and there are no enclosed poles away from the real axis, the <Cauchy principal value> is therefore
$$
\operatorname{PV}\int_{-\infty}^{\infty}f(x)\,dx
=i\pi\sum_j\operatorname{Res}(f,a_j).
$$