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

Exercise 7.8 · Q7: ∫0π/4tan⁡x dx\int_0^{\pi/4}\tan x\,dx

Exercise 7.8Fundamental theorem of calculus · Section 7.8
The question

Evaluate the definite integral

∫0π4tan⁡x dx.\int_0^{\frac{\pi}{4}}\tan x\,dx.
Exam answer

Let I=∫0π4tan⁡x dxI = \displaystyle\int_0^{\frac{\pi}{4}}\tan x\,dx⁠.

Using ∫tan⁡x dx=log⁡∣sec⁡x∣+C,\displaystyle\int\tan x\,dx = \log|\sec x| + C,

I=[log⁡∣sec⁡x∣]0π4=log⁡sec⁡π4−log⁡sec⁡0=log⁡2−log⁡1\begin{aligned} I &= \Big[\log|\sec x|\Big]_0^{\frac{\pi}{4}} \\ &= \log\sec\frac{\pi}{4} - \log\sec 0 \\ &= \log\sqrt2 - \log 1 \end{aligned}

∴ I=12log⁡2\therefore\ I = \dfrac12\log 2⁠.

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

The one idea this problem is built on

The second fundamental theorem (Theorem 2, Section 7.8.3): ∫abf(x) dx=F(b)−F(a)\int_a^b f(x)\,dx = F(b) - F(a)⁠. For tan⁡x\tan x the antiderivative is log⁡∣sec⁡x∣\log|\sec x|⁠, one of the results derived in Section 7.3.1 by writing tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x} and substituting t=cos⁡xt = \cos x⁠. Then sec⁡π4=2\sec\frac{\pi}{4} = \sqrt2 and sec⁡0=1\sec 0 = 1 finish the job.

Given, to find, and the plan
Given
f(x)=tan⁡xf(x) = \tan x on [0,π4]\left[0, \frac{\pi}{4}\right]⁠.
To find
The exact value of ∫0π/4tan⁡x dx\int_0^{\pi/4}\tan x\,dx⁠.
Plan
(1) Continuity: cos⁡x≠0\cos x \ne 0 on the interval. (2) Antiderivative by t=cos⁡xt = \cos x⁠, checked by differentiating. (3) F(π4)−F(0)F\left(\frac{\pi}{4}\right) - F(0)⁠. (4) Size check with a line below and a chord above the curve.

Basics you need

1Second fundamental theorem

∫abf(x) dx=[F(x)]ab=F(b)−F(a)\int_a^b f(x)\,dx = \big[F(x)\big]_a^b = F(b) - F(a) for ff continuous on [a,b][a, b] and F′=fF' = f⁠. Lesson: definite integrals and the fundamental theorem

2Substitution

If t=g(x)t = g(x)⁠, then dt=g′(x) dxdt = g'(x)\,dx (Section 7.3.1). Basics: substitution (the chain rule backwards)

3The integral of 1t\frac1t

∫dtt=log⁡∣t∣+C\int\frac{dt}{t} = \log|t| + C (standard formula (xii), Section 7.2). Basics: logarithms and 1/x

4Logs and powers

−log⁡a=log⁡1a-\log a = \log\frac1a⁠, log⁡a=12log⁡a\log\sqrt a = \frac12\log a⁠, log⁡1=0\log 1 = 0⁠. Basics: logarithms

