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

Exercise 7.2 · Q33: ∫11−tan⁡x dx\int\frac{1}{1-\tan x}\,dx

Exercise 7.2Integration by substitution · Section 7.3.1
The question

Integrate the function (Exercise 7.2, "Integrate the functions in Exercises 1 to 37"):

11−tan⁡x\frac{1}{1 - \tan x}
Exam answer

Let I=∫dx1−tan⁡xI = \displaystyle\int\frac{dx}{1 - \tan x}⁠.

Multiplying the numerator and the denominator by cos⁡x\cos x⁠,

I=∫cos⁡xcos⁡x−sin⁡x dxI = \int\frac{\cos x}{\cos x - \sin x}\,dx

Writing cos⁡x=12(cos⁡x−sin⁡x)\cos x = \frac12(\cos x - \sin x) +12(cos⁡x+sin⁡x)+ \frac12(\cos x + \sin x)⁠,

I=12∫dx+12∫cos⁡x+sin⁡xcos⁡x−sin⁡x dx\begin{aligned} I &= \frac12\int dx \\ &\quad + \frac12\int\frac{\cos x + \sin x}{\cos x - \sin x}\,dx \end{aligned}

Put cos⁡x−sin⁡x=t\cos x - \sin x = t⁠.

Then −(sin⁡x+cos⁡x) dx=dt-(\sin x + \cos x)\,dx = dt⁠.

I=x2−12∫dtt=x2−12log⁡∣t∣+C\begin{aligned} I &= \frac x2 - \frac12\int\frac{dt}{t} \\ &= \frac x2 - \frac12\log|t| + C \end{aligned}

∴ I=x2−12log⁡∣cos⁡x−sin⁡x∣\therefore\ I = \dfrac{x}{2} - \dfrac12\log|\cos x - \sin x| +C+ C⁠.

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

The one idea this problem is built on

Clear the tangent: 11−tan⁡x=cos⁡xcos⁡x−sin⁡x\frac{1}{1 - \tan x} = \frac{\cos x}{\cos x - \sin x}⁠. With D=cos⁡x−sin⁡xD = \cos x - \sin x⁠, the derivative is D′=−sin⁡x−cos⁡xD' = -\sin x - \cos x⁠, and the numerator can be written as

cos⁡x=12D−12D′.\cos x = \tfrac12 D - \tfrac12 D'.

The DD part integrates to x2\frac{x}{2}⁠, and the D′D\frac{D'}{D} part to a logarithm. This is the book's Example 6(iii) with a minus sign.

Given, to find, and the plan
Given
f(x)=11−tan⁡xf(x) = \dfrac{1}{1 - \tan x}⁠.
To find
∫f(x) dx\int f(x)\,dx⁠, and where the answer is valid.
Plan
(1) Find where ff is defined. (2) Rewrite ff as cos⁡xcos⁡x−sin⁡x\frac{\cos x}{\cos x - \sin x}⁠. (3) Split the numerator as 12D−12D′\frac12 D - \frac12 D'⁠. (4) Integrate each piece, the second by t=cos⁡x−sin⁡xt = \cos x - \sin x⁠. (5) Differentiate back.

Basics you need

1tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x}

Defined where cos⁡x≠0\cos x \ne 0⁠. Basics: trigonometric facts

2Splitting a fraction

a−bD=aD−bD\frac{a - b}{D} = \frac{a}{D} - \frac{b}{D}⁠. Basics: splitting fractions

