2. Use $\left(\frac{f}{g}\right)'=\frac{f'g-fg'}{g^2}$
and $(\tan x)'=\frac{1}{\cos^2x}, \ (\cos x)'=-\sin x$