int_0^pi ln[1 - cos(x)] dx = - pi ln[2]
Is this easy?
int_0^pi ln[1 - cos(x)] dx = - pi ln[2]
Is this easy?
One observation is that by symmetry
int_0^pi ln[1 - cos(x)] dx = int 0^pi ln[1 + cos(x)] dx
and so the calculation is equivalent to
1/2 int_0^pi ln[ sin(x)^2 ] dx = 2 int_0^pi/2 ln[ sin(x) ] dx.
Now we can use a similar trick again:
int_0^pi/2 ln[ sin(x) ] dx = int_0^pi/2 ln[ cos(x) ] dx
so
4 int_0^pi/2 ln[ sin(x) ] dx = 2 int_0^pi/2 ln[ sin(x) cos(x) ]
= 2 int_0^pi/2 ln[1/2] dx + 2 int_0^pi/2 ln[sin(2x)] dx
= - pi ln[2] + int_0^pi ln[sin(u)] du
(using substitution u = 2x)
= -pi ln[2] + 2 int_0^pi/2 ln[ sin(x) ] dx
and so the original integral is -pi ln[2].
1 - cos(x) can be written as 2*cos^2(x/2)
Take the logarithm and you get 2ln (cos(x/2)), which is relatively common and the solution is https://www.quora.com/How-do-I-integrate-log-cos-x-from-0-to...
It's much easier to prove that the difference between the integral of log(a^2 - 2 a cos(x) + 1) and 2 pi log(a) goes to 0 when a goes to infinity.
Incidentally, your correct observation is in contradiction with f(a) = 2 pi log(|a|) since the latter only holds for |a| >= 1. This is because f(a) is not a smooth function.