Evaluate $\int_{\partial C} \frac{dz}{(z-a)(z-b)}$ where $\partial C$ is the boundary of a rectangle ($a$ and $b$ are not on $\partial C$) In discussing the possible outcomes of the integral
$$\int_{\partial C} \frac{dz}{(z-a)(z-b)}$$
where $\partial C$ is the boundary of a rectangle ($a$ and $b$ are complex and not on $\partial C$), what must one consider?
 A: First analyze your fraction as
$$
\frac{1}{(z-a)(z-b)}=\frac{1}{b-a}\left(\frac{1}{z-b}-\frac{1}{z-a}\right).
$$
Hence, the question now it what is the value of
$$
\int_{\partial C}\frac{dz}{z-c},
$$
where $z\not\in\partial C$. 
Assuming the integration on $\partial C$ is positively oriented, then
$$
\int_{\partial C}\frac{dz}{z-c}=\left\{\begin{array}{ccc} 2\pi i& \text{if} & \text{$c$ is inside $C$}, \\ 0 &\text{if} &\text{$c$ is outside $C$}.\end{array}\right.
$$
A: Let $\gamma_a,\gamma_b$ be small circles around $a,b$ respectively, and set $$I_a=\int_{\gamma_a}\frac{dz}{(z-a)(z-b)},\quad I_b=\int_{\gamma_b}\frac{dz}{(z-a)(z-b)}.$$Then the desired integral is one of the following:
$I_a+I_b$, in case both $a,b$ are inside the rectangle.
$I_a$ $(I_b)$ if $a$ $(b)$ is inside and $b$ $(a)$ is outside the rectangle.
$0$, if both points are outside the rectangle.
It suffices thus to evaluate $I_a,I_b$. Let $$g(z):=\frac{1}{z-b},$$and note that $g$ is holomorphic near $a$. By Cauchy's integral formula: $$g(a)=\frac{1}{2i\pi}\int_{\gamma_a}\frac{g(z)dz}{z-a}=\frac{1}{2i\pi}\int_{\gamma_a}\frac{dz}{(z-a)(z-b)},$$hence $$\frac{1}{a-b}=\frac{I_a}{2i\pi},$$or $$I_a=\frac{2i\pi}{a-b}.$$Similarly, $$I_b=\frac{2i\pi}{b-a},$$and now the desired can be evaluated with ease.
