Class 12 Maths, Worked in Full Past papersGet updates
Chapter 7 · Integrals

Example 34: ∫0π/2log⁡sin⁡x dx\int_0^{\pi/2}\log\sin x\,dx

ExamplesProperties of definite integrals (P4, P6) · Section 7.10
The question

Evaluate

∫0π/2log⁡sin⁡x dx\int_0^{\pi/2} \log \sin x\,dx
Exam answer Let I=∫0π2log⁡sin⁡x dx…(i)\text{Let } I = \int_0^{\frac{\pi}{2}}\log\sin x\,dx\quad\ldots(\text{i})

Using ∫0af(x) dx=∫0af(a−x) dx\displaystyle\int_0^a f(x)\,dx = \int_0^a f(a - x)\,dx⁠,

I=∫0π2log⁡sin⁡(π2−x)dx=∫0π2log⁡cos⁡x dx…(ii)\begin{aligned} I &= \int_0^{\frac{\pi}{2}}\log\sin\left(\frac{\pi}{2} - x\right)dx \\ &= \int_0^{\frac{\pi}{2}}\log\cos x\,dx\quad\ldots(\text{ii}) \end{aligned}

Adding (i) and (ii),

2I=∫0π2(log⁡sin⁡x+log⁡cos⁡x)dx=∫0π2log⁡(sin⁡xcos⁡x) dx\begin{aligned} 2I &= \int_0^{\frac{\pi}{2}}\left(\log\sin x + \log\cos x\right)dx \\ &= \int_0^{\frac{\pi}{2}}\log(\sin x\cos x)\,dx \end{aligned}

Using sin⁡xcos⁡x=sin⁡2x2\sin x\cos x = \frac{\sin 2x}{2}⁠,

2I=∫0π2(log⁡sin⁡2x−log⁡2)dx=∫0π2log⁡sin⁡2x dx−π2log⁡2…(iii)\begin{aligned} 2I &= \int_0^{\frac{\pi}{2}}\left(\log\sin 2x - \log 2\right)dx \\ &= \int_0^{\frac{\pi}{2}}\log\sin 2x\,dx \\ &\quad - \frac{\pi}{2}\log 2\quad\ldots(\text{iii}) \end{aligned}

Put 2x=t2x = t⁠. Then 2 dx=dt2\,dx = dt⁠.

When x=0x = 0⁠, t=0t = 0⁠; when x=π2x = \frac{\pi}{2}⁠, t=πt = \pi⁠.

∫0π2log⁡sin⁡2x dx=12∫0πlog⁡sin⁡t dt\begin{aligned} &\int_0^{\frac{\pi}{2}}\log\sin 2x\,dx \\ &= \frac12\int_0^{\pi}\log\sin t\,dt \end{aligned}

Using ∫02af(t) dt=2∫0af(t) dt\displaystyle\int_0^{2a} f(t)\,dt = 2\int_0^a f(t)\,dt when f(2a−t)=f(t)f(2a - t) = f(t)⁠, and log⁡sin⁡(π−t)=log⁡sin⁡t\log\sin(\pi - t) = \log\sin t⁠,

12∫0πlog⁡sin⁡t dt=12⋅2∫0π2log⁡sin⁡t dt=∫0π2log⁡sin⁡x dx=I\begin{aligned} &\frac12\int_0^{\pi}\log\sin t\,dt \\ &= \frac12\cdot 2\int_0^{\frac{\pi}{2}}\log\sin t\,dt \\ &= \int_0^{\frac{\pi}{2}}\log\sin x\,dx = I \end{aligned}

Putting this in (iii),

2I=I−π2log⁡22I = I - \frac{\pi}{2}\log 2

∴ I=−π2log⁡2\therefore\ I = -\dfrac{\pi}{2}\log 2⁠.

Want the reason behind every step, the basics and the checks?

The one idea this problem is built on

Nobody can write down an antiderivative of log⁡sin⁡x\log\sin x with the functions of this course, so the fundamental theorem is no help. Instead we make the integral reproduce itself. P4 says the integral of log⁡sin⁡x\log \sin x equals that of log⁡cos⁡x\log\cos x⁠; adding them gives log⁡(sin⁡xcos⁡x)=log⁡sin⁡2x−log⁡2\log(\sin x\cos x) = \log\sin 2x - \log 2⁠; and the integral of log⁡sin⁡2x\log \sin 2x turns out (by a substitution and P6) to be the original integral II again. That leaves an equation 2I=I−π2log⁡22I = I - \frac{\pi}{2}\log 2⁠, which we solve for II⁠.

