=\ln|\cos x|-\frac{\sin^2 x}{2}+\left(\frac{1}{2}+c\right)=\ln|\cos x|-\frac{\sin^2 x}{2}+c