You can write the fraction such that:

(1+(tanx)^2)/tan x = 1/ tan x + tan x = cot x + tan x

Evaluating the integral yields:

int(1+(tanx)^2)dx/tan x = int cot x dx + int tan x dx

int cot x dx = int cos x dx/sin x

You should come up with the substitution: sin x = y=> cos x dx = dy

int cos x dx/sin x = int dy/y = ln |sin x| + c

int tan x dx = -ln|cos x| + c

**int(1+(tanx)^2)dx/tan x = ln |sin x| - ln|cos x| + c = ln |tan x| + c**

First of all, we'll notice that 1+(tgx)^2 = 1/(cos x)^2, from the fundamental formula of trigonometry:

(sin x)^2 + (cos x)^2 = 1

(sin x)^2/(cos x)^2 + 1 = 1/(cos x)^2

(tg x)^2 + 1 = 1/(cos x)^2

Int [(1+(tgx)^2)/tg x]dx=Int dx/(tg x)(cos x)^2

Now, we can choose the method of substitution.

tg x = t, so, differentiating, we'll have:

dx/(cos x)^2 = dt

Int (1/t)dt = ln t + C = ln (tg x) + C