3∫g′(x)g(x) dx=log⁡∣g(x)∣+C\int\frac{g'(x)}{g(x)}\,dx = \log|g(x)| + C

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

4Integration undoes differentiation

Every answer can be checked by differentiating it. Basics: integration undoes differentiation

Solution

  1. Where is the integrand defined?

    • tan⁡x\tan x must exist: cos⁡x≠0\cos x \ne 0⁠, that is, x≠π2+nπx \ne \frac{\pi}{2} + n\pi⁠.
    • The denominator must not vanish: 1−tan⁡x≠01 - \tan x \ne 0⁠, that is, tan⁡x≠1\tan x \ne 1⁠, that is, x≠π4+nπx \ne \frac{\pi}{4} + n\pi⁠.

    Multiplying by cos⁡x≠0\cos x \ne 0⁠, the second condition says cos⁡x−sin⁡x≠0\cos x - \sin x \ne 0⁠. So on the domain both cos⁡x\cos x and cos⁡x−sin⁡x\cos x - \sin x are non-zero.

    We need cos⁡x≠0\cos x \ne 0 to multiply through by cos⁡x\cos x in Step 2, and cos⁡x−sin⁡x≠0\cos x - \sin x \ne 0 for the logarithm in Step 4.
    tan⁡x=1\tan x = 1 exactly when x=π4+nπx = \frac{\pi}{4} + n\pi⁠. Basics: trigonometric facts
  2. Rewrite without the tangent

    Multiply top and bottom by cos⁡x\cos x (non-zero on the domain):

    11−tan⁡x=cos⁡xcos⁡x−cos⁡xtan⁡x=cos⁡xcos⁡x−sin⁡x.\begin{aligned} \frac{1}{1 - \tan x} &= \frac{\cos x}{\cos x - \cos x\tan x} \\ &= \frac{\cos x}{\cos x - \sin x}. \end{aligned}
    Now the denominator D=cos⁡x−sin⁡xD = \cos x - \sin x has a simple derivative, D′=−sin⁡x−cos⁡xD' = -\sin x - \cos x⁠, and we can relate the numerator to DD and D′D'⁠.
    cos⁡xtan⁡x=sin⁡x\cos x\tan x = \sin x⁠. Basics: trigonometric facts
  3. Split the numerator

    Look for a,ba, b with aD+bD′=cos⁡xa D + b D' = \cos x⁠:

    a(cos⁡x−sin⁡x)+b(−sin⁡x−cos⁡x)=cos⁡x.a(\cos x - \sin x) + b(-\sin x - \cos x) = \cos x.

    Compare coefficients: of cos⁡x\cos x⁠, a−b=1a - b = 1⁠; of sin⁡x\sin x⁠, −a−b=0-a - b = 0⁠. So a=12a = \frac12⁠, b=−12b = -\frac12⁠. Check: 12(cos⁡x−sin⁡x)+12(sin⁡x+cos⁡x)=cos⁡x\frac12(\cos x - \sin x) + \frac12(\sin x + \cos x) = \cos x⁠. ✓ Hence

    cos⁡xcos⁡x−sin⁡x=12D−12D′D=12+12⋅cos⁡x+sin⁡xcos⁡x−sin⁡x.\begin{aligned} \frac{\cos x}{\cos x - \sin x} &= \frac{\frac12 D - \frac12 D'}{D} \\ &= \tfrac12 + \tfrac12\cdot\frac{\cos x + \sin x}{\cos x - \sin x}. \end{aligned}
    Since −12D′=12(sin⁡x+cos⁡x)-\frac12 D' = \frac12(\sin x + \cos x)⁠, the second fraction has numerator cos⁡x+sin⁡x\cos x + \sin x⁠. Its sign is plus here, but this numerator is minus the derivative of the denominator, which will bring a minus sign back in Step 4.
    Same method as Example 6(iii), Section 7.3.1. Basics: splitting fractions
  4. Integrate each piece

    First piece: ∫12 dx=x2\int\frac12\,dx = \frac{x}{2}⁠.

    Second piece: put t=cos⁡x−sin⁡xt = \cos x - \sin x⁠, so dt=(−sin⁡x−cos⁡x) dxdt = (-\sin x - \cos x)\,dx⁠, that is, (cos⁡x+sin⁡x) dx=−dt(\cos x + \sin x)\,dx = -dt⁠:

    ∫cos⁡x+sin⁡xcos⁡x−sin⁡x dx=∫−dtt=−log⁡∣t∣.\int\frac{\cos x + \sin x}{\cos x - \sin x}\,dx = \int\frac{-dt}{t} = -\log|t|.

    Together (Properties (III) and (IV), Section 7.2.1):

    ∫dx1−tan⁡x=x2−12log⁡∣cos⁡x−sin⁡x∣+C.\int\frac{dx}{1 - \tan x} = \frac{x}{2} - \tfrac12\log|\cos x - \sin x| + C.
    The substitution works because the numerator is the derivative of tt up to the factor −1-1 (Section 7.3.1). The modulus is needed: cos⁡x−sin⁡x\cos x - \sin x is positive near 00 but negative near x=1x = 1⁠, for example.
    Standard formula (xii), Section 7.2. Lesson: integration by substitution
  5. Check: differentiate the answer back

    Let F(x)=x2−12log⁡∣cos⁡x−sin⁡x∣F(x) = \frac{x}{2} - \frac12\log|\cos x - \sin x|⁠. With ddxlog⁡∣g∣=g′g\frac{d}{dx}\log|g| = \frac{g'}{g}⁠:

    F′(x)=12−12⋅−sin⁡x−cos⁡xcos⁡x−sin⁡x=(cos⁡x−sin⁡x)+(sin⁡x+cos⁡x)2(cos⁡x−sin⁡x)=2cos⁡x2(cos⁡x−sin⁡x)=cos⁡xcos⁡x−sin⁡x.\begin{aligned} F'(x) &= \tfrac12 - \tfrac12\cdot\frac{-\sin x - \cos x}{\cos x - \sin x} \\ &= \frac{(\cos x - \sin x) + (\sin x + \cos x)}{2(\cos x - \sin x)} \\ &= \frac{2\cos x}{2(\cos x - \sin x)} = \frac{\cos x}{\cos x - \sin x}. \end{aligned}

    Dividing top and bottom by cos⁡x\cos x gives 11−tan⁡x\frac{1}{1 - \tan x}⁠, the integrand. ✓

    This is the test of an antiderivative (Property (I), Section 7.2.1), and it confirms the sign handled in Steps 3 and 4.
Result

∫dx1−tan⁡x=x2−12log⁡∣cos⁡x−sin⁡x∣+C,\int\frac{dx}{1 - \tan x} = \frac{x}{2} - \tfrac12\log|\cos x - \sin x| + C, valid wherever cos⁡x≠0\cos x \ne 0 and tan⁡x≠1\tan x \ne 1⁠. (Textbook answer: x2−12log⁡∣cos⁡x−sin⁡x∣+C\frac{x}{2} - \frac12\log|\cos x - \sin x| + C⁠.)

Check it with numbers

Take x=0.5x = 0.5 and h=0.001h = 0.001⁠:

  • F(0.501)=0.7126617F(0.501) = 0.7126617 and F(0.499)=0.7082534F(0.499) = 0.7082534⁠,
  • slope ≈0.7126617−0.70825340.002=2.2041\approx \frac{0.7126617 - 0.7082534}{0.002} = 2.2041⁠,
  • integrand: 11−tan⁡0.5=11−0.546302=2.2041\frac{1}{1 - \tan 0.5} = \frac{1}{1 - 0.546302} = 2.2041⁠. ✓
Common mistakes
  1. Wrong derivative of the denominator. ddx(cos⁡x−sin⁡x)=−sin⁡x−cos⁡x\frac{d}{dx}(\cos x - \sin x) = -\sin x - \cos x⁠, not sin⁡x−cos⁡x\sin x - \cos x⁠.
  2. Sign of the log term. The numerator cos⁡x+sin⁡x\cos x + \sin x is minus D′D'⁠, so the log term comes out with a minus sign.
  3. Copying Q32's answer. Q32 has log⁡∣cos⁡x+sin⁡x∣\log|\cos x + \sin x|⁠; here it is log⁡∣cos⁡x−sin⁡x∣\log|\cos x - \sin x|⁠.
What to take away
  1. For a ratio of linear combinations of sin⁡x\sin x and cos⁡x\cos x⁠, write the numerator as λD+μD′\lambda D + \mu D' and compare coefficients.
  2. Then ∫λD+μD′D dx=λx+μlog⁡∣D∣+C\int\frac{\lambda D + \mu D'}{D}\,dx = \lambda x + \mu\log|D| + C⁠.
  3. Check by differentiating: it catches sign slips in D′D'⁠.

Every fact used, and where it comes from

FactUsed inSource
tan⁡x=sin⁡xcos⁡x\tan x = \frac{\sin x}{\cos x}⁠; tan⁡x=1\tan x = 1 at x=π4+nπx = \frac{\pi}{4} + n\piSteps 1, 2Trigonometric functions (Class XI, Chapter 3)
Numerator written as 12D−12D′\frac12 D - \frac12 D'Step 3Comparing coefficients; same method as Example 6(iii), Section 7.3.1
∫(f+g)=∫f+∫g\int(f + g) = \int f + \int g⁠, ∫kf=k∫f\int kf = k\int fStep 4Properties (III), (IV), Section 7.2.1
Substitution t=cos⁡x−sin⁡xt = \cos x - \sin xStep 4Section 7.3.1 (Lesson: substitution)
∫dtt=log⁡∣t∣+C\int\frac{dt}{t} = \log|t| + CStep 4Standard formula (xii), Section 7.2
F′=fF' = f checks the answerStep 5Property (I), Section 7.2.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 →