integrate (tan (x))

-log(-cos(x)**2)/2

integrate(tan(x), x)

plot(-log(sin(x)**2 - 1)/2)

solve(-log(sin(x)**2 - 1)/2, x)

diff(-log(sin(x)**2 - 1)/2, x)

series(-log(sin(x)**2 - 1)/2, x, 0, 10)

Experiment with SymPy at SymPy Live.