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

Exercise 7.3 · Q22: ∫dxcos⁡(x−a)cos⁡(x−b)\int\frac{dx}{\cos(x-a)\cos(x-b)}

Exercise 7.3Integration using trigonometric identities · Section 7.3.2
The question

Find the integral of the function

1cos⁡(x−a)cos⁡(x−b).\frac{1}{\cos(x - a)\cos(x - b)}.
Exam answer

Let I=∫dxcos⁡(x−a)cos⁡(x−b)I = \displaystyle\int\frac{dx}{\cos(x - a)\cos(x - b)}⁠.

Assuming sin⁡(a−b)≠0\sin(a - b) \ne 0⁠, and multiplying and dividing by it,

I=1sin⁡(a−b)×∫sin⁡(a−b)cos⁡(x−a)cos⁡(x−b) dx\begin{aligned} I &= \frac{1}{\sin(a - b)} \\ &\quad \times\int\frac{\sin(a - b)}{\cos(x - a)\cos(x - b)}\,dx \end{aligned}

Using sin⁡(A−B)\sin(A - B) =sin⁡Acos⁡B−cos⁡Asin⁡B= \sin A\cos B - \cos A\sin B⁠,

sin⁡(a−b)=sin⁡((x−b)−(x−a))=sin⁡(x−b)cos⁡(x−a)−cos⁡(x−b)sin⁡(x−a)\begin{aligned} &\sin(a - b) \\ &= \sin\big((x - b) - (x - a)\big) \\ &= \sin(x - b)\cos(x - a) \\ &\quad - \cos(x - b)\sin(x - a) \end{aligned}

Dividing by cos⁡(x−a)cos⁡(x−b)\cos(x - a)\cos(x - b)⁠, and using ∫tan⁡x dx=−log⁡∣cos⁡x∣+C\displaystyle\int\tan x\,dx = -\log|\cos x| + C⁠,

I=1sin⁡(a−b)∫(tan⁡(x−b)−tan⁡(x−a)) dx=1sin⁡(a−b)(−log⁡∣cos⁡(x−b)∣+log⁡∣cos⁡(x−a)∣)+C\begin{aligned} I &= \frac{1}{\sin(a - b)}\int\big(\tan(x - b) \\ &\qquad - \tan(x - a)\big)\,dx \\ &= \frac{1}{\sin(a - b)}\Big(-\log|\cos(x - b)| \\ &\qquad + \log|\cos(x - a)|\Big) + C \end{aligned}

∴ I=1sin⁡(a−b)log⁡∣cos⁡(x−a)cos⁡(x−b)∣\therefore\ I = \dfrac{1}{\sin(a - b)}\log\left|\dfrac{\cos(x - a)}{\cos(x - b)}\right| +C+ C⁠, where sin⁡(a−b)≠0\sin(a - b) \ne 0⁠.

The answer key's form needs sin⁡(a−b)≠0\sin(a - b) \ne 0⁠; if a−b=nπa - b = n\pi⁠, the integral is (−1)ntan⁡(x−a)+C(-1)^n\tan(x - a) + C⁠.

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

The one idea this problem is built on

The constant a−ba - b is the difference of the two angles: a−b=(x−b)−(x−a)a - b = (x - b) - (x - a)⁠. So multiply and divide by sin⁡(a−b)\sin(a - b) and expand sin⁡[(x−b)−(x−a)]\sin\big[(x - b) - (x - a)\big] with the subtraction formula. The product in the denominator then splits into tan⁡(x−b)−tan⁡(x−a)\tan(x - b) - \tan(x - a)⁠, and each tangent integrates to a logarithm.

Given, to find, and the plan
Given
f(x)=1cos⁡(x−a)cos⁡(x−b)f(x) = \dfrac{1}{\cos(x - a)\cos(x - b)}⁠, where aa⁠, bb are constants; defined wherever cos⁡(x−a)≠0\cos(x - a) \ne 0 and cos⁡(x−b)≠0\cos(x - b) \ne 0⁠.
To find
∫dxcos⁡(x−a)cos⁡(x−b)\displaystyle\int \frac{dx}{\cos(x - a)\cos(x - b)}⁠.
Plan
(1) Domain, and the condition sin⁡(a−b)≠0\sin(a - b) \ne 0⁠. (2) Write sin⁡(a−b)\sin(a - b) as sin⁡[(x−b)−(x−a)]\sin\big[(x - b) - (x - a)\big] and expand. (3) Multiply and divide by sin⁡(a−b)\sin(a - b) and split. (4) Integrate the tangents. (5) Differentiate back. (6) The case sin⁡(a−b)=0\sin(a - b) = 0⁠.

Basics you need

1The subtraction formula for sine

