The easiest way is to just use the definition of tanx as the ratio of sine to cosine. U-sub cosine and then that gives du=-sinxdx. Then you get -ln|cosx| or ln|secx|+C.
The third method is multiply sec(x)/sec(x). The integral should be sec(x)tan(x)/sec(x)dx. If you let u=sec(x) and du=sec(x)tan(x)dx, the integral is du/u. The answer to this integral is ln(|u|)+C=ln(|sec(x)|)+C. If you want in terms of cos(x), then the answer is -ln(|cos(x)|)+C.
Come the f on bro, they are fucking completely same as the formula he just used: Integral of {f'(x)/f(x)}dx = ln|f(x)|+C is derived by the same denominator u substitution so either you do it this way or the long way, it's same. Second, What I suggest is try solving integral of tanx by writing it as 1 × tanx × dx and then applying by parts formula: integral (uv) = u × integral (v) - integral (u' integral v) It might work I GUESS...