$\frac{1}{\cos (x+a) \cos (x+b)}$
$\frac{1}{\cos (x+a) \cos (x+b)}$
Multiplying and dividing by $\sin (a-b)$, we obtain
$\frac{1}{\sin (a-b)}\left[\frac{\sin (a-b)}{\cos (x+a) \cos (x+b)}\right]$
$=\frac{1}{\sin (a-b)}\left[\frac{\sin [(x+a)-(x+b)]}{\cos (x+a) \cos (x+b)}\right]$
$=\frac{1}{\sin (a-b)}\left[\frac{\sin (x+a) \cdot \cos (x+b)-\cos (x+a) \sin (x+b)}{\cos (x+a) \cos (x+b)}\right]$
$=\frac{1}{\sin (a-b)}\left[\frac{\sin (x+a)}{\cos (x+a)}-\frac{\sin (x+b)}{\cos (x+b)}\right]$
$=\frac{1}{\sin (a-b)}[\tan (x+a)-\tan (x+b)]$
$\int \frac{1}{\cos (x+a) \cos (x+b)} d x=\frac{1}{\sin (a-b)} \int[\tan (x+a)-\tan (x+b)] d x$
$=\frac{1}{\sin (a-b)}[-\log |\cos (x+a)|+\log |\cos (x+b)|]+\mathrm{C}$
$=\frac{1}{\sin (a-b)} \log \left|\frac{\cos (x+b)}{\cos (x+a)}\right|+\mathrm{C}$