Residue at infinity This is an old qualifying exam problem:
Suppose $f$ is entire and $a < b$.  Show that the residue of $$ f(z) \log \frac{z-b}{z-a} $$ at infinity is $\int_a^b f(x)dx$.
 A: Try using a "keyhole contour".
Let $C_{\delta}$ be a positively oriented circle around $a$ of small radius $\delta$. Let $r = b-a$, and $C_r$ the circle of radius $r$ around $a$. Let $\sigma_{\delta+}$ be the line segment from $a$ to $b$ just above the real axis: $z(t) = a + t + \delta i$. Let $\sigma_{\delta-}$ be the line segment from $a$ to $b$  just below the real axis: $z(t) = a + t - \delta i$. The concatenation of these curves (bending a little to join the circles without hitting $a$ and $b$) is a closed curve.
Inside the curve, the function $f(z)\log(\frac{z-b}{z-a})$ is analytic, so
$$
\int_{C_r - C_{\delta} + \sigma_{\delta+} -\sigma_{\delta-} } f(z)\log(\frac{z-b}{z-a})  dz = 0
$$
Notice that the residue at infinity of $f$ is $\frac{1}{2\pi i}\int_{C_r} f(z)\log(\frac{z-b}{z-a}) dz$.
In the limit as $\delta \to 0$, the integral on $C_{\delta}$ vanishes. In addition, the integrals on the horizontal segments differ by $2\pi i \int_{a}^{b}f(x)dx$, since they are on opposite sides of the branch cut for $\log(\frac{z-b}{z-a})$.
Since the sums of the integrals is zero, you get
$$
-\int_{C_r} f(z)\log(\frac{z-b}{z-a}) dz = 2 \pi i \int_{a}^{b}f(x)dx
$$
A: The same statement holds for any $a,b\in\Bbb C$. (Note that since $f$ is an entire function, $\int_a^b f(z)dz$ is independent of path, and hence well defined. ) 
Proof:
Fix an arbitrary positive number $R>\max\{|a|, |b|\}$. It is easy to check that when $|w|,|w_0|<R$, (each branch of ) $\log\frac{z-w}{z-w_0}$ is a well defined holomorphic function of $z$ on $\{|z|\ge R\}$, so 
$$g_{w_0}(w):=\frac{1}{2\pi i}\int_{|z|=R}f(z)\log\frac{z-w}{z-w_0}dz$$
defines a holomorphic function of $w$ on $\{|w|<R\}$. Moreover, $g_{w_0}(w_0)=0$ and
$$(g_{w_0})'(w)=-\frac{1}{2\pi i}\int_{|z|=R}\frac{f(z)}{z-w}dz=-f(w).$$
That is to say,
$$g_{w_0}(w)=-\int_{w_a}^w f(z)dz.$$
Letting $w_0=a$, $w=b$, the conclusion follows. 
A: Assume $\log$ is the principal branch of the logarithm ($-\pi\le\arg z\le\pi $, sic! [to be short with your permission]), and that $a<b$. Denote $g(z)=f(z)\log\frac{z-b}{z-a}$. If $R$ is large enough $res[g,\infty]=\frac{1}{2\pi i}\int_{C_R}g(z)\,dz$, where $C_R$ is the circle around zero of radius $R$, the integration in clockwise direction. Deforming the contour thanks to holomorphy, we have
$$
res[g,\infty]=\frac{1}{2\pi i}(\int_a^b)^* g(z)\,dz
$$
where the asterisk means integration over the segment $[a,b]$ twice, once from $a$ to $b$ from above, and then from $b$ to $a$ from below of the segment. On the upper side we have
$$
g(x)=f(x)(\log|\frac{x-b}{x-a}|+i\pi),
$$
and, on the lower side,
$$
g(x)=f(x)(\log|\frac{x-b}{x-a}|-i\pi).
$$
Hence
$$
(\int_a^b)^*g(z)\,dz=2\pi i\int_a^b f(x)\,dx
$$
which amounts to what was needed.
