Questions regarding the complex integral $\int_{\gamma} \frac{1}{(z-a)(z-b)} dz$ I don't know Cauchy's integral formula and the book I'm learning complex analysis from asks to prove $\int_{\gamma} \frac{1}{(z-a)(z-b)} dz = 2\pi i$ where $\gamma$ is a circle centered at origin with radios $|a| < R < |b|$. 
The complex integral of $f(z)$ over a path $\gamma$ parametrized by $\tau(t), t \in I \subset \mathbb{R}$ is defined as $\int_I f(\tau(t)) \tau'(t) dt$
Here's my progress: So we parametrize $\gamma$ as $\tau(\theta) = Re^{i \theta}, \theta \in [0, 2 \pi]$. Using the identity $\frac{1}{(z-a)(z-b)} = \frac{1}{b-a} [ \frac{1}{z-a} - \frac{1}{z-b}]$, we integrate each part separately. $\int_{\gamma} \frac{1}{z-a} dz = \int_{0}^{2 \pi} \frac{Rie^{i \theta} d\theta}{Re^{i \theta} - a}$. Now I don't know how to evaluate it. 
If this was real, i.e to integrate $\int_{0}^{2\pi} \frac{Re^\theta d \theta}{Re^\theta - 1}$, I would just substitute $u  = Re^{\theta} - 1$, then the integral is $\int_{R-1}^{Re^{2\pi} - 1} \frac{du}{u} = \ln(\frac{Re^{2\pi} - 1}{R-1})$, but then several problems arise when I try to mimmick that appraoch:
-- In this if you substitute $u = Re^{i \theta} - 1$ case both upper and lower limits are same ! Maybe this can be fixed by integrating $\int_{0}^{2\pi - \epsilon} \frac{Re^\theta d \theta}{Re^\theta - 1}$ and letting $\epsilon \rightarrow 0$, but I'm not sure whether thta would give the correct answer (because as long as $\epsilon \neq 0$ the path is a not a proper loop)
-- Even if you ignore the issue of the limits, why $\int_{a}^{b} \frac{1}{u(t)} u'(t) dt$ should be equal to $\ln(b) - \ln(a)$ when $a,b$ are complex ? Also which value of $\ln(a)$ hsould be taken and why not the other values ?
 A: Hint:
$$\int_{\gamma} \frac{1}{z-a} dz = \int_{0}^{2 \pi} \frac{iRe^{i\theta}d\theta}{Re^{i \theta} - a}= i\int_{0}^{2 \pi} \frac{d\theta}{1 - \frac aR e^{-i \theta}}\\
=i\int_{0}^{2 \pi}\sum_{k=0}^\infty \left(\frac aR e^{-i \theta}\right)^k d\theta
=i\sum_{k=0}^\infty \int_{0}^{2 \pi}\left(\frac aR e^{-i \theta}\right)^k d\theta 
=2\pi i;$$
$$\int_{\gamma} \frac{1}{z-b} dz = \int_{0}^{2 \pi} \frac{iRe^{i\theta}d\theta}{Re^{i \theta} - b}= -i\int_{0}^{2 \pi}\frac{e^{i \theta}}b \frac{d\theta}{1 - \frac Rb e^{i \theta}}\\
=-i\int_{0}^{2 \pi}\frac{e^{i \theta}}b\sum_{k=0}^\infty \left(\frac Rb e^{i \theta}\right)^k d\theta
=-\frac iR\sum_{k=0}^\infty \int_{0}^{2 \pi}\left(\frac Rb e^{i \theta}\right)^{k+1}d\theta 
=0,$$
where we used:
$$
 \int_{0}^{2 \pi} e^{i k\theta}d\theta=2\pi\delta_{k0}.
$$
A: Since
$$\frac 1 {(z - a) (z - b)} =
\frac 1 {(b - a) (z - b)} - \frac 1 {(b - a) (z - a)},$$
we need to evaluate the integral of $1/(z - z_0)$:
$$\int_{|z| = R} \frac {d z} {z - z_0} =
\int_{-\pi}^\pi \frac {d(R e^{i t})} {R e^{i t} + |z_0| e^{i \arg(-z_0)}} =
\int_{-\pi}^\pi
 \frac {d(R e^{i t})} {R e^{i t} + |z_0|} = \\
\lim_{\epsilon \downarrow 0} \ln(R e^{i t} + |z_0|)
 \bigg\rvert_{t = -\pi + \epsilon}^{\pi - \epsilon},$$
where $\ln$ is the principal value of the logarithm. The second step uses the fact that the integral of $f(t + t_0)$ over a period of $f$ is the same for any $t_0$. The limit is $2 \pi i$ when $R > |z_0|$ and $0$ when $R < |z_0|$.
A: You should really use the residue theorem (or a good version of Cauchy's theorem). One of the cool things you can do with complex integrals is to calculate hard definite real integrals. 
In any case, I think your question is a good way of showing the type of real integrals can be calculated using complex analysis.
Here are my hints:
1) First I think you should have in mind the definition of the integral of a path of complex numbers. Basically you have a continuous path $\gamma:[a,b]\to\mathbb{C}$, then we can define $\int_a^b\gamma(t)dt$: 
$$\int_a^b\gamma(t)dt = \int_a^b\gamma_1(t)dt+i\int_a^b\gamma_2(t)dt,$$
if $\gamma(t)=\gamma_1(t)+i\gamma_2(t)$. So every time you have a complex path, first write its real and imaginary parts, then calculate the two real integrals.
2) The specific integral we want to calculate is of the form: 
$$\int_\gamma \frac{dz}{z-c},$$
where $\gamma$ is a parametrization of the circle $|z|=R\neq |c|$. This path integral does not depend on the parametrization $\gamma$ of the circle. The immediate one is $\gamma(t)=Re^{it}$ for $0\leq t\leq 2\pi$ (there is a better one, but lets stick with this one). So we need to calculate:
$$\int_0^{2\pi}\frac{iRe^{it}dt}{Re^{it}-c}.$$
3) The hard work is to write the real and complex part of the integral above, but there are some simplifications one can make. If $c=|c|e^{it_0}$ and $\alpha = |c|/R$, the integral assumes the form:
$$i\int_0^{2\pi}\frac{dt}{1-\alpha e^{-i(t-t_0)}} = i\int_0^{2\pi}\frac{1-\alpha e^{i(t-t_0)}}{1+\alpha^2-2\alpha\cos(t-t_0)}dt.$$
Separating real and imaginary parts, we obtain
$$\int_0^{2\pi}\frac{\alpha \sin(t-t_0)}{1+\alpha^2-2\alpha\cos(t-t_0)}dt+i\int_0^{2\pi}\frac{1-\alpha \cos(t-t_0)}{1+\alpha^2-2\alpha\cos(t-t_0)}dt.$$
The first integral is very easy. The challenge is to prove that the second is $2\pi$ if $\alpha<1$ and $0$ if $\alpha>1$. Good luck on that!