sin⁡(A−B)=sin⁡Acos⁡B−cos⁡Asin⁡B\sin(A - B) = \sin A\cos B - \cos A\sin B for all real AA⁠, BB⁠. Basics: trigonometric identities for integrals

2The integral of tan⁡\tan

∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + C (Section 7.3.1, result (i)), which is the same as −log⁡∣cos⁡x∣+C-\log|\cos x| + C⁠. With u=x−bu = x - b⁠, du=dxdu = dx⁠, the same holds for tan⁡(x−b)\tan(x - b)⁠. Basics: logarithms and 1/x

3Laws of logarithms

log⁡∣P∣−log⁡∣Q∣=log⁡∣PQ∣\log|P| - \log|Q| = \log\left|\frac{P}{Q}\right| for P,Q≠0P, Q \ne 0⁠.

Solution

  1. Where is the integrand defined, and what we assume

    We need cos⁡(x−a)≠0\cos(x - a) \ne 0 and cos⁡(x−b)≠0\cos(x - b) \ne 0⁠, that is, x≠a+π2+nπx \ne a + \frac{\pi}{2} + n\pi and x≠b+π2+nπx \ne b + \frac{\pi}{2} + n\pi (nn an integer). We work on an interval avoiding all these points.

    The method divides by sin⁡(a−b)\sin(a - b)⁠, so in Steps 2 to 5 we assume

    sin⁡(a−b)≠0,that is,a−b≠nπ.\sin(a - b) \ne 0, \quad\text{that is,}\quad a - b \ne n\pi.

    The remaining case a−b=nπa - b = n\pi is treated in Step 6.

    The textbook's answer has sin⁡(a−b)\sin(a - b) in a denominator, so it silently assumes this condition. Stating it, and covering the other case, makes the solution complete.
  2. Write sin⁡(a−b)\sin(a - b) using the two angles

    Since (x−b)−(x−a)=a−b(x - b) - (x - a) = a - b⁠,

    sin⁡(a−b)=sin⁡[(x−b)−(x−a)]=sin⁡(x−b)cos⁡(x−a)−cos⁡(x−b)sin⁡(x−a).\begin{aligned} \sin(a - b) &= \sin\big[(x - b) - (x - a)\big] \\ &= \sin(x - b)\cos(x - a) \\ &\quad - \cos(x - b)\sin(x - a). \end{aligned}
    The denominator contains cos⁡(x−a)\cos(x - a) and cos⁡(x−b)\cos(x - b)⁠. Expanding the sine of the difference of these two angles produces exactly those cosines in each term, which is what will let us cancel. Although xx appears inside, the left side is the constant sin⁡(a−b)\sin(a - b)⁠.
    sin⁡(A−B)=sin⁡Acos⁡B−cos⁡Asin⁡B\sin(A - B) = \sin A\cos B - \cos A\sin B with A=x−bA = x - b⁠, B=x−aB = x - a⁠. Basics: trigonometric identities for integrals
  3. Multiply and divide by sin⁡(a−b)\sin(a - b)⁠, then split

    Write k=sin⁡(a−b)k = \sin(a - b)⁠, a non-zero constant. Then

    f(x)=1k⋅sin⁡(a−b)cos⁡(x−a)cos⁡(x−b).f(x) = \frac1k\cdot\frac{\sin(a - b)}{\cos(x - a)\cos(x - b)}.

    Replace the top sin⁡(a−b)\sin(a - b) by its expansion from Step 2 and split:

    sin⁡(a−b)cos⁡(x−a)cos⁡(x−b)=sin⁡(x−b)cos⁡(x−a)cos⁡(x−a)cos⁡(x−b)−cos⁡(x−b)sin⁡(x−a)cos⁡(x−a)cos⁡(x−b)=sin⁡(x−b)cos⁡(x−b)−sin⁡(x−a)cos⁡(x−a)=tan⁡(x−b)−tan⁡(x−a).\begin{aligned} \frac{\sin(a - b)}{\cos(x - a)\cos(x - b)} &= \frac{\sin(x - b)\cos(x - a)}{\cos(x - a)\cos(x - b)} \\ &\quad - \frac{\cos(x - b)\sin(x - a)}{\cos(x - a)\cos(x - b)} \\ &= \frac{\sin(x - b)}{\cos(x - b)} - \frac{\sin(x - a)}{\cos(x - a)} \\ &= \tan(x - b) - \tan(x - a). \end{aligned}

    So

    f(x)=1sin⁡(a−b)[tan⁡(x−b)−tan⁡(x−a)].f(x) = \frac{1}{\sin(a - b)}\big[\tan(x - b) - \tan(x - a)\big].
    Multiplying by sin⁡(a−b)sin⁡(a−b)=1\frac{\sin(a - b)}{\sin(a - b)} = 1 changes nothing (allowed because sin⁡(a−b)≠0\sin(a - b) \ne 0⁠). After the expansion, cos⁡(x−a)\cos(x - a) cancels in the first fraction and cos⁡(x−b)\cos(x - b) cancels in the second, which is valid because both are non-zero on our interval.
    A−BD=AD−BD\frac{A - B}{D} = \frac AD - \frac BD⁠; tan⁡θ=sin⁡θcos⁡θ\tan\theta = \frac{\sin\theta}{\cos\theta}⁠. Basics: splitting fractions
  4. Integrate the two tangents

    By Section 7.3.1 (i), with the substitution u=x−bu = x - b (so du=dxdu = dx⁠), ∫tan⁡(x−b) dx=−log⁡∣cos⁡(x−b)∣\int\tan(x - b)\,dx = -\log|\cos(x - b)|⁠, and likewise for x−ax - a⁠. Hence

    ∫f(x) dx=1sin⁡(a−b)[−log⁡∣cos⁡(x−b)∣+log⁡∣cos⁡(x−a)∣]+C=1sin⁡(a−b)log⁡∣cos⁡(x−a)cos⁡(x−b)∣+C.\begin{aligned} \int f(x)\,dx &= \frac{1}{\sin(a - b)}\Big[-\log|\cos(x - b)| \\ &\qquad + \log|\cos(x - a)|\Big] + C \\ &= \frac{1}{\sin(a - b)}\log\left|\frac{\cos(x - a)}{\cos(x - b)}\right| + C. \end{aligned}
    1sin⁡(a−b)\frac{1}{\sin(a - b)} is a constant, so it stays outside (Property (IV)), and the difference is integrated term by term (Property (V)). The minus sign in front of tan⁡(x−a)\tan(x - a) turns −log⁡∣cos⁡(x−a)∣-\log|\cos(x - a)| into +log⁡∣cos⁡(x−a)∣+\log|\cos(x - a)|⁠. Finally the two logarithms combine into the logarithm of a quotient.
    ∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + C⁠, Section 7.3.1; Properties (IV), (V), Section 7.2.1. Lesson: integration by substitution
  5. Check: differentiate the answer back

    By the chain rule,

    ddxlog⁡∣cos⁡(x−a)∣=−sin⁡(x−a)cos⁡(x−a)=−tan⁡(x−a),\begin{aligned} \frac{d}{dx}\log|\cos(x - a)| &= \frac{-\sin(x - a)}{\cos(x - a)} \\ &= -\tan(x - a), \end{aligned}

    and similarly for bb⁠. Let F(x)F(x) be our answer without CC⁠, and again k=sin⁡(a−b)k = \sin(a - b)⁠. Then

    F′(x)=1k[−tan⁡(x−a)+tan⁡(x−b)]=1k⋅sin⁡(a−b)cos⁡(x−a)cos⁡(x−b)=1cos⁡(x−a)cos⁡(x−b).\begin{aligned} F'(x) &= \frac1k\big[-\tan(x - a) + \tan(x - b)\big] \\ &= \frac1k\cdot\frac{\sin(a - b)}{\cos(x - a)\cos(x - b)} \\ &= \frac{1}{\cos(x - a)\cos(x - b)}. \end{aligned}

    The second line is the split of Step 3 read backwards (put the two tangents over the common denominator cos⁡(x−a)cos⁡(x−b)\cos(x - a)\cos(x - b) and use Step 2 for the numerator). This is the integrand, so the answer is correct whenever sin⁡(a−b)≠0\sin(a - b) \ne 0⁠.

    Chain rule (Theorem 4, Section 5.3.1); Property (I), Section 7.2.1. Basics: integration undoes differentiation
  6. The excluded case a−b=nπa - b = n\pi

    If a−b=nπa - b = n\pi⁠, then x−b=(x−a)+nπx - b = (x - a) + n\pi⁠, so cos⁡(x−b)=(−1)ncos⁡(x−a)\cos(x - b) = (-1)^n\cos(x - a)⁠. The integrand becomes (−1)nsec⁡2(x−a)(-1)^n\sec^2(x - a)⁠, and

    ∫dxcos⁡(x−a)cos⁡(x−b)=(−1)ntan⁡(x−a)+C.\int\frac{dx}{\cos(x - a)\cos(x - b)} = (-1)^n\tan(x - a) + C.
    Here the two cosines are the same function up to sign, so no splitting is needed: standard formula (iv) with u=x−au = x - a does it. This case is not covered by the textbook's formula, which would have sin⁡(a−b)=0\sin(a - b) = 0 in a denominator.
    cos⁡(θ+nπ)=(−1)ncos⁡θ\cos(\theta + n\pi) = (-1)^n\cos\theta⁠; standard formula (iv), Section 7.2.