Solution

  1. Check continuity on [0,π4]\left[0, \frac{\pi}{4}\right]

    tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x} is continuous wherever cos⁡x≠0\cos x \ne 0⁠. On [0,π4]\left[0, \frac{\pi}{4}\right]⁠, cos⁡x\cos x decreases from 1 to 12\frac{1}{\sqrt2}⁠, so cos⁡x≥12>0\cos x \ge \frac{1}{\sqrt2} > 0⁠. Hence tan⁡x\tan x is continuous on the whole interval.

    tan⁡x\tan x breaks down only where cos⁡x=0\cos x = 0⁠, at x=±π2,±3π2,…x = \pm\frac{\pi}{2}, \pm\frac{3\pi}{2}, \ldots⁠. None of these lies in [0,π4]\left[0, \frac{\pi}{4}\right]⁠, so Theorem 2 can be used (Remark (iv) after Theorem 2).
    A quotient of continuous functions is continuous where the denominator is not 0 (Chapter 5, Theorem 1). Lesson: the fundamental theorem
  2. Antiderivative by the substitution t=cos⁡xt = \cos x

    Write tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x} and let t=cos⁡xt = \cos x⁠. Then dt=−sin⁡x dxdt = -\sin x\,dx⁠, so sin⁡x dx=−dt\sin x\,dx = -dt⁠:

    ∫tan⁡x dx=∫sin⁡x dxcos⁡x=−∫dtt=−log⁡∣t∣+C=−log⁡∣cos⁡x∣+C.\begin{aligned}\int\tan x\,dx &= \int\frac{\sin x\,dx}{\cos x} = -\int\frac{dt}{t} \\ &= -\log|t| + C = -\log|\cos x| + C.\end{aligned}

    Since −log⁡∣cos⁡x∣=log⁡1∣cos⁡x∣-\log|\cos x| = \log\frac{1}{|\cos x|}⁠, which is log⁡∣sec⁡x∣\log|\sec x|⁠, take

    F(x)=log⁡∣sec⁡x∣=log⁡sec⁡xon [0,π4].F(x) = \log|\sec x| = \log\sec x \quad\text{on } \left[0, \tfrac{\pi}{4}\right].
    The numerator sin⁡x\sin x is (minus) the derivative of the denominator cos⁡x\cos x⁠, which is the signal for t=cos⁡xt = \cos x⁠. On our interval sec⁡x=1cos⁡x≥1>0\sec x = \frac{1}{\cos x} \ge 1 > 0⁠, so the absolute value bars can be dropped. This is result (i) of Section 7.3.1: ∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + C⁠.
    Section 7.3.1, result (i); standard formula (xii). Lesson: integration by substitution
  3. Check: differentiate FF back

    Chain rule (outer log⁡\log⁠, inner sec⁡x\sec x⁠):

    F′(x)=1sec⁡x⋅sec⁡xtan⁡x=tan⁡x.F'(x) = \frac{1}{\sec x}\cdot\sec x\tan x = \tan x.
    ddxsec⁡x=sec⁡xtan⁡x\frac{d}{dx}\sec x = \sec x\tan x⁠, and the sec⁡x\sec x cancels, leaving exactly the integrand.
    ddxlog⁡u=1u⋅dudx\frac{d}{dx}\log u = \frac{1}{u}\cdot\frac{du}{dx} for u>0u > 0⁠. Basics: the chain rule
  4. Evaluate F(π4)−F(0)F\left(\frac{\pi}{4}\right) - F(0)

    sec⁡π4=1cos⁡π4=11/2=2\sec\frac{\pi}{4} = \frac{1}{\cos\frac{\pi}{4}} = \frac{1}{1/\sqrt2} = \sqrt2 and sec⁡0=1cos⁡0=1\sec 0 = \frac{1}{\cos 0} = 1⁠. So

    ∫0π4tan⁡x dx=log⁡2−log⁡1=log⁡212−0=12log⁡2≈0.3465736.\begin{aligned}\int_0^{\frac{\pi}{4}}\tan x\,dx &= \log\sqrt2 - \log 1 = \log 2^{\frac12} - 0 \\ &= \tfrac12\log 2 \approx 0.3465736.\end{aligned}
    Upper minus lower. log⁡1=0\log 1 = 0⁠, and log⁡2=log⁡21/2=12log⁡2\log\sqrt2 = \log 2^{1/2} = \frac12\log 2 by the power law of logarithms. This is the book's form.
    log⁡ak=klog⁡a\log a^k = k\log a⁠. Basics: logarithms
  5. Does the size make sense?

    On [0,π4]\left[0, \frac{\pi}{4}\right] the curve y=tan⁡xy = \tan x lies above the line y=xy = x and below the chord y=4πxy = \frac{4}{\pi}x joining (0,0)(0, 0) to (π4,1)\left(\frac{\pi}{4}, 1\right)⁠. So the area under it lies between the two triangle areas:

    π232≈0.308<0.347<π8≈0.393.\frac{\pi^2}{32} \approx 0.308 < 0.347 < \frac{\pi}{8} \approx 0.393.
    π/4 1.2 1 2 x y y = tan x (π/4, 1) area ≈ 0.347 chord
    The shaded region under y=tan⁡xy = \tan x from 0 to π4\frac{\pi}{4} has area 12log⁡2≈0.347\frac12\log 2 \approx 0.347⁠. The dashed chord to (π4,1)\left(\frac{\pi}{4}, 1\right) lies above the curve, so the area is less than that triangle's area π8\frac{\pi}{8}⁠.
    tan⁡x≥x\tan x \ge x because tan⁡x−x\tan x - x is 0 at x=0x = 0 and has derivative sec⁡2x−1=tan⁡2x≥0\sec^2 x - 1 = \tan^2 x \ge 0⁠. The curve is below the chord because it bends upwards: its second derivative 2sec⁡2xtan⁡x2\sec^2 x\tan x is ≥0\ge 0 there. The triangles under y=xy = x and under the chord have areas 12(π4)2=π232\frac12\left(\frac{\pi}{4}\right)^2 = \frac{\pi^2}{32} and 12⋅π4⋅1=π8\frac12\cdot\frac{\pi}{4}\cdot 1 = \frac{\pi}{8}⁠.
    Definite integral as area, Section 7.8.1. Basics: area as a sum of thin strips
