Want the reason behind every step, the basics and the checks?
The one idea this problem is built on
Use sin2x=2sinxcosx to break logsin2x into log2+logsinx+logcosx. The integrand becomes logsinx−logcosx−log2. Property P4 on [0,2π] swaps sin and cos, so logsinx and logcosx have the same integral and cancel. Only the constant −log2 survives.
Given, to find, and the plan
Given
I, the integral of 2logsinx−logsin2x over [0,2π], with log the natural logarithm.
To find
The exact value of I, and its decimal value.
Plan
Note where the integrand is defined (the endpoints are a problem); simplify it with the double-angle formula; show the pieces have finite integrals; use P4 to cancel logsinx against logcosx; integrate the constant. Confirm by a second route through Example 34 and P6.
Basics you need
1Laws of logarithms
For p,q>0:log(pq)=logp+logq. Only positive numbers have logarithms. Basics: logarithms
∫0π/2logsinxdx=−2πlog2, and this integral is finite even though logsinx→−∞ as x→0+.Example 34
Solution
Where the integrand is defined
For 0<x<2π: sinx>0 and 0<2x<π, so sin2x>0. Both logarithms are defined and the integrand is continuous on the open interval. At the ends, sin0=0 and sin(2⋅2π)=sinπ=0, whose logarithms do not exist.
So, strictly, this is an improper integral at both ends: it means the limit of the integral over [ε,2π−δ] as ε,δ→0+. The book does not raise the point, but we need the integral to be a finite number before calculating with it. Step 3 settles this.
For 0<x<2π, all of 2, sinx,cosx are positive, so
logsin2x=log(2sinxcosx)=log2+logsinx+logcosx.
Hence
2logsinx−logsin2x=logsinx−logcosx−log2.
The product law of logarithms needs every factor positive, which holds on the open interval. One of the two copies of logsinx is cancelled by the logsinx inside logsin2x.
log(pq)=logp+logq for p,q>0, used twice; sin2x=2sinxcosx.Basics: logarithms
Each piece has a finite integral
Our worked solution of Example 34 (its Step 1; the book's own solution does not discuss this point) shows that logsinx≤0 on (0,2π] and that ∫0π/2logsinxdx is finite. The same holds for logcosx (Step 4 shows its integral is the same number). So we may split:
I=∫02πlogsinxdx−∫02πlogcosxdx−∫02πlog2dx.
Splitting an integral into a difference of integrals is only safe when each part is a finite number; "∞−∞" would mean nothing. That step squeezes logsinx between logπ2x (whose integral over [0,2π] is −2π) and 0.
Linearity: ∫(f−g−h)=∫f−∫g−∫h when all three are finite. Example 34
P4: the logsin and logcos integrals are equal
Take f(x)=logsinx and a=2π. Then
f(2π−x)=logsin(2π−x)=logcosx,
so P4 gives
∫02πlogsinxdx=∫02πlogcosxdx.
The first two integrals in Step 3 cancel.
P4 is proved by the substitution t=2π−x. Here we apply it on [ε,2π], where logsinx is continuous: it gives ∫επ/2logsinxdx=∫0π/2−εlogcosxdx. Letting ε→0+ gives the equality of the two finite integrals. In pictures, logcosx is the mirror image of logsinx in x=4π.
The book writes this as 2πlog21. They are equal, because log21=log1−log2=−log2.
The constant log2 integrates to log2 times the interval length 2π. The answer is negative because the integrand, log2tanx, is below the axis on most of the interval (it is negative wherever tanx<2).
The two cancelling terms combine into logsinx−logcosx=logtanx. Replacing x by 2π−x gives logcotx=−logtanx, so the graph of logtanx is unchanged by a half turn about (4π,0), the way an odd function behaves about the origin.
y=logtanx on (0,2π) (drawn between y=−3 and y=3; it tends to −∞ at 0 and to +∞ at 2π). The rose region below the axis on (0,4π) is a half-turn copy of the green region above the axis on (4π,2π): they count as −A and +A and cancel. The actual integrand is this curve lowered by log2, so I=0−2πlog2.
This is the same cancellation as P7(ii) for odd functions, centred at x=4π instead of 0. The equation K=−K, with K=∫0π/2logtanxdx, forces K=0.
Let J=∫0π/2logsinxdx=−2πlog2 (Example 34). For logsin2x, put t=2x,dx=21dt, limits 0 to π:
∫02πlogsin2xdx=21∫0πlogsintdt=21⋅2J=J,
by P6 with 2a=π, since logsin(π−t)=logsint. So
I=2J−J=J=−2πlog2.
Two independent routes agree. The P6 condition f(2a−t)=f(t) holds because sin(π−t)=sint: the graph of logsint on [0,π] is symmetric about t=2π.
Substitution in a definite integral (Section 7.9); P6, Section 7.10; Example 34.
Result
∫02π(2logsinx−logsin2x)dx=−2πlog2≈−1.0887930
(an improper but convergent integral). (Textbook answer: 2πlog21, which is the same number since log21=−log2.)
Check it with numbers
Adaptive numerical integration, which copes with the logarithmic endpoints, gives −1.0887930 for the original integrand, and −2πlog2≈−1.0887930. It gives 0.0000000 for ∫0π/2logtanxdx (Step 6) and −1.0887930 for each of ∫0π/2logsinxdx and ∫0π/2logcosxdx (Step 4). At x=0.5 the integrand is 2logsin0.5−logsin1, about −1.2977296, and log2tan0.5≈−1.2977296 as Step 2 says.
Common mistakes
Writing logsin2x=2logsinx.sin2x is not (sinx)2; it is 2sinxcosx.
Splitting the integral before knowing each part is finite. Each part here does converge (Step 3), but that has to be checked.
Thinking the answer differs from the book's.2πlog21 and −2πlog2 are the same number.
What to take away
∫0π/2logsinxdx=∫0π/2logcosxdx by P4; so ∫0π/2logtanxdx=0.
Simplify a logarithmic integrand with the log laws (after checking positivity) before integrating.
When an integrand blows up at an endpoint, check that the integral is finite before doing algebra with it.
Tell us if something on this page is wrong or unclear, or if you would like a fuller explanation, another method or a new feature. Send feedback on this problem →