How to prove $\int_0^{2\pi} \ln(1+a^2+2a\cos x)\, dx=0$? [duplicate]
Solution 1:
Let $a$ be a real number.
- $\color{blue}{\text{Case 1.}}$ $\quad|a|<1$
$$ \int_0^{2\pi}\log \left(1+2a\cos x+ a^2\right){\rm d}x=0 $$
Observe that $$ \left(1+ae^{ix}\right)\left(1+ae^{-ix}\right)=1+2a\cos x+ a^2, \quad x \in [0,2\pi], $$ and that $$ \begin{align} \log \left(1+2a\cos x+ a^2\right) &=\log \left(1+ae^{ix}\right)+\log \left(1+ae^{-ix}\right)\\\\ &=-\sum_{n=1}^{\infty}\frac{(-1)^{n}}{n}a^n e^{inx}-\sum_{n=1}^{\infty}\frac{(-1)^{n}}{n}a^n e^{-inx}\\\\ &=-2\sum_{n=1}^{\infty}\frac{(-1)^{n}}{n}a^n \cos (nx)\\\\ \end{align} $$ Using the normal convergence of the series $\displaystyle\sum_{n=1}^{\infty}\frac{(-1)^{n}}{n}a^n \cos (nx) $ as a function of $x \in [0,2\pi]$, $$ \left|\sum_{n=1}^{\infty}\frac{(-1)^{n}}{n}a^n \cos (nx)\right|\leq \sum_{n=1}^{\infty}\frac{|a|^n }{n}=-\log(1- |a|)<\infty, $$ we are allowed to perform a termwise integration giving $$ \begin{align} \int_0^{2\pi}\log \left(1+2a\cos x+ a^2\right) {\rm d}x =-2\sum_{n=1}^{\infty}\frac{(-1)^{n}}{n}a^n \int_0^{2\pi}\cos (nx) dx=0 \end{align}$$
due to $$ \begin{align} \int_0^{2\pi}\cos (nx) {\rm d}x=\left. \frac{\sin (nx)}{n}\right|_0^{2\pi}=0, \quad n=1,2,3,\ldots. \end{align}$$
- $\color{blue}{\text{Case 2.}}$ $\quad|a|>1$
$$ \int_0^{2\pi}\log \left(1+2a\cos x+ a^2\right){\rm d}x=4\pi \log |a| $$
Observe that $$ \log \left(1+2a\cos x+ a^2\right)=2\log |a| +\log \left(1+2\cdot\frac1a\cos x+ \frac{1}{a^2}\right), \quad x \in [0,2\pi], $$ then $$ \int_0^{2\pi}\log \left(1+2a\cos x+ a^2\right){\rm d}x=2\log |a|\int_0^{2\pi} {\rm d}x+\int_0^{2\pi}\log \left(1+2\cdot\frac1a\cos x+ \frac{1}{a^2}\right){\rm d}x, $$ and, applying the previous case to the last integral, we get the desired result.
Remark 1.
Here $\displaystyle \log (z)$ denotes the principal value of the logarithm defined for $z \neq 0$ by $$ \begin{align} \displaystyle \log (z) = \ln |z| + i \: \mathrm{arg}z, \quad -\pi <\mathrm{arg} z \leq \pi. \end{align} $$ Remark 2. $$ \begin{align} & a=-1 & \text{gives} \quad &\int_0^{2\pi}\log \left(2-2\cos x\right){\rm d}x=4\int_0^{\pi}\log \left(2\sin u\right){\rm d}u=0\\ & a=1 & \text{gives} \quad &\int_0^{2\pi}\log \left(2+2\cos x\right){\rm d}x=2\int_0^{\pi}\log (4\cos^2 u){\rm d}u=0. \end{align} $$
Remark 3. One may readily notice that the preceding reasoning gives
$$ \begin{align} \int_0^{\pi}\log \left(1+2a\cos x+ a^2\right){\rm d}x = \left\{ \begin{array}{ll} 0 & \mbox{if } |a| \leq 1 \\ 2\pi \log |a| & \mbox{if } |a| > 1 \end{array} \right. \end{align} $$
Solution 2:
if the integral is $f(a)$ then $f(0)=0$.
also $$ 1+a^2+2a \cos x = (1+ae^{ix})(1+ae^{-ix}) $$ so $$ f(a) = \int_0^{2\pi} \ln(1+ae^{ix}) dx + \int_0^{2\pi} \ln(1+ae^{-ix}) dx $$ $$ \frac{df}{da} = \int_0^{2\pi} \frac{e^{ix}}{1+ae^{ix}} dx + \int_0^{2\pi} \frac{e^{-ix}}{1+ae^{-ix}} dx \\ =0 $$ since both integrands are analytic for $a \lt 1$