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

Exercise 7.6 · Q12: ∫xsec⁡2x dx\int x\sec^2x\,dx

Exercise 7.6Integration by parts · Section 7.6
The question

Integrate the functions in Exercises 1 to 22.

12. xsec⁡2xx\sec^2x

Exam answer

Let I=∫xsec⁡2x dxI = \displaystyle\int x\sec^2x\,dx⁠.

Taking xx as the first function, by parts:

I=xtan⁡x−∫1⋅tan⁡x dx=xtan⁡x−log⁡∣sec⁡x∣+C\begin{aligned} I &= x\tan x - \int 1\cdot\tan x\,dx \\ &= x\tan x - \log|\sec x| + C \end{aligned}

∴ I=xtan⁡x+log⁡∣cos⁡x∣+C\therefore\ I = x\tan x + \log|\cos x| + C⁠.

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

The one idea this problem is built on

sec⁡2x\sec^2x is the derivative of tan⁡x\tan x⁠, so it is easy to integrate. Taking u=xu = x and dvdx=sec⁡2x\frac{dv}{dx} = \sec^2x⁠, one use of integration by parts leaves ∫tan⁡x dx\int\tan x\,dx⁠, which the book has already found by a substitution: log⁡∣sec⁡x∣\log|\sec x|⁠.

Given, to find, and the plan
Given
The function xsec⁡2x=xcos⁡2xx\sec^2x = \frac{x}{\cos^2x}⁠, defined wherever cos⁡x≠0\cos x \ne 0⁠, that is for x≠(2n+1)π2x \ne (2n+1)\frac\pi2⁠, nn an integer.
To find
∫xsec⁡2x dx\int x\sec^2x\,dx on any interval where cos⁡x≠0\cos x \ne 0⁠.
Plan
(1) Name uu and dvdx\frac{dv}{dx}⁠. (2) Find dudx\frac{du}{dx} and vv⁠. (3) Apply the formula. (4) Use ∫tan⁡x dx=log⁡∣sec⁡x∣\int\tan x\,dx = \log|\sec x|⁠. (5) Differentiate back.

Basics you need

1Integration by parts

Section 7.6, equation (1):

∫u dvdx dx=uv−∫v dudx dx,\int u\,\frac{dv}{dx}\,dx = uv - \int v\,\frac{du}{dx}\,dx,

with uu the first function (differentiated) and dvdx\frac{dv}{dx} the second (integrated to give vv⁠). Lesson: integration by parts

2Which factor should be uu⁠?

Remark (iii) after Example 17: a power of xx is usually the first function. Memory aid ILATE (Inverse trigonometric, Logarithmic, Algebraic, Trigonometric, Exponential; not in the book): A before T.

3Two trigonometric integrals

∫sec⁡2x dx=tan⁡x+C\int\sec^2x\,dx = \tan x + C (standard formula (iv)) and ∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + C (Section 7.3.1, found there with the substitution t=cos⁡xt = \cos x⁠). Basics: trigonometric identities

4Logarithm of an absolute value

ddxlog⁡∣x∣=1x\frac{d}{dx}\log|x| = \frac1x for x≠0x \ne 0 (standard formula (xii)), and log⁡∣sec⁡x∣=−log⁡∣cos⁡x∣\log|\sec x| = -\log|\cos x| because ∣sec⁡x∣=1∣cos⁡x∣|\sec x| = \frac{1}{|\cos x|}⁠. Basics: logarithms and 1/x

