$\int\limits_{\gamma} \frac{z}{(z-1)(z-2)}dz$, $\gamma(\theta) = re^{i\theta}$, $2 < r < \infty$ For $0 < r < 2$, we can use Cauchy's integral formula and choose our holomorphic function to be $f(z) = \frac{z}{z - 2}$ since $z = 1$ is the only pole, but if $r > 2$, then both poles $z = 1$ and $z = 2$ are inside the contour so we can use partial fractions to get our integral into a form to use Cauchy's integral formula, but the solution says that because of Cauchy's theorem, $\int\limits_{\gamma} \frac{z}{(z-1)(z-2)}dz = 0$ when $2 < r < \infty$ because the integral is holomorphic inside the contour, and that $|z| > 2$ so since the values of $z$ are outside of the path, the integrand is holomorphic? The picture included with the solution is a circle on the complex plane centered at the origin with radius $2$ and everything outside the contour is shaded. I am confused about this; can someone clarify please?
 A: Your professor is "forgetting" that by looking at the complementary region he must consider the region outside $|z|=2$ in the Riemann sphere. Then, even though $f(z)=\dfrac z{(z-1)(z-2)}$ is analytic in $\Bbb C - \{1,2\}$, the one-form $f(z)\,dz = \dfrac {z\,dz}{(z-1)(z-2)}$ in fact has a pole at infinity. Setting $w=1/z$, we have
$$f(z)\,dz = f(1/w)\left(-\frac{dw}{w^2}\right) = -\frac1{(1-w)(1-2w)}\cdot\frac{dw}{w},$$
which has residue $-1$ at $w=0$ (corresponding to $z=\infty$).
Applying the residue theorem, then, gives
$$\int_\gamma f(z)\,dz = -2\pi i \text{ res}_\infty\big(f(z)\,dz\big) = 2\pi i.$$
A: Let $r>2$ you have 2 singularities, say $z_1=1$ and $z_2=2$. Now take $r_1$ and $r_2$ sufficiently small such that $\gamma_1(\theta)=z_1+r_1e^{i\theta}$ and $\gamma_2(\theta)=z_2+r_2e^{i\theta}$ stays inside of the region bounded by $\gamma$ and do not intersect. 
EDIT I am giving 2 different answers, same result:
Partial Fraction Approach By Partial fractions we get that
$$
\frac{z}{(z-1)(z-2)}= \frac{-1}{(z-1)}+ \frac{2}{(z-2)}
$$
Then 
$$
\int_{\gamma}\frac{z}{(z-1)(z-2)} dz = \int_{\gamma}\frac{-1}{(z-1)} dz + \int_{\gamma}\frac{2}{(z-2)} dz = \int_{\gamma_1}\frac{-1}{(z-1)} dz + \int_{\gamma_2}\frac{2}{(z-2)} dz 
$$
And by Cauchy´s Integral Formula, since $z_1=1$ is the only singularity for the first integral and $z_2=2$ for the second one, then
$$
\int_{\gamma}\frac{z}{(z-1)(z-2)} dz = 2\pi i(-1) + 2\pi i(2) = 2\pi i
$$
Cauchy´s Integral Formula / Residues Approach
Since $\int_\gamma=\int_{\gamma_1}+\int_{\gamma_2}$, 
$$ \int_{\gamma}\frac{z}{(z-1)(z-2)}dz = \int_{\gamma_1}\frac{z}{(z-1)(z-2)}dz +\int_{\gamma_2}\frac{z}{(z-1)(z-2)}dz $$
Now, you can apply Cauchy's Integral Formula (Residue Theorem), since the region bounded $\gamma_j$ only contains $z_j$ as a singularity, $j=1,2.$ 
$$ \int_{\gamma}\frac{z}{(z-1)(z-2)}dz = 2\pi i \underbrace{\left( \frac{z_1}{z_1-2} + \frac{z_2}{z_2-1}\right)}_{= Res_{z_1}+Res_{z_2}}=2\pi i \left( \frac{1}{1-1} +  \frac{2}{2-1}\right) = 2\pi i 
$$
So the answer is indeed $2\pi i$.
