In my research I came across the integral $$ \int_0^\pi \log|1 + 2\cos(x)| \, dx. $$ Maple wasn't able to evaluate it exactly, but gave a complex answer that is extremely close to $0$. So I put it in Wolfram Alpha, which gave an answer of $0$ but wouldn't give me a proof without me paying for Pro. (As an academic I'm pretty sure I could very easily get free access to this - but I thought that this question might be nice for the Math.SE community, as it's quite an intriguing result for which I could not find a proof using a Google search.)
So my question is: why is this $0$?
Equivalent formulations: $$ \int_0^{\frac{2\pi}3} \log(1 + 2\cos(x)) \, dx \ = \ -\int_{\frac{2\pi}3}^\pi \log(-1-2\cos(x)) \, dx $$ or (by multiplying the original integral by 2) $$ \int_0^{\pi} \log(1 + 4\cos(x) + 2\cos(2x)) \, dx \ = \ 0. $$ By symmetry, the integrals from $0$ to $\pi$ can equivalently be taken as $0$ to $2\pi$ (in which case also $\cos$ can equivalently be replaced by $\sin$).