Result ∫dxcos⁡(x−a)cos⁡(x−b)=1sin⁡(a−b)log⁡∣cos⁡(x−a)cos⁡(x−b)∣+C,\begin{aligned} &\int\frac{dx}{\cos(x - a)\cos(x - b)} \\ &\quad = \frac{1}{\sin(a - b)}\log\left|\frac{\cos(x - a)}{\cos(x - b)}\right| + C, \end{aligned}

valid when sin⁡(a−b)≠0\sin(a - b) \ne 0⁠, on any interval where cos⁡(x−a)\cos(x - a) and cos⁡(x−b)\cos(x - b) are non-zero. (If a−b=nπa - b = n\pi⁠, the integral is (−1)ntan⁡(x−a)+C(-1)^n\tan(x - a) + C⁠.) (Textbook answer: 1sin⁡(a−b)log⁡∣cos⁡(x−a)cos⁡(x−b)∣+C\frac{1}{\sin(a - b)}\log\left|\frac{\cos(x - a)}{\cos(x - b)}\right| + C⁠.)

Check it with numbers

Take a=0.3a = 0.3⁠, b=1.1b = 1.1⁠, so sin⁡(a−b)=sin⁡(−0.8)≈−0.717356\sin(a - b) = \sin(-0.8) \approx -0.717356⁠. Let F(x)F(x) be the answer without CC and look near x=0.5x = 0.5 with h=0.0001h = 0.0001⁠:

  • F(0.5001)≈−0.239409291976F(0.5001) \approx -0.239409291976 and F(0.4999)≈−0.239656546264F(0.4999) \approx -0.239656546264⁠.
  • Slope estimate: F(0.5001)−F(0.4999)0.0002≈1.236271\dfrac{F(0.5001) - F(0.4999)}{0.0002} \approx 1.236271⁠.
  • Integrand at x=0.5x = 0.5⁠: 1cos⁡0.2 cos⁡(−0.6)≈1.236271\dfrac{1}{\cos 0.2\,\cos(-0.6)} \approx 1.236271⁠.

