Evaluate $$\int_{0}^{\pi} \log \left(m^2-2m\cos x+1\right)\: dx$$

My Try: I let $$f(m)=\int_{0}^{\pi} \log \left(m^2-2m\cos x+1\right)\: dx$$

Differentiating w.r.t $m$ both sides we get

$$f'(m)=2\int_{0}^{\pi}\frac{(m- \cos x)dx}{(m-\cos x)^2+\sin^2x}=2\int_{0}^{\pi}\frac{(m+ \cos x)dx}{(m+\cos x)^2+\sin^2x}$$

we get

$$f'(m)=2\int_{0}^{\pi}\frac{m \csc^2 x+\csc x \cot x}{(m\csc x+\cot x)^2+1}$$

How to proceed now?

  • $\begingroup$ Try Integral calculator: $$-\dfrac{{\pi}\ln\left(\frac{m^2+2m+1}{m^2}\right)}{2}+\dfrac{{\pi}\ln\left(m^2+2m+1\right)}{2}-\mathrm{i}\operatorname{Li}_2\left(m\right)+\mathrm{i}\operatorname{Li}_2\left(-m\right)-\mathrm{i}\operatorname{Li}_2\left(\dfrac{1}{m}\right)+\mathrm{i}\operatorname{Li}_2\left(-\dfrac{1}{m}\right)+\dfrac{\mathrm{i}{\pi}^2}{2}$$ $\endgroup$ – GNUSupporter 8964民主女神 地下教會 May 5 '18 at 15:32
  • $\begingroup$ Is it assumed that $|m|<1$? $\endgroup$ – user May 5 '18 at 15:39
  • $\begingroup$ Not sure but any use of that assumption? $\endgroup$ – Umesh shankar May 5 '18 at 15:41
  • 1
    $\begingroup$ @GNUSupporter Using integral calculator or wolfram alpha, IMO, takes out all the fun in integration problems. $\endgroup$ – Frank W. May 5 '18 at 16:22
  • 1
    $\begingroup$ @FrankW. I agree. I do so because some (probability-theory) results are not so easy to verify for beginners: an argument for proving something and one for disproving something have completely different style. To choose a direction, (simulation) is needed. In this case, it's because some integrals may not have (closed-form) representation. $\endgroup$ – GNUSupporter 8964民主女神 地下教會 May 5 '18 at 17:49

Let's denote the desired integral as$$I(z)=\int\limits_0^{\pi}dx\,\log\left(z^2-2z\cos x+1\right)$$And use Feynman's Trick to turn the integral into something that we can manage. Differentiating with respect to $z$ gives$$I'(z)=\int\limits_0^{\pi}dx\,\frac {2z-2\cos x}{z^2-2z\cos x+1}=\frac 1z\int\limits_0^{\pi}dx\,\left(1-\frac {1-z^2}{z^2-2z\cos x+1}\right)$$The first integral is trivial. The second one can be easily evaluated using a Weierstrass Substitution of $t=\tan\tfrac x2$$$\begin{align*}I'(z) & =\frac {\pi}z-\frac {2(1-z^2)}z\int\limits_0^{\infty}dt\space\frac {1}{\left[t(1+z)\right]^2+(1-z)^2}\\ & =\frac {\pi}z-\frac 2z\left.\arctan\left(\frac {1+z}{1-z}\tan\frac x2\right)\right|_0^{\pi}\end{align*}$$

The expression inside the arctangent function takes on two different values as $x$ varies from zero to $\pi$. When $|z|<1$, the fraction is always positive, even when $z$ is negative. Therefore, the whole expression evaluates to $\frac {\pi}2$. So$$I'(z)=0\qquad\qquad I(z)=C_1$$

And when $|z|>1$, the fraction is less than zero (can you see why?). So the expression actually evaluates to $-\frac {\pi}2$ and we get a different answer than before$$I'(z)=\frac {2\pi}z\qquad\qquad I(z)=2\pi\log z+C_2$$

To find the two constants, we make a substitution for $z$ that reduces the integral down to something we can easily evaluate. When $|z|<1$, the substitution $z=0$ gives $I(z)=0$, so we immediately see that $C_1=0$.

When $|z|>1$, we first make a substitution $z=\frac 1w$ where $|w|<1$ and use the result previously to get that $C_2$ is also equal to zero. Finally, we're left with

