Answer
\[I=-\ln |\cos x|+C\]
Where $C$ is constant of integration
Work Step by Step
Let \[I=\int \tan x\:dx\;\;\;\;\]
\[I=\int\left(\frac{\sin x}{\cos x}\right)dx\;\;\;\;...(1)\]
Make a substitution $\;\;t=\cos x\;\;\;...(2)$
\[\Rightarrow dt=-\sin x\;dx\]
(1) becomes
\[I=-\int\frac{1}{t}dt\]
\[I=-\ln |t|+C\]
Where $C$ is constant of integration
From (2)
\[I=-\ln |\cos x|+C\]
Hence \[I=-\ln |\cos x|+C\;.\]