Compute $∫_0^{2\pi}\frac{ 1-a\cos\theta}{1-2a\cos\theta + a²} dθ$ Let a be a real number with |a|>1. Compute 
$$\int_0^{2\pi}\frac{ 1-a\cos\theta}{1-2a\cos\theta + a²} dθ$$
I know i should think of a circle since the bounds are from 0 to 2π. I have the soltuions to this question. But what i don't understand is how do we assume that we should start the problem with 
$$∫_{|z|=1} \frac{dz}{z-a}dz\,\;\; ?????\;\;\;\text{How do i assume this at the start???} $$
and then use $\,\,z=e^{iθ}\,\,$ and $\,\,dz= ie^{iθ}\,\,$ to get a similar integral as the one above after doing some algebra. 
I have not learnt the Residual formula yet. I have only learnt until the Cauchy Integral Formula 
 A: If $z=e^{i\theta}$ then 
$$\cos\theta=\frac{e^{i\theta}+e^{-i\theta}}{2}=\frac{z+\frac1z}{2}=\frac{z^2+1}{2z}$$
Hence
$$\begin{align*} \int_0^{2\pi}\frac{ 1-a\cos\theta}{1-2a\cos\theta + a²} d\theta=&\int_{|z|=1}\frac{1-a\frac{z^2+1}{2z}}{1-2a\frac{z^2+1}{2z}+a^2}\frac{dz}{iz}=\int_{|z|=1}\frac{2z-az^2-a}{2iz(z-az^2-a+a^2z)}dz\\
=&  \int_{|z|=1}\frac{-az^2+2z-a}{-2iaz(z^2-(a+\frac1a)z+1)}dz=\frac{1}{2ia}\int_{|z|=1}\frac{az^2-2z+a}{z(z-a)(z-\frac1a)}dz \\
\end{align*}$$
You know that $|a|>1$, $\left|\frac1a\right|<1$. Can you continue from here?
A: It's not at all obvious.  But a clue is that by the Law of Cosines $1 - 2 a \cos \theta + a^2$ is the square of the third side of a triangle with two sides $1$ and $a$ and angle $\theta$ between them.  Thus it is $|e^{i\theta} - a|^2$.  If $z=e^{i\theta}$ is on the unit circle, $|z - a|^2 = (z - a)(\overline{z} - a) = (z - a)(1/z - a)$.  On the other hand, 
$1 - a \cos(\theta) = 1 - \text{Re}(a z) = 1 - (a z + a/z)/2$, and $d\theta = dz/(iz)$. 
A: Let assume that $\gamma:[0,2\pi]\to\mathbb{R}^2$ is a closed and differentiable curve.
Since 
$$\frac{d}{d\theta}\arctan\left(\frac{y(\theta)}{x(\theta)}\right)=\frac{x\,y'-y\,x'}{x^2+y^2}$$
we have that
$$\int_{0}^{2\pi}\frac{x\,y'-y\,x'}{x^2+y^2}\,dt$$
is the topological degree of $\gamma$ wrt the origin, i.e. $2\pi$ times the winding number of $\gamma$. If we take:
$$ \gamma(\theta) = \left(1-\frac{1}{a}\cos(\theta),\frac{1}{a}\sin(\theta)\right),$$
that is a circle not enclosing the origin, we immediately have that the value of the integral in the exercise is zero.
