∫1cos(x−a)cos(x−b)dx
=1sin(a−b)∫sin(a−b)cos(x−a).cos(x−b) [∵ multiply & divide by sin(a−b)]
=1sin(a−b)∫sin(a−b+x−x)cos(x−a).cos(x−b)dx
=1sin(a−b)∫sin(x−b)+(a−x)cos(x−a).cos(x−b)dx
=1sin(a−b)∫sin(x−b)−(x−a)cos(x−a).cos(x−b)dx
=1sin(a−b)∫sin(x−b).(x−a)−cos(x−b).sin(x−a)cos(x−a).cos(x−b)dx
=1sin(a−b)∫[sin(x−b)cos(x−b)−sin(x−a)cos(x−a)dx]
=1sin(a−b)∫(tan(x−b)−tan(x−a))dx
=1sin(a−b)[−log|cos(x−b)−(−log|cos(x−a)|)]+c
=1sin(a−b)[−log|cos(x−b)+log|cos(x−a)|]+c
=1sin(a−b)[log|cos(x−a)cos(x−b)|]+c