Biến đổi f(x) về dạng:
$f(x)=\frac{\sin x\sin(x+\frac{\pi}{4})}{\cos x\cos(x+\frac{\pi}{4})}=\frac{\cos x\cos(x+\frac{\pi}{4})+\sin x\sin (x+\frac{\pi}{4})}{\cos x\cos(x+\frac{\pi}{4})} -1$
$=\frac{\cos(x+\frac{\pi}{4})}{\cos x\cos(x+\frac{\pi}{4})}-1=\frac{\sqrt{2} }{2}.\frac{1}{\cos x.\cos (x+\frac{\pi}{4})}-1 $
Khi đó:
$f(x)=\frac{\sqrt{2} }{2}\int\limits \frac{dx}{\cos x\cos(x+\frac{\pi}{4})}-\int\limits dx =-x+\frac{\sqrt{2} }{2} \int\limits \frac{dx}{\cos x\cos(x+\frac{\pi}{4})} $
Ta có:
$J=\int\limits \frac{dx}{\cos x\cos(x+\frac{\pi}{4})}=\sqrt{2}\int\limits \frac{dx}{\cos x(\sin x-\sin x)}=\sqrt{2}\int\limits \frac{dx}{\cos^2x(1-\tan x)} $
$=\sqrt{2}\int\limits \frac{d(\tan x)}{1-\tan x} =-\sqrt{2}\int\limits \frac{d(1-\tan x)}{1-\tan x} =-\sqrt{2}\ln|1-\tan x| +C $
Vậy ta được:
$$\int\limits f(x)dx=-x-\ln|1-\tan x|+C$$