How do I integrate $\int \log(1+2m\cos x+m^2) dx $ ?
I tried 2 things. First, I tried complex numbers. Putting $\cos x = \frac{e^{ix}+e^{-ix}}{2} $ which led me to $\int \log((me^{ix} +1)(me^{-ix}+1))dx $ and finally $\int \log(me^{ix} +1)+\log(me^{-ix}+1)dx $ , which I expanded using taylor expansion of $ \log(1+x)$ and then transformed it back to sine and cos, and then integrated but the answer was pretty ugly. And I'm not even sure it is correct.
Another thing I tried was to differentiate the integral with respect to m and then integrate it with respect to x and then with respect to m. But I couldn't do the last step, id est, integrating with respect to m.
Is there any other method which can be applied for this integration ?
By exploiting the Taylor series of $\log(1+z)$ in a neighbourhood of the origin, $$\int \log(1+me^{ix})\,dx = C+i\cdot\text{Li}_2\left(-me^{ix}\right).$$ An interesting possibility is given by differentiation under the integral sign:
$$ \int\frac{2m+2\cos x}{1+m^2+2m\cos x}\,dx = \frac{x}{m}+\frac{2}{m}\,\arctan\left(\frac{m-1}{m+1}\,\tan\frac{x}{2}\right)$$ The integral of $\log(1+m^2+2m\cos x)$ is just the integral of the previous line with respect to the $m$-variable.