6

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?

Umesh shankar
  • 10,219

3 Answers3

9

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.$$

Frank W
  • 5,897
6

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$.

xpaul
  • 44,000
  • 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? – user May 05 '18 at 18:44
  • @user, I don't know. – xpaul May 05 '18 at 20:25
  • It seems that the argument goes wrong as soon as $z=m $ is inside the integration contour. – user May 06 '18 at 07:46
  • @user, I will check carefully. Thank you for pointing this. – xpaul May 06 '18 at 12:51
  • @EricTowers@user, I fixed the problem. – xpaul May 06 '18 at 15:50
  • Is it legitimate to use $I (0) $ for determining the integration constant in the case $m>1$? – user May 08 '18 at 05:50
  • @user, I made a mistake again. $I(1)$ should be used to determine $C$ for $m>1$. – xpaul May 08 '18 at 12:28
  • I am not sure that one can use the value at $m=1$, as this case is neither $m<1$ nor $m>1$ and the argument can be applied only if the function $I(m)$ is assumed to be continuous, which is probably indeed the case for $m=\pm1$. However general behavior of the function in the complex plane seems to be much more tricky in the vicinity of the circle $|m|=1$ (if one applies your method onto this case one obtains $I(m)=\pi\log m$ with the consequence that imaginary part of the function is discontinuous). BTW certainly you mean $I'(m)$ already in the second equation. – user May 08 '18 at 13:53
6

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} $$

user
  • 26,272