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

Exercise 7.3 · Q14: ∫cos⁡x−sin⁡x1+sin⁡2x dx\int\frac{\cos x-\sin x}{1+\sin 2x}\,dx

Exercise 7.3Integration using trigonometric identities · Section 7.3.2
The question

Find the integral of the function

cos⁡x−sin⁡x1+sin⁡2x.\frac{\cos x - \sin x}{1 + \sin 2x}.
Exam answer

Let I=∫cos⁡x−sin⁡x1+sin⁡2x dxI = \displaystyle\int\frac{\cos x - \sin x}{1 + \sin 2x}\,dx⁠.

Using sin⁡2x+cos⁡2x=1\sin^2 x + \cos^2 x = 1 and sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2\sin x\cos x⁠,

1+sin⁡2x=(sin⁡x+cos⁡x)21 + \sin 2x = (\sin x + \cos x)^2

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=∫dtt2=−1t+C\therefore\ I = \int\frac{dt}{t^2} = -\frac1t + C

∴ I=−1cos⁡x+sin⁡x+C\therefore\ I = -\dfrac{1}{\cos x + \sin x} + C⁠.

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

The one idea this problem is built on

Write the 1 as sin⁡2x+cos⁡2x\sin^2 x + \cos^2 x and sin⁡2x\sin 2x as 2sin⁡xcos⁡x2\sin x\cos x⁠: then 1+sin⁡2x=(sin⁡x+cos⁡x)21 + \sin 2x = (\sin x + \cos x)^2⁠, a perfect square. The numerator cos⁡x−sin⁡x\cos x - \sin x is exactly the derivative of sin⁡x+cos⁡x\sin x + \cos x⁠. So t=sin⁡x+cos⁡xt = \sin x + \cos x turns the integral into ∫dtt2\int\frac{dt}{t^2}⁠.

Given, to find, and the plan
Given
f(x)=cos⁡x−sin⁡x1+sin⁡2xf(x) = \dfrac{\cos x - \sin x}{1 + \sin 2x}⁠, defined wherever 1+sin⁡2x≠01 + \sin 2x \ne 0⁠.
To find
∫cos⁡x−sin⁡x1+sin⁡2x dx\displaystyle\int \frac{\cos x - \sin x}{1 + \sin 2x}\,dx⁠.
Plan
(1) Write the denominator as a perfect square and find where it vanishes. (2) Substitute t=sin⁡x+cos⁡xt = \sin x + \cos x⁠. (3) Integrate t−2t^{-2} by the power rule. (4) Return to xx⁠. (5) Differentiate back.

Basics you need

1Two identities

sin⁡2x+cos⁡2x=1\sin^2 x + \cos^2 x = 1 and sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2\sin x\cos x⁠. Together they give 1+sin⁡2x=(sin⁡x+cos⁡x)21 + \sin 2x = (\sin x + \cos x)^2⁠. Basics: trigonometric identities for integrals

2Substitution

If t=g(x)t = g(x) then dt=g′(x) dxdt = g'(x)\,dx⁠. Look for a function whose derivative sits in the integrand. Basics: substitution

3The power rule for integrals

∫tn dt=tn+1n+1+C\int t^n\,dt = \dfrac{t^{n+1}}{n+1} + C for n≠−1n \ne -1 (standard formula (i), Section 7.2). With n=−2n = -2⁠: ∫t−2 dt=−t−1+C\int t^{-2}\,dt = -t^{-1} + C⁠. Basics: powers and the power rule

