I'm trying to evaluate $$\int_0^{2 \pi} \ln(a^2 -2 a \cos(t - \phi) + 1) dt$$
where $a\in \mathbb{R}$, $a \in (0, 1)$ and $\phi \in \mathbb{R}$.
I suspect the answer is just $0$, but I'm not sure how to demonstrate that succintly.
I attempted a contour integral using the subsitution $z = e^{i t}$, $cos(t) = \frac{1}{2} (z + \frac{1}{z})$ but it's not clear to me how to handle $z = 0$ when finding the residues.
Since this hasn't been closed yet as a duplicate, we offer for $|a|<1$, $$\begin{align}I&=\int_0^{2\pi}\ln(a^2-2a\cos(t-\phi)-1)dt\\ &=\int_0^{2\pi}\ln(1-ae^{i(t-\phi)})dt+\int_0^{2\pi}\ln(1-ae^{-i(t-\phi)})dt\tag{1}\\ &=\oint_{|z|=1}\ln(1-aze^{-i\phi})\frac{dz}{iz}-\oint_{|z|=1}\ln(1-aze^{i\phi})\frac{dz}{(-iz)}\tag{2}\\ &=\lim_{z\rightarrow0}2\pi i\left(\frac{\ln(1-aze^{-i\phi})}{i}+\frac{\ln(1-aze^{i\phi})}{i}\right)=0\tag{3}\end{align}$$ $(1)$ Being careful arguments of all logarithms are positive real when $t=\phi+n\pi$
$(2)$ Letting $z=e^{it}$, $dz=ie^{it}dt=iz\,dz$ in the first integral and $z=e^{-it}$, $dz=-ie^{-it}dt=-iz\,dz$ in the second. The minus sign is there because the substitution would run the second integral around the unit circle clockwise.
$(3)$ Since we ran our branch cuts away from the unit circle, the residue theorem applies.
If $|a|>1$ then $$\begin{align}\int_0^{2\pi}\ln(a^2-2a\cos(t-\phi)+1)dt&=\int_0^{2\pi}\left(\ln(a^2)+\ln\left(1-\frac2a\cos(t-\phi)+\frac1{a^2}\right)\right)dt\\ &=4\pi\ln|a|\end{align}$$ Because then $\left|\frac1a\right|<1$ and $\ln(a^2)=2\ln|a|$.
Pretty close to robjohn's solution but a little more algebraic and less geometric.