Evaluate $\int_{D} \frac{dw}{w \cdot (1-w)}$ where $D$ is the rectangle How can I evaluate the below integral:: $$\int_{D} \frac{dw}{w \cdot (1-w)}$$ using the $\textbf{Cauchy Integral Formula}$, where $D$ is the rectangle with vertices at the points $3 \pm{i}$ and $-1 \pm{i}$. 
I know that the Cauchy Integral formula states $$f(a) = \frac{1}{2\pi i}\oint_{C} \frac{f(z)}{z-a} \ dz$$ but not sure as to how to apply. 
A solution will atleast help me in knowing how to work with these type of problems in future.
Thanks.
 A: One way would be to start with partial fractions
$$
\frac{1}{w(1-w)} = \frac{A}{w} + \frac{B}{1-w}.
$$
The formula tells you how to handle $\displaystyle\int_D \frac{dw}{w-0}$ and also $\displaystyle\int_D \frac{dw}{w-1}$, and you've got a sum of those two.
Notice that both $0$ and $1$ are inside the region bounded by $D$.  Without that, you wouldn't  do this the same way.
Notice that if you have a curve $C$ that winds around $a$ but not around $b$, then you could write
$$
\int_C \frac{dw}{(w-b)(w-a)} = \int_C \frac1{w-b}\cdot\frac{dw}{w-a},
$$
and then you could say that that's $\dfrac{1}{w-b}$ evaluated at $w=a$, then multiplied by $\displaystyle\int_C\frac{dw}{w-a}$.  The reason is that as the curve shrinks to a point at $a$, the value of the integral does not change (Cauchy's formula tells you that), but $1/(w-b)$ approaches a limit.
If the curve winds around more than one point at which there's a pole, the integral is just the sum of integrals each winding around just one of those points.  That's a fact you'll probably see pretty soon if you haven't yet.