Given, to find, and the plan
Given
I=∫0π/2log⁡sin⁡x dxI = \displaystyle\int_0^{\pi/2} \log \sin x\,dx⁠, where log⁡\log is the natural logarithm (base ee⁠), as everywhere in this chapter.
To find
The exact value of II⁠.
Plan
(1) Deal with the endpoint x=0x = 0⁠, where log⁡sin⁡x\log\sin x is undefined, and show II is a finite number. (2) P4: I=∫0π/2log⁡cos⁡x dxI = \int_0^{\pi/2}\log\cos x\,dx⁠. (3) Add: 2I2I is the integral of log⁡sin⁡2x−log⁡2\log\sin 2x - \log 2⁠. (4) Substitute t=2xt = 2x⁠. (5) P6 on [0,π][0, \pi] gives back II⁠. (6) Solve.

Basics you need

1P4 and P6 (Section 7.10)

P4: ∫0af(x) dx=∫0af(a−x) dx\int_0^a f(x)\,dx = \int_0^a f(a-x)\,dx⁠. P6: ∫02af(x) dx=2∫0af(x) dx\int_0^{2a} f(x)\,dx = 2\int_0^a f(x)\,dx if f(2a−x)=f(x)f(2a-x) = f(x)⁠. Lesson: properties of definite integrals

2Laws of logarithms

For p,q>0p, q > 0⁠: log⁡p+log⁡q=log⁡(pq)\log p + \log q = \log(pq)⁠, and log⁡pq=log⁡p−log⁡q\log\frac{p}{q} = \log p - \log q⁠. Only positive numbers have logarithms. Basics: logarithms

3Trigonometric facts

sin⁡(π2−x)=cos⁡x\sin\left(\frac{\pi}{2}-x\right) = \cos x⁠, sin⁡(π−t)=sin⁡t\sin(\pi - t) = \sin t⁠, and sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2\sin x\cos x⁠. Basics: trigonometric identities

4Substitution in a definite integral (Section 7.9)

Change the variable, write the new differential, and change the limits to the values of the new variable. Lesson: integration by substitution

