# Integrate $\int \log(1+2m\cos x+m^2) dx$

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.
• Yes, I did everything that you did but the last line ("the integral of the previous line with respect to the $m$ -variable"), is what I can't seem to do. – Aritra Das Jun 11 '15 at 19:40
• @AritraDas: you may substitute $u=\frac{m-1}{m+1}$. In any case, you have to reach the real part of a dilogarithm. Are you sure the original problem was requesting to compute a primitive for $\log(1+m^2+2m\cos x)$, for any $|m|<1$? – Jack D'Aurizio Jun 11 '15 at 19:47
• Not even $|m| < 1$ but for $m > 0$. I think we need 2 cases, one for $|m| < 1$ and the other for $|m| > 1$ . – Aritra Das Jun 11 '15 at 20:03
• This quesiton is from a book, which also lists some hints. There they have mentioned using $\log(1+x) = x - x^2/2 + x^3/3 - ....$ But is this formula applicable for complex values of x ? – Aritra Das Jun 11 '15 at 20:07
• That series is applicable in a region for which $\log z$ is analytic. – Mark Viola Jun 11 '15 at 20:14