Solution

  1. Name uu and dvdx\frac{dv}{dx}

    u=x(first),dvdx=sec⁡2x(second).\begin{aligned} u &= x \quad (\text{first}), \\ \frac{dv}{dx} &= \sec^2x \quad (\text{second}). \end{aligned}
    ILATE: Algebraic before Trigonometric. Differentiating xx gives 1, and sec⁡2x\sec^2x integrates at once to tan⁡x\tan x⁠. The other choice would need ddxsec⁡2x=2sec⁡2xtan⁡x\frac{d}{dx}\sec^2x = 2\sec^2x\tan x and ∫x dx=x22\int x\,dx = \frac{x^2}{2}⁠, making the new integral harder.
    Remark (iii) after Example 17, Section 7.6. Lesson: integration by parts
  2. Find dudx\frac{du}{dx} and vv

    dudx=1,v=∫sec⁡2x dx=tan⁡x.\frac{du}{dx} = 1, \qquad v = \int\sec^2x\,dx = \tan x.
    ddxtan⁡x=sec⁡2x\frac{d}{dx}\tan x = \sec^2x⁠, so tan⁡x\tan x is an integral of sec⁡2x\sec^2x on every interval where cos⁡x≠0\cos x \ne 0⁠. No constant in vv (Remark (ii) after Example 17).
    Standard formula (iv), Section 7.2. Basics: trigonometric identities
  3. Apply the formula

    ∫xsec⁡2x dx=uv−∫v dudx dx=xtan⁡x−∫tan⁡x dx.\begin{aligned} \int x\sec^2x\,dx &= uv - \int v\,\frac{du}{dx}\,dx \\ &= x\tan x - \int\tan x\,dx. \end{aligned}
    First function times integral of second, minus the integral of (derivative of first, which is 1) times (integral of second).
    Section 7.6, equation (1). Lesson: integration by parts
  4. Use ∫tan⁡x dx=log⁡∣sec⁡x∣\int\tan x\,dx = \log|\sec x|

    ∫xsec⁡2x dx=xtan⁡x−log⁡∣sec⁡x∣+C=xtan⁡x+log⁡∣cos⁡x∣+C.\begin{aligned} \int x\sec^2x\,dx &= x\tan x - \log|\sec x| + C \\ &= x\tan x + \log|\cos x| + C. \end{aligned}
    The book shows ∫tan⁡x dx=−log⁡∣cos⁡x∣+C\int\tan x\,dx = -\log|\cos x| + C =log⁡∣sec⁡x∣+C= \log|\sec x| + C in Section 7.3.1. Since ∣sec⁡x∣=1∣cos⁡x∣|\sec x| = \frac{1}{|\cos x|}⁠, −log⁡∣sec⁡x∣=log⁡∣cos⁡x∣-\log|\sec x| = \log|\cos x|⁠. The absolute value matters: cos⁡x\cos x is negative on some intervals, and log⁡\log needs a positive argument.
    Section 7.3.1; log⁡1a=−log⁡a\log\frac1a = -\log a for a>0a > 0⁠. Basics: logarithms and 1/x
  5. Check: differentiate the answer

    Product rule on xtan⁡xx\tan x⁠, chain rule on log⁡∣cos⁡x∣\log|\cos x| (outer log⁡∣⋅∣\log|\cdot|⁠, inner cos⁡x\cos x⁠):

    ddx(xtan⁡x+log⁡∣cos⁡x∣)=tan⁡x+xsec⁡2x+−sin⁡xcos⁡x=tan⁡x+xsec⁡2x−tan⁡x=xsec⁡2x.\begin{aligned} &\frac{d}{dx}\big(x\tan x + \log|\cos x|\big) \\ &= \tan x + x\sec^2x + \frac{-\sin x}{\cos x} \\ &= \tan x + x\sec^2x - \tan x \\ &= x\sec^2x. \end{aligned}
    The two tan⁡x\tan x terms cancel and the integrand is left, at every xx with cos⁡x≠0\cos x \ne 0⁠. The derivative of log⁡∣u∣\log|u| is u′u\frac{u'}{u} whether uu is positive or negative.
    Product rule; chain rule; standard formula (xii). Basics: integration undoes differentiation
Result ∫xsec⁡2x dx=xtan⁡x+log⁡∣cos⁡x∣+C,\int x\sec^2x\,dx = x\tan x + \log|\cos x| + C,

valid on every interval where cos⁡x≠0\cos x \ne 0 (that is, x≠(2n+1)π2x \ne (2n+1)\frac\pi2⁠). (Textbook answer: xtan⁡x+log⁡∣cos⁡x∣+Cx\tan x + \log|\cos x| + C⁠, the same.)

Check it with numbers

With F(x)=xtan⁡x+log⁡∣cos⁡x∣F(x) = x\tan x + \log|\cos x|⁠, on [0,π4]\left[0, \frac\pi4\right]⁠, where tan⁡π4=1\tan\frac\pi4 = 1 and cos⁡π4=12\cos\frac\pi4 = \frac{1}{\sqrt2}⁠:

F(π4)−F(0)=π4+log⁡12−0=π4−12log⁡2=0.4388245731…\begin{aligned} F\left(\tfrac\pi4\right) - F(0) &= \frac\pi4 + \log\frac{1}{\sqrt2} - 0 \\ &= \frac\pi4 - \frac12\log 2 = 0.4388245731\ldots \end{aligned}

Numerical integration of xsec⁡2xx\sec^2x over [0,π4]\left[0, \frac\pi4\right] gives 0.4388245731…0.4388245731\ldots⁠, the same.

Common mistakes
  1. ∫tan⁡x dx=sec⁡2x\int\tan x\,dx = \sec^2x⁠. That is the derivative of tan⁡x\tan x⁠, not its integral; ∫tan⁡x dx=log⁡∣sec⁡x∣\int\tan x\,dx = \log|\sec x|⁠.
  2. Sign at the end. −log⁡∣sec⁡x∣=+log⁡∣cos⁡x∣-\log|\sec x| = +\log|\cos x|⁠.
  3. Dropping the absolute value. log⁡cos⁡x\log\cos x is undefined where cos⁡x<0\cos x < 0⁠.
What to take away
  1. xx times the derivative of a known function (here sec⁡2x=(tan⁡x)′\sec^2x = (\tan x)'⁠): take u=xu = x⁠.
  2. Remember ∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + C =−log⁡∣cos⁡x∣+C= -\log|\cos x| + C⁠.
  3. State the intervals of validity when the integrand has points where it is undefined.

Every fact used, and where it comes from

FactUsed inSource
Integration by partsStep 3Section 7.6, equation (1) (Lesson: integration by parts)
Choice of the first function (ILATE)Step 1Remark (iii) after Example 17, Section 7.6
No constant needed in vvStep 2Remark (ii) after Example 17, Section 7.6
∫sec⁡2x dx=tan⁡x+C\int\sec^2x\,dx = \tan x + CStep 2Standard formula (iv), Section 7.2
∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + CStep 4Section 7.3.1 (Lesson: substitution)
ddxlog⁡∣x∣=1x\frac{d}{dx}\log|x| = \frac1xStep 5Standard formula (xii), Section 7.2
Product and chain rulesStep 5Chapter 5, Sections 5.3 and 5.3.1
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 →