Solution

  1. The trouble at x=0x = 0⁠, and why II is still a finite number

    On 0<x≤π20 < x \le \frac{\pi}{2} we have 0<sin⁡x≤10 < \sin x \le 1⁠, so log⁡sin⁡x\log \sin x is defined, continuous and ≤0\le 0⁠. But at x=0x = 0⁠, sin⁡0=0\sin 0 = 0 has no logarithm, and as x→0+x \to 0^+⁠, log⁡sin⁡x→−∞\log\sin x \to -\infty⁠. So the integrand is not continuous on the closed interval [0,π2][0, \frac{\pi}{2}]⁠, and Theorem 2 of Section 7.8.3 does not apply directly (Remark (iv) there asks for a function continuous on [a,b][a, b]⁠). Such an integral is called improper: it means the limit of ∫επ/2log⁡sin⁡x dx\int_\varepsilon^{\pi/2}\log\sin x\,dx as ε→0+\varepsilon \to 0^+⁠. The textbook does not raise this point, but the method below needs II to be a finite number, so we check it.

    The graph of sin⁡\sin is concave on [0,π2][0, \frac{\pi}{2}]⁠, so it lies above its chord from (0,0)(0, 0) to (π2,1)(\frac{\pi}{2}, 1)⁠:

    sin⁡x≥2xπ(0≤x≤π2).\sin x \ge \frac{2x}{\pi} \qquad \left(0 \le x \le \frac{\pi}{2}\right).

    Since log⁡\log is increasing, for 0<x≤π20 < x \le \frac{\pi}{2}⁠:

    log⁡2xπ≤log⁡sin⁡x≤0.\log\frac{2x}{\pi} \le \log\sin x \le 0 .

    With u=2xπu = \frac{2x}{\pi} (so dx=π2 dudx = \frac{\pi}{2}\,du⁠) and ∫log⁡u du=ulog⁡u−u\int \log u\,du = u\log u - u⁠:

    ∫0π/2log⁡2xπ dx=π2[ulog⁡u−u]01=−π2,\int_0^{\pi/2}\log\frac{2x}{\pi}\,dx = \frac{\pi}{2}\Big[u\log u - u\Big]_0^1 = -\frac{\pi}{2},

    using ulog⁡u→0u\log u \to 0 as u→0+u \to 0^+⁠. So the negative function log⁡sin⁡x\log \sin x is squeezed between log⁡2xπ\log\frac{2x}{\pi}⁠, whose integral is finite, and 0. Its integral therefore converges, and

    −π2≤I≤0.-\frac{\pi}{2} \le I \le 0 .
    This matters in Step 6, where we subtract II from both sides of an equation. That is only allowed for a finite number: "∞=∞−c\infty = \infty - c" tells us nothing. The same bound (reflected or rescaled) shows that every other integral below, of log⁡cos⁡x\log\cos x⁠, log⁡sin⁡2x\log\sin 2x and log⁡sin⁡t\log\sin t on [0,π][0, \pi]⁠, is also finite. The properties P0 to P7 and the substitution rule then hold for them too, because each one can be applied on a slightly shorter closed interval, where everything is continuous, before letting the cut-off shrink to 0.
    Concave means d2dx2sin⁡x=−sin⁡x≤0\frac{d^2}{dx^2}\sin x = -\sin x \le 0 on [0,π2][0, \frac{\pi}{2}]⁠: the curve bends downwards, so it stays above any chord. The antiderivative ulog⁡u−uu\log u - u of log⁡u\log u is found by parts in Section 7.6 (check: its derivative is log⁡u+1−1\log u + 1 - 1⁠).
  2. P4: the same integral with cos⁡\cos in place of sin⁡\sin

    P4 with upper limit a=π2a = \frac{\pi}{2} replaces xx by π2−x\frac{\pi}{2} - x⁠:

    I=∫0π/2log⁡sin⁡(π2−x)dx=∫0π/2log⁡cos⁡x dx.I = \int_0^{\pi/2}\log\sin\left(\frac{\pi}{2}-x\right)dx = \int_0^{\pi/2}\log\cos x\,dx .
    Replacing xx by π2−x\frac{\pi}{2} - x reads the interval [0,π2][0, \frac{\pi}{2}] backwards, so the area does not change. On this interval it turns sin⁡\sin into cos⁡\cos⁠: the graph of log⁡cos⁡x\log\cos x is the mirror image of the graph of log⁡sin⁡x\log\sin x in the line x=π4x = \frac{\pi}{4} (see the figure in Step 6).
    sin⁡(π2−x)=cos⁡x\sin\left(\frac{\pi}{2} - x\right) = \cos x⁠. Basics: symmetry and mirror images
  3. Add the two forms of II

    2I=∫0π/2(log⁡sin⁡x+log⁡cos⁡x) dx=∫0π/2log⁡(sin⁡xcos⁡x) dx.2I = \int_0^{\pi/2}\big(\log\sin x + \log\cos x\big)\,dx = \int_0^{\pi/2}\log(\sin x\cos x)\,dx .

    Now the book adds and subtracts log⁡2\log 2 and asks "Why?". The reason is the double-angle formula: 2sin⁡xcos⁡x=sin⁡2x2\sin x\cos x = \sin 2x⁠. So

    log⁡(sin⁡xcos⁡x)=log⁡(2sin⁡xcos⁡x)−log⁡2=log⁡sin⁡2x−log⁡2.\begin{aligned}\log(\sin x\cos x) &= \log(2\sin x\cos x) - \log 2\\ &= \log\sin 2x - \log 2 .\end{aligned}

    Integrating each term (the constant log⁡2\log 2 integrates to π2log⁡2\frac{\pi}{2}\log 2 over an interval of length π2\frac{\pi}{2}⁠):

    2I=∫0π/2log⁡sin⁡2x dx−π2log⁡2.2I = \int_0^{\pi/2}\log\sin 2x\,dx - \frac{\pi}{2}\log 2 .
    For 0<x<π20 < x < \frac{\pi}{2} both sin⁡x\sin x and cos⁡x\cos x are positive, so log⁡sin⁡x+log⁡cos⁡x=log⁡(sin⁡xcos⁡x)\log\sin x + \log\cos x = \log(\sin x\cos x) is a correct use of the product law. We want a single sine, because a single sine can be turned back into the original integral; the factor 22 is exactly what sin⁡xcos⁡x\sin x\cos x is missing to become sin⁡2x\sin 2x⁠.
    log⁡(pq)=log⁡p+log⁡q\log(pq) = \log p + \log q for p,q>0p, q > 0 (here p=2p = 2⁠, q=sin⁡xcos⁡xq = \sin x\cos x⁠). Basics: logarithms
  4. Substitute t=2xt = 2x in the first integral

    Put t=2xt = 2x⁠. Then dt=2 dxdt = 2\,dx⁠, so dx=12 dtdx = \frac{1}{2}\,dt⁠. When x=0x = 0⁠, t=0t = 0⁠; when x=π2x = \frac{\pi}{2}⁠, t=πt = \pi⁠. Hence

    ∫0π/2log⁡sin⁡2x dx=12∫0πlog⁡sin⁡t dt,\int_0^{\pi/2}\log\sin 2x\,dx = \frac{1}{2}\int_0^{\pi}\log\sin t\,dt ,

    and

    2I=12∫0πlog⁡sin⁡t dt−π2log⁡2.2I = \frac{1}{2}\int_0^{\pi}\log\sin t\,dt - \frac{\pi}{2}\log 2 .
    The substitution makes the argument of sin⁡\sin a single variable again, at the price of doubling the interval to [0,π][0, \pi]⁠. The map x↦2xx \mapsto 2x is increasing and takes [0,π2][0, \frac{\pi}{2}] exactly onto [0,π][0, \pi]⁠, so it is a legitimate change of variable on the whole interval. On 0<t<π0 < t < \pi⁠, sin⁡t>0\sin t > 0⁠, so log⁡sin⁡t\log\sin t is defined there.
    Section 7.9: change the limits along with the variable, then there is no need to substitute back. Basics: substitution
  5. P6 folds [0,π][0, \pi] back onto [0,π2][0, \frac{\pi}{2}]

    Take f(t)=log⁡sin⁡tf(t) = \log\sin t and 2a=π2a = \pi⁠, so a=π2a = \frac{\pi}{2}⁠. The condition of P6 holds:

    f(π−t)=log⁡sin⁡(π−t)=log⁡sin⁡t=f(t).f(\pi - t) = \log\sin(\pi - t) = \log\sin t = f(t) .

    So P6 gives

    ∫0πlog⁡sin⁡t dt=2∫0π/2log⁡sin⁡t dt=2I,\int_0^{\pi}\log\sin t\,dt = 2\int_0^{\pi/2}\log\sin t\,dt = 2I ,

    where the last equality is just P0: the name of the variable does not matter. Therefore

    2I=12⋅2I−π2log⁡2=I−π2log⁡2.2I = \frac{1}{2}\cdot 2I - \frac{\pi}{2}\log 2 = I - \frac{\pi}{2}\log 2 .
    The graph of sin⁡t\sin t on [0,π][0, \pi] is symmetric about t=π2t = \frac{\pi}{2}⁠, so the two halves [0,π2][0, \frac{\pi}{2}] and [π2,π][\frac{\pi}{2}, \pi] contribute equally. The left half is our original integral. This is the moment the integral "reproduces itself".
    sin⁡(π−t)=sin⁡t\sin(\pi - t) = \sin t (supplementary angles). P0: ∫abf(t) dt=∫abf(x) dx\int_a^b f(t)\,dt = \int_a^b f(x)\,dx⁠.
  6. Solve for II

    Subtract II from both sides (allowed because II is a finite number, Step 1):

    I=−π2log⁡2≈−1.088793.I = -\frac{\pi}{2}\log 2 \approx -1.088793 .

    This lies between −π2≈−1.570796-\frac{\pi}{2} \approx -1.570796 and 0, as Step 1 promised. It is negative because log⁡sin⁡x≤0\log\sin x \le 0 on the whole interval: the region lies below the xx-axis.

    x y O π/4 π/2 −1 −2 −3 blue: y = log sin x; dashed violet: y = log cos x shaded: I = −(π/2) log 2 ≈ −1.0888, below the axis each curve falls to −∞ at one end (drawn down to y = −3.2)
    y=log⁡sin⁡xy = \log\sin x (blue) and its mirror image y=log⁡cos⁡xy = \log\cos x (dashed violet) on (0,π2)(0, \frac{\pi}{2})⁠. The shaded region between the blue curve and the axis lies below the axis, so it counts as negative area: I=−π2log⁡2≈−1.0888I = -\frac{\pi}{2}\log 2 \approx -1.0888⁠. The curve plunges to −∞-\infty at x=0x = 0 (it is drawn down to y=−3.2y = -3.2⁠), yet the shaded area is finite.
    The final answer can also be read as: the average value of log⁡sin⁡x\log\sin x over [0,π2][0, \frac{\pi}{2}] is Iπ/2=−log⁡2\frac{I}{\pi/2} = -\log 2⁠, the same as log⁡12\log\frac{1}{2}⁠.
