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

Exercise 7.10 · Q8: ∫0π/4log⁡(1+tan⁡x) dx\int_0^{\pi/4}\log(1+\tan x)\,dx

Exercise 7.10Properties of definite integrals (P4) · Section 7.10
The question

By using the properties of definite integrals, evaluate the integrals in Exercises 1 to 19.

8. ∫0π4log⁡(1+tan⁡x) dx\displaystyle\int_0^{\frac{\pi}{4}}\log(1 + \tan x)\,dx

Exam answer

Let

I=∫0π4log⁡(1+tan⁡x) dx…(i)I = \int_0^{\frac{\pi}{4}}\log(1 + \tan 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 and tan⁡(π4−x)=1−tan⁡x1+tan⁡x\tan\left(\frac{\pi}{4} - x\right) = \frac{1 - \tan x}{1 + \tan x}⁠,

I=∫0π4log⁡(1+tan⁡(π4−x))dx=∫0π4log⁡(1+1−tan⁡x1+tan⁡x)dx=∫0π4log⁡21+tan⁡x dx=∫0π4log⁡2 dx−∫0π4log⁡(1+tan⁡x) dx=π4log⁡2−I[using (i)]\begin{aligned} I &= \int_0^{\frac{\pi}{4}}\log\left(1 + \tan\left(\frac{\pi}{4} - x\right)\right)dx \\ &= \int_0^{\frac{\pi}{4}}\log\left(1 + \frac{1 - \tan x}{1 + \tan x}\right)dx \\ &= \int_0^{\frac{\pi}{4}}\log\frac{2}{1 + \tan x}\,dx \\ &= \int_0^{\frac{\pi}{4}}\log 2\,dx \\ &\quad - \int_0^{\frac{\pi}{4}}\log(1 + \tan x)\,dx \\ &= \frac{\pi}{4}\log 2 - I\quad[\text{using (i)}] \end{aligned}

∴ 2I=π4log⁡2\therefore\ 2I = \frac{\pi}{4}\log 2⁠.

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

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

The one idea this problem is built on

No antiderivative of log⁡(1+tan⁡x)\log(1 + \tan x) is available, so we let the integral reproduce itself. Property P4 with a=π4a = \frac{\pi}{4} replaces tan⁡x\tan x by tan⁡(π4−x)=1−tan⁡x1+tan⁡x\tan\left(\frac{\pi}{4} - x\right) = \frac{1 - \tan x}{1 + \tan x}⁠, and then 1+tan⁡(π4−x)=21+tan⁡x1 + \tan\left(\frac{\pi}{4} - x\right) = \frac{2}{1 + \tan x}⁠. Its logarithm is log⁡2−log⁡(1+tan⁡x)\log 2 - \log(1 + \tan x)⁠: a constant minus the original integrand. That gives an equation for II⁠.

Given, to find, and the plan
Given
I=∫0π/4log⁡(1+tan⁡x) dxI = \int_0^{\pi/4}\log(1 + \tan x)\,dx⁠, with log⁡\log the natural logarithm, as throughout this chapter.
To find
The exact value of II⁠, and its decimal value.
Plan
Check the integrand is continuous; apply P4; simplify 1+tan⁡(π4−x)1 + \tan\left(\frac{\pi}{4} - x\right)⁠; split the logarithm; get I=π4log⁡2−II = \frac{\pi}{4}\log 2 - I⁠; solve.

Basics you need

1Property P4 (Section 7.10)

∫0af(x) dx=∫0af(a−x) dx\int_0^a f(x)\,dx = \int_0^a f(a - x)\,dx⁠. Lesson: properties of definite integrals

2Tangent of a difference

tan⁡(A−B)=tan⁡A−tan⁡B1+tan⁡Atan⁡B\tan(A - B) = \frac{\tan A - \tan B}{1 + \tan A\tan B} (when 1+tan⁡Atan⁡B≠01 + \tan A\tan B \ne 0⁠), and tan⁡π4=1\tan\frac{\pi}{4} = 1⁠. Basics: trigonometric identities

3Laws of logarithms

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

4Integral of a constant

∫abk dx=k(b−a)\int_a^b k\,dx = k(b - a)⁠. Lesson: the fundamental theorem

Solution

  1. The integrand is defined and continuous on [0,π4]\left[0, \frac{\pi}{4}\right]

    On [0,π4]\left[0, \frac{\pi}{4}\right]⁠, tan⁡x\tan x is continuous and increases from 0 to 1, so

    1≤1+tan⁡x≤2.1 \le 1 + \tan x \le 2 .

    The logarithm of a number between 1 and 2 is defined, and log⁡(1+tan⁡x)\log(1 + \tan x) is continuous, with values from 0 to log⁡2\log 2⁠. Label

    I=∫0π4log⁡(1+tan⁡x) dx(1)I = \int_0^{\frac{\pi}{4}}\log(1 + \tan x)\,dx \qquad (1)
    We need the integrand continuous on the closed interval for P4 and so that II is a finite number (Step 5 subtracts it). We also need 1+tan⁡x>01 + \tan x > 0⁠, so that the logarithm exists and the log law in Step 4 is allowed.
    tan⁡\tan is continuous on (−π2,π2)\left(-\frac{\pi}{2}, \frac{\pi}{2}\right)⁠, which contains [0,π4]\left[0, \frac{\pi}{4}\right]⁠; log⁡\log is continuous on (0,∞)(0, \infty)⁠. Basics: logarithms
  2. Apply P4 with a=π4a = \frac{\pi}{4}

    I=∫0π4log⁡(1+tan⁡(π4−x))dx(2)I = \int_0^{\frac{\pi}{4}}\log\left(1 + \tan\left(\tfrac{\pi}{4} - x\right)\right)dx \qquad (2)
    P4 holds for every function continuous on [0,a][0, a] (Step 1). As xx runs over [0,π4]\left[0, \frac{\pi}{4}\right]⁠, so does π4−x\frac{\pi}{4} - x⁠, so tan⁡(π4−x)\tan\left(\frac{\pi}{4} - x\right) is defined and lies in [0,1][0, 1]⁠. The point is what this new integrand simplifies to.
  3. Simplify 1+tan⁡(π4−x)1 + \tan\left(\frac{\pi}{4} - x\right)

    By the difference formula with tan⁡π4=1\tan\frac{\pi}{4} = 1⁠:

    tan⁡(π4−x)=1−tan⁡x1+tan⁡x.\tan\left(\tfrac{\pi}{4} - x\right) = \frac{1 - \tan x}{1 + \tan x} .

    So

    1+tan⁡(π4−x)=(1+tan⁡x)+(1−tan⁡x)1+tan⁡x=21+tan⁡x.\begin{aligned}&1 + \tan\left(\tfrac{\pi}{4} - x\right) \\ &= \frac{(1 + \tan x) + (1 - \tan x)}{1 + \tan x} \\ &= \frac{2}{1 + \tan x} .\end{aligned}
    This is the heart of the problem: after P4, the expression inside the logarithm becomes 2 divided by the original expression. The formula is valid because its denominator 1+tan⁡x≥11 + \tan x \ge 1 is never 0 here.
    tan⁡(A−B)=tan⁡A−tan⁡B1+tan⁡Atan⁡B\tan(A - B) = \frac{\tan A - \tan B}{1 + \tan A\tan B} with A=π4A = \frac{\pi}{4}⁠, B=xB = x⁠. Basics: trigonometric identities
  4. Split the logarithm

    Since 2>02 > 0 and 1+tan⁡x>01 + \tan x > 0⁠:

    log⁡21+tan⁡x=log⁡2−log⁡(1+tan⁡x).\log\frac{2}{1 + \tan x} = \log 2 - \log(1 + \tan x) .

    Putting this into (2):

    I=∫0π4(log⁡2−log⁡(1+tan⁡x))dx=log⁡2∫0π4dx−∫0π4log⁡(1+tan⁡x) dx=π4log⁡2−I.\begin{aligned}I &= \int_0^{\frac{\pi}{4}}\big(\log 2 - \log(1 + \tan x)\big)dx \\ &= \log 2\int_0^{\frac{\pi}{4}}dx - \int_0^{\frac{\pi}{4}}\log(1 + \tan x)\,dx \\ &= \frac{\pi}{4}\log 2 - I .\end{aligned}
    The quotient law of logarithms needs both numbers positive, which holds. The constant log⁡2\log 2 integrates to log⁡2\log 2 times the length π4\frac{\pi}{4} of the interval, and the remaining integral is exactly (1), our II⁠.
    log⁡pq=log⁡p−log⁡q\log\frac{p}{q} = \log p - \log q for p,q>0p, q > 0⁠. Basics: logarithms
  5. Solve for II

    2I=π4log⁡2,I=π8log⁡2≈0.2721983.\begin{aligned}2I &= \frac{\pi}{4}\log 2, \\ I &= \frac{\pi}{8}\log 2 \approx 0.2721983 .\end{aligned}
    Adding II to both sides is allowed because II is a finite number (Step 1). The value is positive and less than π4log⁡2≈0.5443965\frac{\pi}{4}\log 2 \approx 0.5443965⁠, as it must be: the integrand lies between 0 and log⁡2\log 2 on an interval of length π4\frac{\pi}{4}⁠.
    log⁡2≈0.6931472\log 2 \approx 0.6931472 and π8≈0.3926991\frac{\pi}{8} \approx 0.3926991⁠.
  6. The picture

    x y π/8 π/4 ½ log 2 log 2 (π/8, ½ log 2) y = log(1 + tan x) dashed: mirror image area I
    The blue curve y=log⁡(1+tan⁡x)y = \log(1 + \tan x) rises from 0 to log⁡2\log 2⁠; the region under it (area II⁠) is shaded. The dashed gold curve is its mirror image in x=π8x = \frac{\pi}{8}⁠, y=log⁡(1+tan⁡(π4−x))y = \log\left(1 + \tan\left(\frac{\pi}{4} - x\right)\right)⁠, which equals log⁡2−log⁡(1+tan⁡x)\log 2 - \log(1 + \tan x)⁠, with the same area. The two heights add to log⁡2\log 2 at every xx⁠, so the two areas fill the rectangle of area π4log⁡2\frac{\pi}{4}\log 2⁠.
    The curve passes through (π8,12log⁡2)\left(\frac{\pi}{8}, \frac12\log 2\right) and is symmetric under a half turn about that point, so it cuts the rectangle into two equal halves. That is the equation 2I=π4log⁡22I = \frac{\pi}{4}\log 2 in picture form.
    tan⁡π8=2−1\tan\frac{\pi}{8} = \sqrt2 - 1⁠, so 1+tan⁡π8=21 + \tan\frac{\pi}{8} = \sqrt2 and log⁡2=12log⁡2\log\sqrt2 = \frac12\log 2⁠. Basics: symmetry and mirror images
Result

∫0π4log⁡(1+tan⁡x) dx=π8log⁡2≈0.2721983\int_0^{\frac{\pi}{4}}\log(1 + \tan x)\,dx = \frac{\pi}{8}\log 2 \approx 0.2721983 (Textbook answer: π8log⁡2\frac{\pi}{8}\log 2⁠. Ours is the same.)

Check it with numbers

A numerical integration over [0,π4]\left[0, \frac{\pi}{4}\right] gives 0.2721983, and π8log⁡2≈0.2721983\frac{\pi}{8}\log 2 \approx 0.2721983⁠. At x=0.3x = 0.3⁠: log⁡(1+tan⁡0.3)≈0.2695203\log(1 + \tan 0.3) \approx 0.2695203 and log⁡(1+tan⁡(π4−0.3))\log\left(1 + \tan\left(\frac{\pi}{4} - 0.3\right)\right) ≈0.4236269\approx 0.4236269⁠; they add to 0.6931472, which is log⁡2\log 2 to seven decimal places.

Common mistakes
  1. Writing tan⁡(π4−x)=1−tan⁡x\tan\left(\frac{\pi}{4} - x\right) = 1 - \tan x⁠. The tangent of a difference has the denominator 1+tan⁡Atan⁡B1 + \tan A\tan B⁠.
  2. Splitting log⁡(1+tan⁡x)\log(1 + \tan x) as log⁡1+log⁡tan⁡x\log 1 + \log\tan x⁠. The logarithm of a sum is not a sum of logarithms; only products and quotients split.
  3. Stopping at 2I=π4log⁡22I = \frac{\pi}{4}\log 2⁠. Divide by 2: I=π8log⁡2I = \frac{\pi}{8}\log 2⁠.
What to take away
  1. On [0,π4]\left[0, \frac{\pi}{4}\right]⁠, P4 turns 1+tan⁡x1 + \tan x into 21+tan⁡x\frac{2}{1 + \tan x}⁠. That is why this integral can be found over [0,π4]\left[0, \frac{\pi}{4}\right] without any antiderivative. The trick needs the two limits to add up to π4\frac{\pi}{4} (P4 here, P3 in general), so that tan⁡x\tan x is paired with tan⁡(π4−x)\tan\left(\frac{\pi}{4} - x\right)⁠; for most other intervals it does not work.
  2. When P4 returns "constant minus the original integrand", you get I=c−II = c - I⁠, so I=c2I = \frac{c}{2}⁠.
  3. Before splitting a logarithm, check that both parts are positive.

Every fact used, and where it comes from

FactUsed inSource
0≤tan⁡x≤10 \le \tan x \le 1 on [0,π4]\left[0, \frac{\pi}{4}\right]Step 1Trigonometry (Basics)
P4: ∫0af(x) dx=∫0af(a−x) dx\int_0^a f(x)\,dx = \int_0^a f(a - x)\,dxStep 2Section 7.10 (Lesson)
tan⁡(A−B)=tan⁡A−tan⁡B1+tan⁡Atan⁡B\tan(A - B) = \frac{\tan A - \tan B}{1 + \tan A\tan B}Step 3Trigonometry (Basics)
log⁡pq=log⁡p−log⁡q\log\frac{p}{q} = \log p - \log q⁠, p,q>0p, q > 0Step 4Logarithms (Basics)
∫dx=x+C\int dx = x + C⁠; ∫abf=F(b)−F(a)\int_a^b f = F(b) - F(a)Step 4Section 7.2; Theorem 2, Section 7.8.3 (Lesson)
tan⁡π8=2−1\tan\frac{\pi}{8} = \sqrt2 - 1Step 6Half-angle formula
Integral that reproduces itselfSteps 4 and 5Example 34 uses the same idea
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 →