If $r \in \Bbb R$ how to integrate $\displaystyle \int_0^{\pi} \log ( 1 - 2 r \cos \theta + r^2)d\theta$?
I need some hints. Special case, if $r = 1$ then I know the above integral is zero.
Here is my working \begin{align*} \int_0^{\pi}\log (1 - 2 r \cos \theta + r^2)d\theta &= \int_0^\pi\log ((1 - re^{i \theta})(1 -re^{-i\theta} )) d\theta\\ &= \int_0^\pi \log(1 - r e^{i\theta})d\theta + \int_0^\pi\log(1 - re^{-i\theta})d\theta\\ &= \int_0^{2\pi} \log( 1 - re^{i\theta})d\theta \\ &= 0 \end{align*}