Result

∫0π/2log⁡sin⁡x dx=−π2log⁡2≈−1.088793\int_0^{\pi/2}\log\sin x\,dx = -\frac{\pi}{2}\log 2 \approx -1.088793 (an improper but convergent integral). By Step 2 the same value holds for ∫0π/2log⁡cos⁡x dx\int_0^{\pi/2}\log\cos x\,dx⁠.

Check it with numbers

Numerical integration (adaptive quadrature, which copes with the logarithmic endpoint) gives ∫0π/2log⁡sin⁡x dx≈−1.0887930452\int_0^{\pi/2}\log\sin x\,dx \approx -1.0887930452⁠, and −π2log⁡2≈−1.0887930452-\frac{\pi}{2}\log 2 \approx -1.0887930452⁠.

It also confirms the intermediate results: ∫0πlog⁡sin⁡t dt≈−2.177586≈2I\int_0^{\pi}\log\sin t\,dt \approx -2.177586 \approx 2I (Step 5) and ∫0π/2log⁡sin⁡2x dx≈−1.088793≈I\int_0^{\pi/2}\log\sin 2x\,dx \approx -1.088793 \approx I (Steps 4 and 5 together). At the midpoint, log⁡sin⁡π4=−12log⁡2≈−0.346574\log\sin\frac{\pi}{4} = -\frac12\log 2 \approx -0.346574⁠.