Solution

  1. Rewrite the denominator as a perfect square

    1+sin⁡2x=(sin⁡2x+cos⁡2x)+2sin⁡xcos⁡x=sin⁡2x+2sin⁡xcos⁡x+cos⁡2x=(sin⁡x+cos⁡x)2.\begin{aligned} 1 + \sin 2x &= (\sin^2 x + \cos^2 x) + 2\sin x\cos x \\ &= \sin^2 x + 2\sin x\cos x + \cos^2 x \\ &= (\sin x + \cos x)^2. \end{aligned}

    So the integrand is defined exactly when sin⁡x+cos⁡x≠0\sin x + \cos x \ne 0⁠, that is, tan⁡x≠−1\tan x \ne -1⁠, that is,

    x≠nπ−π4,n an integer.x \ne n\pi - \frac{\pi}{4}, \quad n \text{ an integer}.
    The plain "1" hides a Pythagorean identity. Replacing it by sin⁡2x+cos⁡2x\sin^2 x + \cos^2 x and sin⁡2x\sin 2x by 2sin⁡xcos⁡x2\sin x\cos x gives the pattern a2+2ab+b2=(a+b)2a^2 + 2ab + b^2 = (a + b)^2⁠. (When cos⁡x=0\cos x = 0⁠, sin⁡x=±1\sin x = \pm 1⁠, so sin⁡x+cos⁡x≠0\sin x + \cos x \ne 0⁠; dividing by cos⁡x\cos x to get tan⁡x≠−1\tan x \ne -1 is therefore safe.)
    sin⁡2x+cos⁡2x=1\sin^2 x + \cos^2 x = 1⁠; sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2\sin x\cos x⁠. Basics: trigonometric identities for integrals
  2. Substitute t=sin⁡x+cos⁡xt = \sin x + \cos x

    Let t=sin⁡x+cos⁡xt = \sin x + \cos x⁠. Then

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

    This is exactly the numerator times dxdx⁠. So

    ∫cos⁡x−sin⁡x(sin⁡x+cos⁡x)2 dx=∫dtt2.\int \frac{\cos x - \sin x}{(\sin x + \cos x)^2}\,dx = \int \frac{dt}{t^2}.
    The derivative of the expression inside the square is sitting in the numerator, with no extra constant. That is the signal for substitution: the whole integrand becomes a function of tt times dtdt⁠. On our domain t≠0t \ne 0⁠, so 1t2\frac{1}{t^2} makes sense.
    ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos x⁠, ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin x⁠; change of variable, Section 7.3.1. Lesson: integration by substitution
  3. Integrate by the power rule

    ∫t−2 dt=t−2+1−2+1+C=t−1−1+C=−1t+C.\begin{aligned} \int t^{-2}\,dt &= \frac{t^{-2+1}}{-2+1} + C \\ &= \frac{t^{-1}}{-1} + C = -\frac{1}{t} + C. \end{aligned}
    Formula (i) holds for every n≠−1n \ne -1⁠; here n=−2n = -2⁠, so it applies. The new exponent is −1-1 and we divide by −1-1⁠, which produces the minus sign.
    Standard formula (i), Section 7.2. Basics: powers and the power rule
  4. Return to xx

    ∫cos⁡x−sin⁡x1+sin⁡2x dx=−1sin⁡x+cos⁡x+C.\int \frac{\cos x - \sin x}{1 + \sin 2x}\,dx = -\frac{1}{\sin x + \cos x} + C.
    The question is in xx⁠, so the answer must be too: replace tt by sin⁡x+cos⁡x\sin x + \cos x⁠. This is the textbook's form, since cos⁡x+sin⁡x\cos x + \sin x and sin⁡x+cos⁡x\sin x + \cos x are the same.
  5. Check: differentiate the answer back

    Write the answer as −(sin⁡x+cos⁡x)−1-(\sin x + \cos x)^{-1} and use the chain rule with inner function u=sin⁡x+cos⁡xu = \sin x + \cos x⁠:

    ddx[−u−1]=u−2 dudx=(sin⁡x+cos⁡x)−2(cos⁡x−sin⁡x)=cos⁡x−sin⁡x(sin⁡x+cos⁡x)2=cos⁡x−sin⁡x1+sin⁡2x.\begin{aligned} \frac{d}{dx}\left[-u^{-1}\right] &= u^{-2}\,\frac{du}{dx} \\ &= (\sin x + \cos x)^{-2}(\cos x - \sin x) \\ &= \frac{\cos x - \sin x}{(\sin x + \cos x)^2} \\ &= \frac{\cos x - \sin x}{1 + \sin 2x}. \end{aligned}

    The last line uses Step 1. This is the integrand, so the answer is correct on every interval where sin⁡x+cos⁡x≠0\sin x + \cos x \ne 0⁠.

    Chain rule (Theorem 4, Section 5.3.1); Property (I), Section 7.2.1. Basics: integration undoes differentiation