$$\int\limits_0^{\pi}dx\,\log\left(z^2-2z\cos x+1\right)=\left\{\begin{align*}2\pi\log z\qquad |z|>1\\\\0\qquad\space\space\qquad |z|\leq1\end{align*}\right.$$


For $|m|<1$, we have $$ \log(1+m^2-2m\cos x) = \log(1-me^{ix})(1-me^{-ix}) = \log{(1-me^{ix})}+\log(1-me^{-ix}) \\ = -\sum_{k=1}^{\infty} \frac{1}{k}m^k (e^{ikx}+e^{-ikx}) = -2\sum_{k=1}^{\infty} \frac{m^k}{k} \cos{kx}.$$

Thus: $$ \int_0^\pi\log(1+m^2-2m\cos x) dx=-2\sum_{k=1}^{\infty} \frac{m^k}{k}\int_0^\pi \cos{kx} dx=0. $$

For $|m|>1$, we can write: $$ \log(1+m^2-2m\cos x)=\log(1+m^{-2}-2m^{-1}\cos x)+\log m^2, $$ so that after integration one obtains $\pi \log m^2$.

Thus, finally $$\int_0^\pi\log(1+m^2-2m\cos x) dx=\begin{cases} 0,& |m|<1,\\ \pi\log m^2,& |m|>1.\\ \end{cases} $$

  • $\begingroup$ What if $m=1$ like your last equality states? Is it zero or $\pi\log m^2$? $\endgroup$ – Frank W. May 5 '18 at 21:51
  • $\begingroup$ @FrankW. Observe that $\log 1=0$, so that both answers are the same. $\endgroup$ – user May 5 '18 at 22:00

Note that $$I(m)=\int_{0}^{\pi} \log \left(m^2-2m\cos x+1\right)\: dx=\frac12\int_{0}^{2\pi} \log \left(m^2-2m\cos x+1\right)\: dx $$ and hence $$I(m)=\frac12\int_0^{2\pi}\frac{2m-2\cos x}{(m^2+1)-2m\cos x}\;dx. $$

Let $z=e^{ix}$ and then \begin{eqnarray} I'(m)&=&\frac12\int_0^{2\pi}\frac{2m-2\cos x}{(m^2+1)-2m\cos x}\;dx\\ &=&\frac12\int_{|z|=1}\frac{2m-(z+\frac1z)}{(m^2+1)-m(z+\frac1z)}\;\frac{dz}{iz}\\ &=&\frac1{2i}\int_{|z|=1}\frac{2mz-(z^2+1)}{z\bigg[(m^2+1)z-m(z^2+1)\bigg]}\;dz\\ &=&-\frac1{2mi}\int_{|z|=1}\frac{2mz-(z^2+1)}{z(z-m)(z-\frac1m)}\;dz. \end{eqnarray} Let $$ f(z)=\frac{2mz-(z^2+1)}{z(z-m)(z-\frac1m)}. $$ If $m<1$, then $f(z)$ has two poles $z=0$ and $z=m$ inside $|z|=1$ and hence $$ I'(m)=-\frac1{2mi}\cdot2\pi i\bigg[\text{Res}\bigg(f(z),z=m\bigg)+\text{Res}\bigg(f(z),z=0\bigg)\bigg]=0 $$ and hence $$ I(m)=C. $$ Since $I(0)=0$, so $C=0$ and hence $I(m)=0$. If $m>1$, then $f(z)$ has two poles $z=0$ and $z=\frac1m$ inside $|z|=1$ and hence $$ I'(m)=-\frac1{2mi}\cdot2\pi i\bigg[\text{Res}\bigg(f(z),z=\frac1m\bigg)+\text{Res}\bigg(f(z),z=0\bigg)\bigg]=\frac{2\pi}{m} $$ and hence $$ I(m)=2\pi\log m+C. $$ Since $I(1)=0$, so $C=0$ and hence $I(m)=2\pi\log m$.

  • $\begingroup$ In your solution different from the other two, the final expression has the same form both for $m <1$ and $m>1$. How can you explain this? $\endgroup$ – user May 5 '18 at 18:44
  • $\begingroup$ @user, I don't know. $\endgroup$ – xpaul May 5 '18 at 20:25
  • $\begingroup$ It seems that the argument goes wrong as soon as $z=m $ is inside the integration contour. $\endgroup$ – user May 6 '18 at 7:46
  • $\begingroup$ @user, I will check carefully. Thank you for pointing this. $\endgroup$ – xpaul May 6 '18 at 12:51
  • $\begingroup$ @EricTowers@user, I fixed the problem. $\endgroup$ – xpaul May 6 '18 at 15:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.