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

Exercise 7.2 · Q32: ∫11+cot⁡x dx\int\frac{1}{1+\cot 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+cot⁡x\frac{1}{1 + \cot x}
Exam answer

Let I=∫dx1+cot⁡xI = \displaystyle\int\frac{dx}{1 + \cot x}⁠.

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

I=∫sin⁡xsin⁡x+cos⁡x dxI = \int\frac{\sin x}{\sin x + \cos x}\,dx

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

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

Put sin⁡x+cos⁡x=t\sin x + \cos x = t⁠.

Then (cos⁡x−sin⁡x) dx=dt(\cos x - \sin 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 cotangent: 11+cot⁡x=sin⁡xsin⁡x+cos⁡x\frac{1}{1 + \cot x} = \frac{\sin x}{\sin x + \cos x}⁠. Now write the numerator using the denominator D=sin⁡x+cos⁡xD = \sin x + \cos x and its derivative D′=cos⁡x−sin⁡xD' = \cos x - \sin x⁠:

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

The DD part gives 12\frac12 (easy to integrate), and the D′D' part gives D′D\frac{D'}{D}⁠, which integrates to log⁡∣D∣\log|D|⁠. This is the trick of the book's Example 6(iii).

Given, to find, and the plan
Given
f(x)=11+cot⁡xf(x) = \dfrac{1}{1 + \cot 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 sin⁡xsin⁡x+cos⁡x\frac{\sin x}{\sin x + \cos x}⁠. (3) Split the numerator as 12D−12D′\frac12 D - \frac12 D'⁠. (4) Integrate each piece, the second by t=sin⁡x+cos⁡xt = \sin x + \cos x⁠. (5) Differentiate back.

Basics you need

1cot⁡x=cos⁡xsin⁡x\cot x = \frac{\cos x}{\sin x}

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

2Splitting a fraction

a−bD=aD−bD\frac{a - b}{D} = \frac{a}{D} - \frac{b}{D}⁠, so a cleverly written numerator splits the integrand into easy pieces. 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)⁠, dt=g′(x) dxdt = g'(x)\,dx⁠, and use ∫dtt=log⁡∣t∣+C\int\frac{dt}{t} = \log|t| + C (standard formula (xii)). 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?

    Two conditions:

    • cot⁡x\cot x must exist: sin⁡x≠0\sin x \ne 0⁠, that is, x≠nπx \ne n\pi⁠.
    • The denominator 1+cot⁡x1 + \cot x must not be zero. Multiplying by sin⁡x≠0\sin x \ne 0⁠, 1+cot⁡x=01 + \cot x = 0 means sin⁡x+cos⁡x=0\sin x + \cos x = 0⁠, that is, tan⁡x=−1\tan x = -1⁠, that is, x=−π4+nπx = -\frac{\pi}{4} + n\pi⁠.

    So ff is defined for all xx except x=nπx = n\pi and x=−π4+nπx = -\frac{\pi}{4} + n\pi (nn an integer).

    These excluded points tell us where the answer cannot be claimed (Note, Section 7.2). In particular sin⁡x+cos⁡x≠0\sin x + \cos x \ne 0 on the domain, which we need 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 cotangent

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

    11+cot⁡x=sin⁡xsin⁡x+sin⁡xcot⁡x=sin⁡xsin⁡x+cos⁡x.\begin{aligned} \frac{1}{1 + \cot x} &= \frac{\sin x}{\sin x + \sin x\cot x} \\ &= \frac{\sin x}{\sin x + \cos x}. \end{aligned}
    Working with sin⁡\sin and cos⁡\cos only makes the structure visible: the denominator sin⁡x+cos⁡x\sin x + \cos x has a simple derivative, cos⁡x−sin⁡x\cos x - \sin x⁠. Multiplying by sin⁡x\sin x is legitimate only because sin⁡x≠0\sin x \ne 0 on the domain.
    sin⁡x⋅cot⁡x=cos⁡x\sin x\cdot\cot x = \cos x⁠. Basics: trigonometric facts
  3. Split the numerator into "denominator" and "derivative of denominator"

    Let D=sin⁡x+cos⁡xD = \sin x + \cos x⁠, so D′=cos⁡x−sin⁡xD' = \cos x - \sin x⁠. Then

    12D−12D′=12(sin⁡x+cos⁡x)−12(cos⁡x−sin⁡x)=sin⁡x.\begin{aligned} \tfrac12 D - \tfrac12 D' &= \tfrac12(\sin x + \cos x) \\ &\quad - \tfrac12(\cos x - \sin x) \\ &= \sin x. \end{aligned}

    Hence

    sin⁡xsin⁡x+cos⁡x=12D−12D′D=12−12⋅cos⁡x−sin⁡xsin⁡x+cos⁡x.\begin{aligned} \frac{\sin x}{\sin x + \cos x} &= \frac{\frac12 D - \frac12 D'}{D} \\ &= \tfrac12 - \tfrac12\cdot\frac{\cos x - \sin x}{\sin x + \cos x}. \end{aligned}
    Why this split? A fraction DD\frac{D}{D} is just 1, and D′D\frac{D'}{D} integrates to log⁡∣D∣\log|D|⁠. Writing the numerator as a combination aD+bD′aD + bD' turns a hard fraction into these two easy ones. To find a,ba, b⁠: a(sin⁡x+cos⁡x)+b(cos⁡x−sin⁡x)=sin⁡xa(\sin x + \cos x) + b(\cos x - \sin x) = \sin x needs a−b=1a - b = 1 (coefficients of sin⁡x\sin x⁠) and a+b=0a + b = 0 (coefficients of cos⁡x\cos x⁠), so a=12a = \frac12⁠, b=−12b = -\frac12⁠.
    Same trick 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=sin⁡x+cos⁡xt = \sin x + \cos x⁠, so dt=(cos⁡x−sin⁡x) dxdt = (\cos x - \sin x)\,dx⁠:

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

    Together (Property (III) of Section 7.2.1, integral of a sum):

    ∫dx1+cot⁡x=x2−12log⁡∣sin⁡x+cos⁡x∣+C.\int\frac{dx}{1 + \cot x} = \frac{x}{2} - \tfrac12\log|\sin x + \cos x| + C.
    The substitution works because the numerator cos⁡x−sin⁡x\cos x - \sin x is exactly the derivative of t=sin⁡x+cos⁡xt = \sin x + \cos x (Section 7.3.1). The modulus is needed: sin⁡x+cos⁡x\sin x + \cos x is negative on parts of the domain (for example, at x=2.5x = 2.5 it is −0.2027…-0.2027\ldots⁠).
    Standard formula (xii), Section 7.2: ∫dtt=log⁡∣t∣+C\int\frac{dt}{t} = \log|t| + C⁠. Lesson: integration by substitution
  5. Check: differentiate the answer back

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

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

    Dividing top and bottom by sin⁡x\sin x gives 11+cot⁡x\frac{1}{1 + \cot x}⁠, the integrand. ✓

    Differentiating back is the test of an antiderivative (Property (I), Section 7.2.1). The last step reverses Step 2.
Result

∫dx1+cot⁡x=x2−12log⁡∣cos⁡x+sin⁡x∣+C,\int\frac{dx}{1 + \cot x} = \frac{x}{2} - \tfrac12\log|\cos x + \sin x| + C, valid wherever sin⁡x≠0\sin x \ne 0 and sin⁡x+cos⁡x≠0\sin x + \cos x \ne 0⁠. (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=1x = 1 and h=0.001h = 0.001⁠:

  • F(1.001)≈0.3389254072F(1.001) \approx 0.3389254072 and F(0.999)≈0.3377074490F(0.999) \approx 0.3377074490⁠,
  • slope ≈0.3389254072−0.33770744900.002\approx \frac{0.3389254072 - 0.3377074490}{0.002} ≈0.60898\approx 0.60898⁠,
  • integrand: 11+cot⁡1=11+0.642093=0.60898\frac{1}{1 + \cot 1} = \frac{1}{1 + 0.642093} = 0.60898⁠. ✓
Common mistakes
  1. Trying t=1+cot⁡xt = 1 + \cot x directly. Its derivative −cosec⁡2x-\operatorname{cosec}^2 x is not in the integrand, so that substitution does not close.
  2. Wrong split. Check 12D−12D′\frac12 D - \frac12 D' really equals sin⁡x\sin x by expanding; a sign error here flips the log term.
  3. Dropping the modulus. sin⁡x+cos⁡x\sin x + \cos x is negative on parts of the domain, so log⁡∣⋅∣\log|\cdot| is required.
What to take away
  1. For ∫asin⁡x+bcos⁡xcsin⁡x+dcos⁡x dx\int\frac{a\sin x + b\cos x}{c\sin x + d\cos x}\,dx⁠, write the numerator as λD+μD′\lambda D + \mu D' and solve for λ,μ\lambda, \mu by comparing coefficients.
  2. The DD part integrates to a multiple of xx⁠; the D′D' part to a multiple of log⁡∣D∣\log|D|⁠.
  3. Q33 (11−tan⁡x\frac{1}{1 - \tan x}⁠) uses exactly the same idea.

Every fact used, and where it comes from

FactUsed inSource
cot⁡x=cos⁡xsin⁡x\cot x = \frac{\cos x}{\sin 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=sin⁡x+cos⁡xt = \sin x + \cos 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 →