Result ∫cos⁡x−sin⁡x1+sin⁡2x dx=−1cos⁡x+sin⁡x+C,\int\frac{\cos x - \sin x}{1 + \sin 2x}\,dx = -\frac{1}{\cos x + \sin x} + C,

valid on any interval on which cos⁡x+sin⁡x≠0\cos x + \sin x \ne 0 (that is, avoiding x=nπ−π4x = n\pi - \frac{\pi}{4}⁠). (Textbook answer: −1cos⁡x+sin⁡x+C-\frac{1}{\cos x + \sin x} + C⁠.)

Check it with numbers

Let F(x)=−1cos⁡x+sin⁡xF(x) = -\frac{1}{\cos x + \sin x} and look near x=0.5x = 0.5 with h=0.0001h = 0.0001⁠:

  • F(0.5001)≈−0.736893659439F(0.5001) \approx -0.736893659439 and F(0.4999)≈−0.736936902806F(0.4999) \approx -0.736936902806⁠.
  • Slope estimate: F(0.5001)−F(0.4999)0.0002≈0.216217\dfrac{F(0.5001) - F(0.4999)}{0.0002} \approx 0.216217⁠.
  • Integrand at x=0.5x = 0.5⁠: cos⁡0.5−sin⁡0.51+sin⁡1≈0.216217\dfrac{\cos 0.5 - \sin 0.5}{1 + \sin 1} \approx 0.216217⁠.

They agree.

Common mistakes
  1. Not spotting the square. 1+sin⁡2x1 + \sin 2x looks like it needs a new formula, but it is (sin⁡x+cos⁡x)2(\sin x + \cos x)^2 once the 1 is written as sin⁡2x+cos⁡2x\sin^2 x + \cos^2 x⁠.
  2. A sign slip in dtdt⁠. ddx(sin⁡x+cos⁡x)=cos⁡x−sin⁡x\frac{d}{dx}(\sin x + \cos x) = \cos x - \sin x⁠, not cos⁡x+sin⁡x\cos x + \sin x⁠.
  3. Writing ∫dtt2=log⁡t2\int\frac{dt}{t^2} = \log t^2⁠. The log rule is only for 1t\frac1t⁠. For t−2t^{-2} use the power rule.
  4. Losing the minus sign. ∫t−2 dt=−t−1+C\int t^{-2}\,dt = -t^{-1} + C⁠, because we divide by −1-1⁠.
What to take away
  1. 1±sin⁡2x=(sin⁡x±cos⁡x)21 \pm \sin 2x = (\sin x \pm \cos x)^2 is worth remembering; it appears often.
  2. When the numerator is the derivative of the expression inside a power in the denominator, substitute for that expression.
  3. Compare Question 20, where cos⁡2x\cos 2x over the same square leads to a logarithm instead of a power.

Every fact used, and where it comes from

FactUsed inSource
sin⁡2x+cos⁡2x=1\sin^2 x + \cos^2 x = 1⁠, sin⁡2x=2sin⁡xcos⁡x\sin 2x = 2\sin x\cos xSteps 1, 5Class XI trigonometry (Basics: trigonometric identities)
ddxsin⁡x=cos⁡x\frac{d}{dx}\sin x = \cos x⁠, ddxcos⁡x=−sin⁡x\frac{d}{dx}\cos x = -\sin xSteps 2, 5List in Section 7.2, (ii) and (iii)
Change of variable (substitution)Step 2Section 7.3.1 (Lesson: integration by substitution)
∫tn dt=tn+1n+1+C\int t^n\,dt = \frac{t^{n+1}}{n+1} + C⁠, n≠−1n \ne -1Step 3Standard formula (i), Section 7.2
Chain ruleStep 5Theorem 4, Section 5.3.1
Differentiation undoes integrationStep 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 →