residue theorem with logarithmic function I have problem integrating function with logarithm.
Problems seems always to be branch cut of $\log$, but here it is different I think.
I have task to integrate
$$\oint_{|z| = 1} \! dz \log\left(\frac{z - a}{z - b}\right)$$
given $|a| < 1$ and $|b| < 1$
First I think to check branch points of logarithm.
I write $$\log\left(\frac{z - a}{z - b}\right) = \log(z - a) - \log(z - b)$$
Going around $a$ in small circle I pick up term $2\pi i$, going around $b$ I pick up term $-2\pi i$, so going around both I pick up nothing.
So I make branch cut $a$ to $b$ and contour does not intersect.
But now I get stuck! I try to find residue of integral at $a$ and $b$ but I cannot get series of at $a,b$, because logarithm always remains inside.
How I can evaluate such integrals?
 A: METHOD 1:
For the branch points at $z=a$ and $z=b$, we choose branch cuts as straight line contours, that begin at the branch points, intersect the unit circle at $e^{i\phi_a}$ and $e^{i\phi_b}$, then extend to the point at infinity.  Note that these branch cuts are not unique.
Now, let $z=e^{it}$.  Then, we have
$$\begin{align}
\oint_{|z|=1} \log(z-a)\,dz &= \int_0^{\phi_a^-}\log(e^{it})ie^{it}\,dt+ \int_{\phi_a^+}^{2\pi}\log(e^{it})ie^{it}\,dt\\\\
&=\left.\left((e^{it}-a)\left(\log(e^{it}-a)-1\right)\right)\right|_{0}^{\phi_a^-}+\left.\left((e^{it}-a)\left(\log(e^{it}-a)-1\right)\right)\right|_{\phi_a^+}^{2\pi}\\\\
&=2\pi i (e^{i\phi_a}-a)
\end{align}$$
Similarly, we have 
$$\oint_{|z|=1} \log(z-b)\,dz =2\pi i (e^{i\phi_b}-b)$$
Putting it together, we have 
$$\oint_{|z|=1} \log\left(\frac{z-a}{z-b}\right)\,dz =2\pi i (e^{i\phi_a}-e^{i\phi_b}+(b-a))$$
If we choose $\phi_a=\phi_b$, then the integral of interest becomes
$$\oint_{|z|=1} \log\left(\frac{z-a}{z-b}\right)\,dz =2\pi i (b-a) \tag1$$

METHOD 2:
Here, we note that if the branch cut is chosen to adjoin the branch points, then the integrand is analytic outside $|z|=1$.  Therefore, we can evaluate the integral of interest using the Residue Theorem with the Residue at Infinity.  To that end, we have
$$\begin{align}
\oint_{|z|=1} \log\left(\frac{z-a}{z-b}\right)\,dz &=-2\pi i \text{Res}\left(-\frac{1}{z^2}\log\left(\frac{z^{-1}-a}{z^{-1}-b}\right),z=0\right)\\\\
&=2\pi i\lim_{z\to 0} \left(\frac{1}{z}\log\left(\frac{1-az}{1-bz}\right)\right)\\\\
&=2\pi i (b-a)
\end{align}$$
recovering the result in $(1)$!
