The definite integral to evaluate was:

$\int_0^{2\pi} \log\left(1 + x^2 - 2x\cos\theta\right) d\theta$

I didn’t know how to do it, so I posted on the physics forum, and somebody named ‘adriank’ helped me out.
Here’s how it goes:

It would be hard to find a substitution to make this work directly. But if the logarithm were something more congenial, like

$\int \log(1+x\theta)d\theta$

maybe we’d have a better shot.

You might be used to pulling this sort of trick:

$\log(24)=\log(2*2*2*3) = 3\log(2) + \log(3)$

We can do the same sort of thing by factoring that quadratic inside the logarithm. So we want to factor

$x^2 - 2x\cos\theta + 1$

Set it equal to zero and use the quadratic formula to find the roots.

$x^2 - 2x\cos\theta + 1 = 0$
$x = \frac{2\cos\theta \pm \sqrt{4\cos^2\theta - 4}}{2} = \cos\theta \pm \sqrt{-(1-\cos^2\theta)} = \cos\theta \pm i\sin\theta = e^{\pm i\theta}$

therefore

$\int_0^{2\pi} \log\left(1 + x^2 - 2x\cos\theta\right) d\theta$
$= \int_0^{2\pi} \log\left((x-e^{i\theta})(x-e^{-i\theta}) \right) d\theta$
$= \int_0^{2\pi} \log\left((1-xe^{i\theta})(1-xe^{-i\theta}) \right) d\theta$
$= \int_0^{2\pi} \left(\log(1-xe^{i\theta}) + \log(1-xe^{-i\theta})\right) d\theta$

now, so long as $\|t\|<1$, we can expand $\log(1-t)$ as a Taylor series:
$\log(1-t) =-t - \frac{t^2}{2} - \frac{t^3}{3} - \ldots = \sum_{n=1}^{\infty}-\frac{t^n}{n}$

applying to the integral:
$\int_0^{2\pi} \left(\log(1-xe^{i\theta}) + \log(1-xe^{-i\theta})\right) d\theta$
$=\int_0^{2\pi} \sum_{n=1}^\infty \frac{-x^ne^{in\theta}}{n} + \sum_{n=1}^\infty \frac{-x^ne^{-in\theta}}{n} d\theta$
$= -\sum_{n=1}^\infty \frac{x^n}{n} \int_0^{2*\pi}e^{in\theta}+e^{-in\theta} d\theta$
$= -\sum_{n=1}^\infty \frac{x^n}{n} \int_0^{2*\pi}2*\cos(n\theta) d\theta = 0$

### 2 Responses to “Answer: Integral”

1. kiwi Says:

If x > 1 then the value of the integral is 4 pi log(x) – you can show this by writing

log(1 – xe^ith) = log(-xe^ith) + log(1 – 1/xe^ith) and using the power series for the last term which now converges for x > 1.

2. meichenl Says:

cool, thanks kiwi!

Working through it as you suggest, I at first got $4 \pi \ln x + 4 \pi^2 i$, so it looks like I need to be careful with the branch of the natural logarithm I’m choosing