The answer is ln|sec(x)| + c, since tan(x) = sin(x)/cos(x). Since sin(x) is the negative of the derivative of cos(x), the primitive of tan(x) is -ln|cos(x)| + c = ln|sec(x)| + c.
Unnecessarily complicated to use u = sin(x) as a substitution, but you can do it as shown by trecex1 below.