Result ∫0π4tan⁡x dx=12log⁡2=log⁡2≈0.3465736.\int_0^{\frac{\pi}{4}}\tan x\,dx = \frac12\log 2 = \log\sqrt2 \approx 0.3465736.

(Textbook answer: 12log⁡2\frac12\log 2⁠, the same.)

Check it with numbers

Numerical integration of tan⁡x\tan x from 0 to π4\frac{\pi}{4} (thin strips, no antiderivative used) gives 0.34657360.3465736⁠, and 12log⁡2\frac12\log 2⁠, half of log⁡2≈0.6931472\log 2 \approx 0.6931472⁠, is ≈0.3465736\approx 0.3465736⁠. They agree.

Common mistakes
  1. Sign slip in the substitution. dt=−sin⁡x dxdt = -\sin x\,dx⁠, so ∫tan⁡x dx=−log⁡∣cos⁡x∣\int\tan x\,dx = -\log|\cos x|⁠, not +log⁡∣cos⁡x∣+\log|\cos x| (that gives −12log⁡2-\frac12\log 2⁠, a negative area for a positive integrand).
  2. Guessing ∫tan⁡x dx=sec⁡2x\int\tan x\,dx = \sec^2 x⁠. That is the derivative of tan⁡x\tan x⁠, not its integral.
  3. Using sec⁡π4=12\sec\frac{\pi}{4} = \frac{1}{\sqrt2}⁠. That is cos⁡π4\cos\frac{\pi}{4}⁠; its reciprocal is 2\sqrt2⁠.
What to take away
  1. ∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + C⁠, which is the same as −log⁡∣cos⁡x∣+C-\log|\cos x| + C⁠.
  2. Before using Theorem 2 with tan⁡x\tan x⁠, make sure the interval avoids every odd multiple of π2\frac{\pi}{2}⁠.
  3. A line below and a chord above the curve give quick bounds for the area.

Every fact used, and where it comes from

FactUsed inSource
∫abf=F(b)−F(a)\int_a^b f = F(b) - F(a) for continuous ffSteps 1, 4Theorem 2, Section 7.8.3 (Lesson)
Quotient of continuous functions is continuousStep 1Chapter 5, Theorem 1, Section 5.2.1
∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + C via t=cos⁡xt = \cos xStep 2Section 7.3.1, result (i) (Lesson)
∫dtt=log⁡∣t∣+C\int\frac{dt}{t} = \log|t| + CStep 2Standard formula (xii), Section 7.2 (Basics)
ddxsec⁡x=sec⁡xtan⁡x\frac{d}{dx}\sec x = \sec x\tan x⁠; chain ruleStep 3Chapter 5, Section 5.3.1 (Basics)
log⁡ak=klog⁡a\log a^k = k\log a⁠, log⁡1=0\log 1 = 0Step 4Laws of logarithms (Basics)
Definite integral as areaStep 5Section 7.8.1 (Basics)
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 →