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

Miscellaneous · Q11: ∫dxcos⁡(x+a)cos⁡(x+b)\int\frac{dx}{\cos(x+a)\cos(x+b)}

Miscellaneous ExerciseTrigonometric identity trick (multiply by sin(a − b)) · Miscellaneous Exercise on Chapter 7
The question

Integrate the functions in Exercises 1 to 23.

11. 1cos⁡(x+a)cos⁡(x+b)\dfrac{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)}⁠.

Let k=sin⁡(a−b)k = \sin(a - b)⁠, where k≠0k \ne 0⁠. Writing a−b=(x+a)−(x+b)a - b = (x + a) - (x + b)⁠,

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

Multiplying and dividing by kk⁠, then writing kk in the expanded form above,

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

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

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

The one idea this problem is built on

The two angles x+ax + a and x+bx + b differ by the constant a−ba - b⁠. So the constant sin⁡(a−b)\sin(a - b) can be written as sin⁡[(x+a)−(x+b)]\sin\big[(x+a) - (x+b)\big] and expanded with the subtraction formula. Multiplying and dividing by sin⁡(a−b)\sin(a - b) then splits the integrand into tan⁡(x+a)−tan⁡(x+b)\tan(x+a) - \tan(x+b)⁠, whose integrals are standard logarithms. Exercise 7.3 Q22 uses the same trick.

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)}⁠, a,ba, b constants with sin⁡(a−b)≠0\sin(a - b) \ne 0 (the remark in the Result covers the other case). Defined where 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) Why this trick. (2) Multiply and divide by sin⁡(a−b)\sin(a - b) and expand. (3) Split into tangents. (4) Integrate. (5) Differentiate back.

Basics you need

1Subtraction formula

sin⁡(A−B)\sin(A - B) =sin⁡Acos⁡B−cos⁡Asin⁡B= \sin A\cos B - \cos A\sin B⁠. Basics: trigonometric identities

2∫tan⁡u du\int\tan u\,du

∫tan⁡u du=−log⁡∣cos⁡u∣+C\int\tan u\,du = -\log|\cos u| + C =log⁡∣sec⁡u∣+C= \log|\sec u| + C⁠, one of the standard trigonometric integrals of Section 7.3.1 (result (i) there). Lesson: integration by substitution

