Integrate the functions in Exercises 1 to 23.
\(\frac{1}{\cos (x + a) \cos (x + b)}\)Show solutionHide solution
Let \[ I=\int \frac{dx}{\cos(x+a)\cos(x+b)}. \] The integrand is defined only where \( \cos(x+a)\neq 0 \) and \( \cos(x+b)\neq 0 \); all answers below are on such intervals.
Assume first that \( \sin(a-b)\neq 0 \). Since \((x+a)-(x+b)=a-b\), we have \[ \sin(a-b)=\sin(x+a)\cos(x+b)-\cos(x+a)\sin(x+b). \] Dividing by \(\cos(x+a)\cos(x+b)\), \[ \tan(x+a)-\tan(x+b)=\frac{\sin(a-b)}{\cos(x+a)\cos(x+b)}. \] Hence \[ I=\frac{1}{\sin(a-b)}\int\bigl(\tan(x+a)-\tan(x+b)\bigr)\,dx. \] Using \(\int \tan u\,du=-\ln|\cos u|+C\), \[ I=\frac{1}{\sin(a-b)}\left[-\ln|\cos(x+a)|+\ln|\cos(x+b)|\right]+C. \] Therefore \[ \boxed{I=\frac{1}{\sin(a-b)}\ln\left|\frac{\cos(x+b)}{\cos(x+a)}\right|+C}. \]
If \(\sin(a-b)=0\), then \(a-b=n\pi\) for some integer \(n\). In that case \[ \cos(x+b)=\cos\bigl((x+a)-n\pi\bigr)=(-1)^n\cos(x+a), \] so \[ \cos(x+a)\cos(x+b)=(-1)^n\cos^2(x+a). \] Thus \[ I=(-1)^n\int \sec^2(x+a)\,dx=(-1)^n\tan(x+a)+C. \] This is the exceptional case of the general formula; the usual answer assumes \(a-b\) is not an integer multiple of \(\pi\).