A question in Complex Analysis $\int_0^{2\pi}\log(1-2r\cos x +r^2)\,dx$ My problem is to integrate this expression: 
$$\int_0^{2\pi}\log(1-2r\cos x +r^2)dx.$$
where $r$ is any constant in $[0,1]$.
I know the answer is zero. Can you explain you idea to me or just prove that?
Maybe you will use the "Cauchy integral theorem ".

Note that
$$
\begin{align}
\int_0^{2\pi}\log(1-2r\cos(x)+r^2)\,\mathrm{d}x
&=2\,\mathrm{Re}\left(\oint_\gamma\log(1-z)\frac{\mathrm{d}z}{iz}\right)
\end{align}
$$
where the contour of integration is $\gamma(x)=re^{ix}$.
Since there is no singularity inside the contour, the integral is $0$.