Solution

  1. Why this trick

    A product of two cosines in the denominator has no standard integral, and t=cos⁡(x+a)t = \cos(x+a) fails because there is no sin⁡(x+a)\sin(x+a) factor. But the angles differ by a constant, so a constant numerator can be "manufactured" from them: sin⁡(a−b)\sin(a - b) =sin⁡[(x+a)−(x+b)]= \sin\big[(x+a) - (x+b)\big]⁠.

    The expanded form of sin⁡[(x+a)−(x+b)]\sin\big[(x+a) - (x+b)\big] contains exactly the products sin⁡(x+a)cos⁡(x+b)\sin(x+a)\cos(x+b) and cos⁡(x+a)sin⁡(x+b)\cos(x+a)\sin(x+b)⁠. Dividing those by cos⁡(x+a)cos⁡(x+b)\cos(x+a)\cos(x+b) gives tangents. Multiplying and dividing by the non-zero constant sin⁡(a−b)\sin(a - b) does not change the integrand.
    Exercise 7.3 Q22 (Exercise 7.3 Q22) uses the same idea.
  2. Multiply and divide by sin⁡(a−b)\sin(a - b)⁠, and expand

    Let k=sin⁡(a−b)≠0k = \sin(a - b) \ne 0⁠. By the subtraction formula with A=x+aA = x + a⁠, B=x+bB = x + b⁠:

    k=sin⁡[(x+a)−(x+b)]=sin⁡(x+a)cos⁡(x+b)−cos⁡(x+a)sin⁡(x+b).\begin{aligned} k &= \sin\big[(x+a) - (x+b)\big] \\ &= \sin(x+a)\cos(x+b) \\ &\quad - \cos(x+a)\sin(x+b). \end{aligned}
    (x+a)−(x+b)=a−b(x + a) - (x + b) = a - b⁠: the xx's cancel, so the left side really is the constant kk⁠, for every xx⁠.
    Subtraction formula (Basic 1). Basics: trigonometric identities
  3. Split the integrand into tangents

    f(x)=1k⋅kcos⁡(x+a)cos⁡(x+b)=1k[sin⁡(x+a)cos⁡(x+b)cos⁡(x+a)cos⁡(x+b)−cos⁡(x+a)sin⁡(x+b)cos⁡(x+a)cos⁡(x+b)]=1k[tan⁡(x+a)−tan⁡(x+b)].\begin{aligned} f(x) &= \frac1k\cdot\frac{k}{\cos(x+a)\cos(x+b)} \\ &= \frac1k\Big[\frac{\sin(x+a)\cos(x+b)}{\cos(x+a)\cos(x+b)} \\ &\qquad - \frac{\cos(x+a)\sin(x+b)}{\cos(x+a)\cos(x+b)}\Big] \\ &= \frac1k\big[\tan(x+a) - \tan(x+b)\big]. \end{aligned}
    In the first fraction cos⁡(x+b)\cos(x+b) cancels, leaving tan⁡(x+a)\tan(x+a)⁠; in the second cos⁡(x+a)\cos(x+a) cancels, leaving tan⁡(x+b)\tan(x+b)⁠. Both cancellations are valid where ff is defined (both cosines non-zero).
    tan⁡u=sin⁡ucos⁡u\tan u = \frac{\sin u}{\cos u}⁠.
  4. Integrate

    With u=x+au = x + a (or x+bx + b⁠), du=dxdu = dx⁠, and ∫tan⁡u du=−log⁡∣cos⁡u∣\int\tan u\,du = -\log|\cos u|⁠:

    ∫f(x) dx=1k[−log⁡∣cos⁡(x+a)∣+log⁡∣cos⁡(x+b)∣]+C=1sin⁡(a−b)log⁡∣cos⁡(x+b)cos⁡(x+a)∣+C.\begin{aligned} \int f(x)\,dx &= \frac1k\big[-\log|\cos(x+a)| \\ &\qquad + \log|\cos(x+b)|\big] + C \\ &= \frac{1}{\sin(a-b)}\log\left|\frac{\cos(x+b)}{\cos(x+a)}\right| + C. \end{aligned}
    The difference of two logarithms is the logarithm of the quotient (applied to the positive numbers ∣cos⁡(x+b)∣|\cos(x+b)| and ∣cos⁡(x+a)∣|\cos(x+a)|⁠). This is exactly the textbook's answer.
    ∫tan⁡u du\int\tan u\,du⁠, Section 7.3.1 (Basic 2); log⁡p−log⁡q=log⁡pq\log p - \log q = \log\frac pq⁠. Basics: logarithms
  5. Check: differentiate the answer

    Since ddxlog⁡∣cos⁡(x+b)∣=−tan⁡(x+b)\frac{d}{dx}\log|\cos(x+b)| = -\tan(x+b) and ddxlog⁡∣cos⁡(x+a)∣=−tan⁡(x+a)\frac{d}{dx}\log|\cos(x+a)| = -\tan(x+a)⁠:

    F′=1k[tan⁡(x+a)−tan⁡(x+b)]=1k⋅sin⁡(x+a)cos⁡(x+b)−cos⁡(x+a)sin⁡(x+b)cos⁡(x+a)cos⁡(x+b)=1k⋅sin⁡(a−b)cos⁡(x+a)cos⁡(x+b)=1cos⁡(x+a)cos⁡(x+b). ✓\begin{aligned} F' &= \frac1k\big[\tan(x+a) - \tan(x+b)\big] \\ &= \frac1k\cdot\frac{\sin(x+a)\cos(x+b) - \cos(x+a)\sin(x+b)}{\cos(x+a)\cos(x+b)} \\ &= \frac1k\cdot\frac{\sin(a-b)}{\cos(x+a)\cos(x+b)} \\ &= \frac{1}{\cos(x+a)\cos(x+b)}. \ \checkmark \end{aligned}
    Putting the two tangents over the common denominator rebuilds sin⁡(a−b)=k\sin(a - b) = k in the numerator (Step 2 in reverse), which cancels the 1k\frac1k⁠. The answer is valid on every interval where both cosines are non-zero.
Result

For sin⁡(a−b)≠0\sin(a - b) \ne 0⁠, wherever cos⁡(x+a)cos⁡(x+b)≠0\cos(x+a)\cos(x+b) \ne 0⁠:

