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.
$$\begin{align} \int_{0}^{\pi} \frac{\log(1+r^{2}-2r \cos t)}{1+r^{2} - 2 r \cos t} \, \mathrm dt &= \frac{1}{2} \int_{-\pi}^{\pi} \frac{\log(1+r^{2}-2r \cos t)}{1+r^{2} - 2 r \cos t} \, \mathrm dt \\ &= \Re \int_{-\pi}^{\pi} \frac{\log(1-re^{it})}{(1-re^{it})(1-re^{-it})} \, \mathrm dt \\ &= \, \Re \int_{|z|=1} \frac{\log (1-rz)}{(1-rz)(1-r/z)} \, \frac{ \mathrm dz}{iz} \\ &= \, \Re \, \frac{1}{i} \int_{|z|=1} \frac{\log (1-rz)}{(1-rz)(z-r)} \, \mathrm dz \end{align}$$
Since $0 < r< 1$, the only singularity inside the unit circle is a simple pole at $z=r$.
Therefore,
$$ \begin{align} \int_{0}^{\pi} \frac{\log(1+r^{2}-2r \cos t)}{1+r^{2} - 2 r \cos t} \, \mathrm dt &= \Re\, \frac{1}{i}\, 2 \pi i \, \frac{\log(1-r^{2})}{1-r^{2}} \\ &= \frac{2 \pi}{1-r^{2}} \, \log(1-r^{2}) \end{align}$$