Common mistakes
  1. Splitting log⁡(sin⁡xcos⁡x)\log(\sin x\cos x) into log⁡sin⁡x⋅log⁡cos⁡x\log\sin x \cdot \log\cos x⁠. The log of a product is the sum of the logs.
  2. Forgetting the factor 12\frac12 from dx=12 dtdx = \frac12\,dt, or forgetting to change the upper limit from π2\frac{\pi}{2} to π\pi⁠. Either slip destroys the cancellation in Step 5.
  3. Applying P6 without checking f(2a−x)=f(x)f(2a - x) = f(x)⁠. Here it holds because sin⁡(π−t)=sin⁡t\sin(\pi - t) = \sin t⁠; with cos⁡\cos on [0,π][0, \pi] it would fail (cos⁡(π−t)=−cos⁡t\cos(\pi - t) = -\cos t⁠, and log⁡cos⁡t\log\cos t is not even defined for t>π2t > \frac{\pi}{2}⁠).
  4. Ignoring the endpoint. Solving 2I=I−c2I = I - c assumes II is finite. For an integral that diverges, the same algebra would produce a meaningless "answer".
What to take away
  1. When no antiderivative is available, look for a chain of properties that brings the integral back to itself, then solve the resulting equation for II⁠.
  2. P4 (x→a−xx \to a - x⁠) and P6 (folding [0,2a][0, 2a] in half) are the two tools; a substitution like t=2xt = 2x links an integral on [0,π2][0, \frac{\pi}{2}] with one on [0,π][0, \pi]⁠.
  3. Remember the value: ∫0π/2log⁡sin⁡x dx=∫0π/2log⁡cos⁡x dx=−π2log⁡2.\int_0^{\pi/2}\log\sin x\,dx = \int_0^{\pi/2}\log\cos x\,dx = -\frac{\pi}{2}\log 2 . It is used again in Exercise 7.10, Q10 and Q16. It also gives ∫0π/2log⁡tan⁡x dx=0\int_0^{\pi/2}\log\tan x\,dx = 0 at once, since log⁡tan⁡x=log⁡sin⁡x−log⁡cos⁡x\log\tan x = \log\sin x - \log\cos x on (0,π2)(0, \frac{\pi}{2})⁠.

Every fact used, and where it comes from

FactUsed inSource
A definite integral needs ff continuous on [a,b][a, b]Step 1Remark (iv) after Theorem 2, Section 7.8.3
sin⁡x≥2xπ\sin x \ge \frac{2x}{\pi} on [0,π2][0, \frac{\pi}{2}]Step 1Concavity of sin⁡\sin on [0,π2][0, \frac{\pi}{2}] (a concave curve lies above its chords); beyond this textbook
∫log⁡u du=ulog⁡u−u+C\int\log u\,du = u\log u - u + CStep 1Integration by parts, Section 7.6
P4: ∫0af(x) dx=∫0af(a−x) dx\int_0^a f(x)\,dx = \int_0^a f(a-x)\,dxStep 2Section 7.10, property P4 (Lesson: properties)
log⁡p+log⁡q=log⁡pq\log p + \log q = \log pq⁠; sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2\sin x\cos xStep 3Laws of logarithms; Class XI trigonometry
Substitution with changed limitsStep 4Section 7.9
P6 with f(2a−x)=f(x)f(2a - x) = f(x)⁠; P0Step 5Section 7.10, properties P6 and P0
Found an error, or want more?

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 →