∫dxcos⁡(x+a)cos⁡(x+b)=1sin⁡(a−b)log⁡∣cos⁡(x+b)cos⁡(x+a)∣+C.\begin{aligned} &\int\frac{dx}{\cos(x+a)\cos(x+b)} \\ &= \frac{1}{\sin(a-b)}\log\left|\frac{\cos(x+b)}{\cos(x+a)}\right| + C. \end{aligned}

(Textbook answer: 1sin⁡(a−b)log⁡∣cos⁡(x+b)cos⁡(x+a)∣+C\frac{1}{\sin(a-b)}\log\left|\frac{\cos(x+b)}{\cos(x+a)}\right| + C⁠, the same.)

Remark: if sin⁡(a−b)=0\sin(a - b) = 0⁠, then a−b=nπa - b = n\pi and cos⁡(x+a)=(−1)ncos⁡(x+b)\cos(x+a) = (-1)^n\cos(x+b)⁠, so the integrand is (−1)nsec⁡2(x+b)(-1)^n\sec^2(x+b) and the integral is (−1)ntan⁡(x+b)+C(-1)^n\tan(x+b) + C⁠.

Check it with numbers

Take a=π3a = \frac\pi3⁠, b=0b = 0⁠, so sin⁡(a−b)=32\sin(a - b) = \frac{\sqrt3}{2}⁠, and integrate from 0 to π12\frac{\pi}{12} (both cosines stay positive). With cos⁡5π12=sin⁡π12\cos\frac{5\pi}{12} = \sin\frac{\pi}{12} and cot⁡π12=2+3\cot\frac{\pi}{12} = 2 + \sqrt3⁠:

F(π12)−F(0)=23[log⁡(2+3)−log⁡2]≈0.7203146.\begin{aligned} F\big(\tfrac{\pi}{12}\big) - F(0) &= \tfrac{2}{\sqrt3}\big[\log(2 + \sqrt3) - \log 2\big] \\ &\approx 0.7203146. \end{aligned}

Numerical integration over the same interval also gives 0.72031460.7203146⁠.

Common mistakes
  1. Using sin⁡(b−a)\sin(b - a) instead of sin⁡(a−b)\sin(a - b): the expansion must start with sin⁡(x+a)cos⁡(x+b)\sin(x+a)\cos(x+b) for the signs in Step 3 to come out as tan⁡(x+a)−tan⁡(x+b)\tan(x+a) - \tan(x+b)⁠.
  2. Inverting the fraction inside the log. ∫tan⁡(x+a) dx=−log⁡∣cos⁡(x+a)∣\int\tan(x+a)\,dx = -\log|\cos(x+a)|⁠, so cos⁡(x+a)\cos(x+a) ends up in the denominator.
  3. Ignoring the case sin⁡(a−b)=0\sin(a - b) = 0, where the trick divides by zero.
What to take away
  1. For 1cos⁡(x+a)cos⁡(x+b)\frac{1}{\cos(x+a)\cos(x+b)}⁠, 1sin⁡(x+a)sin⁡(x+b)\frac{1}{\sin(x+a)\sin(x+b)} or 1sin⁡(x+a)cos⁡(x+b)\frac{1}{\sin(x+a)\cos(x+b)}⁠: multiply and divide by the sine or cosine of the constant difference of the angles.
  2. ∫tan⁡u du=−log⁡∣cos⁡u∣+C\int\tan u\,du = -\log|\cos u| + C and ∫cot⁡u du=log⁡∣sin⁡u∣+C\int\cot u\,du = \log|\sin u| + C⁠.

Every fact used, and where it comes from

FactUsed inSource
sin⁡(A−B)\sin(A - B) =sin⁡Acos⁡B−cos⁡Asin⁡B= \sin A\cos B - \cos A\sin BSteps 2, 5Trigonometry (Class XI) (Basics)
tan⁡u=sin⁡ucos⁡u\tan u = \frac{\sin u}{\cos u}Step 3Trigonometry
∫tan⁡x dx=log⁡∣sec⁡x∣+C\int\tan x\,dx = \log|\sec x| + CStep 4Section 7.3.1, result (i)
Substitution u=x+au = x + aStep 4Section 7.3.1
log⁡p−log⁡q=log⁡pq\log p - \log q = \log\frac pqStep 4Algebra (Basics)
Chain ruleStep 5Chapter 5
All decimalsCheckRecomputed in the site's verification script
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 →