Inapplicability of Gauss' mean value theorem in an integration What is the value of $$\int_0^{2\pi}\ln|i+2e^{ix}|dx$$
At first glance I thought of applying Gauss mean value theorem, but this is not applicable here as $\ln|z|$ is not analytic at $0$, which belongs in the region $|z-i|<2$. 
How one can approach this one? Any help is appreciated.

Too long for a comment, but using $e^{i\theta}=\cos\theta+i\sin\theta$ we have
$$|i+2\cos(x)+2i\sin(x)|=\sqrt{4\cos^2 x+(1+2\sin x)^2}=\sqrt{4\cos^2x+1+4\sin^2x+4\sin x}$$
so that
$$I=\frac{1}{2}\int_0^{2\pi}\ln(5+4\sin x)dx=\frac{1}{2}\int_0^{2\pi}\ln(4)dx+\frac{1}{2}\int_0^{2\pi}\ln\left(\frac{5}{4}+\sin x\right)dx.$$
Hence
$$I=2\pi\log(2)+\frac{1}{2}\int_0^{2\pi}\ln\left(\frac{5}{4}+\sin x\right)dx=2\pi\log 2.$$
The only way I could show the integral to vanish was using the power series for $\log(1+z)$,
$$\int_0^{2\pi}\ln\left(\frac{5}{4}\left(1+\frac{4}{5}\sin x\right)\right)dx=2\pi\ln(5/4)+\int_0^{2\pi}\ln\left(1+\frac{4}{5}\sin x\right)dx=J.$$
Assuming we can switch integral and infinite sum, and  since $4/5|\sin x|<1$, then the integral becomes
$$-\sum_{k=1}^\infty\frac{(-1)^k}{k}\frac{4^k}{5^k}\int_0^{2\pi}\sin^k xdx=-\frac{1}{2}\sum_{k=1}^\infty\frac{1}{k}\frac{4^{2k}}{5^{2k}}\frac{\pi  \cdot\left(\frac{3}{2}\right)_{k-1}}{\Gamma (k+1)}=-2\pi\log(5/4),$$
hence $J=0$.