They agree.

Common mistakes
  1. Using sin⁡(b−a)\sin(b - a) and then mixing up the signs. With sin⁡(b−a)\sin(b - a) you get tan⁡(x−a)−tan⁡(x−b)\tan(x - a) - \tan(x - b) and the answer 1sin⁡(b−a)log⁡∣cos⁡(x−b)cos⁡(x−a)∣\frac{1}{\sin(b - a)}\log\left|\frac{\cos(x - b)}{\cos(x - a)}\right|⁠, which is the same function. Choose one order and keep it.
  2. Treating sin⁡(a−b)\sin(a - b) as depending on xx⁠. It is a constant, even when written as sin⁡[(x−b)−(x−a)]\sin\big[(x - b) - (x - a)\big]⁠.
  3. Forgetting ∫tan⁡u du=−log⁡∣cos⁡u∣\int\tan u\,du = -\log|\cos u| carries a minus sign.
  4. Ignoring the case sin⁡(a−b)=0\sin(a - b) = 0⁠. The formula then breaks down; the integral is a tangent instead.
What to take away
  1. For 1cos⁡(x−a)cos⁡(x−b)\frac{1}{\cos(x - a)\cos(x - b)} or 1sin⁡(x−a)sin⁡(x−b)\frac{1}{\sin(x - a)\sin(x - b)}⁠: multiply and divide by sin⁡(a−b)\sin(a - b)⁠, written as the sine of the difference of the two angles.
  2. Multiplying by a cleverly chosen 1 is a standard way to split a product into a difference.

Every fact used, and where it comes from

FactUsed inSource
sin⁡(A−B)=sin⁡Acos⁡B−cos⁡Asin⁡B\sin(A - B) = \sin A\cos B - \cos A\sin BSteps 2, 5Class XI trigonometry (Basics: trigonometric identities)
tan⁡θ=sin⁡θcos⁡θ\tan\theta = \frac{\sin\theta}{\cos\theta}Step 3Definition
∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + CStep 4Section 7.3.1, result (i)
Constants out; ∫\int of a linear combinationStep 4Properties (IV), (V), Section 7.2.1
log⁡∣P∣−log⁡∣Q∣=log⁡∣PQ∣\log|P| - \log|Q| = \log\left|\frac PQ\right|Step 4Laws of logarithms
Chain ruleStep 5Theorem 4, Section 5.3.1
Differentiation undoes integrationStep 5Property (I), Section 7.2.1
cos⁡(θ+nπ)=(−1)ncos⁡θ\cos(\theta + n\pi) = (-1)^n\cos\theta⁠; ∫sec⁡2x dx=tan⁡x+C\int\sec^2 x\,dx = \tan x + CStep 6Class XI; standard formula (iv), Section 7.2
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 →