I'm trying to prove that when $0 < r < 1$,
\begin{equation} \int_0^{\pi} \frac{\log (1+r-2\sqrt{r}\cos(t))}{1+r-2\sqrt{r} \cos(t)}\,dt = \frac{2\pi}{1-r}\log(1-r).\end{equation}
References:
Evaluating an easier integral $\int_0^{\pi} \log (1+r-2\sqrt{r}\cos(t))\,dt$ has many references, for example:
A question in Complex Analysis $\int_0^{2\pi}\log(1-2r\cos x +r^2)\,dx$
But I couldn't find a direct reference for the above problem.
My approach:
Motivated by solutions in the above post, I tried to express my integral as a contour integral:
$$ \int_0^{\pi} \frac{\log (1+r-2\sqrt{r}\cos(t))}{1+r-2\sqrt{r} \cos(t)}\,dt = \frac{1}{2} \int_0^{2\pi} \frac{\log (1+r-2\sqrt{r}\cos(t))}{1+r-2\sqrt{r} \cos(t)}\,dt = \int_{\gamma} \frac{\log |1-z|^2}{2iz|1-z|^2} \,dz, $$ here $\gamma$ is the circle of radius $\sqrt{r}$ centered at the origin. I couldn't proceed further.
Could you help me with my approach or any other approach? Thank you in advance.