First, recall that tan(x) can be rewritten in terms of sine and cosine.
tan(x) = sin(x)/cos(x)
The rephrasing of our question suggests that we should try the substitution rule of integration.
We should substitute u=cos(x), since then du = -sin(x) dx and so sin(x) dx = -du
So the integral of tan(x) = the integral of sin(x)/cos(x) = the integral of -1/u = - ln|u| +C = - ln|cosx| +C
Now, - ln|cos(x)| = ln(|cos(x)|-1) = ln(1/|cos(x)|) = ln|sec(x)|
Therefore, the integral of tan(x) is ln|sec(x)| + C