Answer
$$\int \frac{\sin ^{2} x-\cos ^{2} x}{\cos x} d x =\ln |\sec x+\tan x| -2\sin x+c$$
Work Step by Step
$$
\int \frac{\sin ^{2} x-\cos ^{2} x}{\cos x} d x
$$
Since
\begin{align*}
\int \frac{\sin ^{2} x-\cos ^{2} x}{\cos x} d x&= \int \frac{1-2\cos ^{2} x}{\cos x} d x\\
&=\int (\sec x -2\cos x)dx\\
&=\ln |\sec x+\tan x| -2\sin x+c
\end{align*}