Using the property ∫0af(x)dx=∫0af(a−x)dx and the identity 1+cos(π−x)=1−cosx, we add the two forms to simplify the integral to ∫0πlog(sin2x)dx, which evaluates to −πlog2.
The trick here is that the integrand log(1+cosx) doesn't have a nice antiderivative you can write down easily. But definite integrals have symmetry properties that let us transform the problem into something simpler. The key property is:
∫0af(x)dx=∫0af(a−x)dx
This works because as x runs from 0 to a, the quantity a−x runs from a to 0, covering the same interval in reverse. The area under the curve doesn't care about direction.
Let's apply this to our integral.
- Write the original integral.
Let
I=∫0πlog(1+cosx)dx.
- Apply the symmetry property with a=π.
Replace x by π−x:
I=∫0πlog(1+cos(π−x))dx.
Now cos(π−x)=−cosx, so
I=∫0πlog(1−cosx)dx.
- Add the two expressions for I.
We now have two different-looking integrals that are actually equal. Adding them gives:
2I=∫0π[log(1+cosx)+log(1−cosx)]dx.
Using logA+logB=log(AB):
2I=∫0πlog((1+cosx)(1−cosx))dx.
- Simplify the product.
(1+cosx)(1−cosx)=1−cos2x=sin2x. So
2I=∫0πlog(sin2x)dx.
And log(sin2x)=2log∣sinx∣. Since sinx≥0 on [0,π], we can drop the absolute value:
2I=2∫0πlog(sinx)dx.
Cancel the factor of 2:
I=∫0πlog(sinx)dx.
A common mistake is to forget that log(sin2x)=2log∣sinx∣, not 2log(sinx) — but on [0,π], sinx is non-negative, so it's safe.
- Evaluate the standard integral ∫0πlog(sinx)dx.
This is a classic result. One elegant way uses the same symmetry trick again. Let
J=∫0πlog(sinx)dx.
Replace x by π−x: since sin(π−x)=sinx, we get J=J — that doesn't help directly. Instead, use the substitution x=2t:
J=∫0π/2log(sin2t)⋅2dt=2∫0π/2log(2sintcost)dt. …