# What's the process that lead me from integral of tg(x) to -ln(cos(x))?

I'm trying to compute $\int \tan(x) dx$. I tried to decompose it to $\int\sin(x)\cdot\cos(x)^{-1} dx$ and use per partes method. Then I stucked at $-\ln(\cos(x))+\int\frac{\cos(x)\cdot\ln(\cos(x))}{\sin(x)} dx$ but that seems to go nowhere, or I just don't know how to continue.

Could anybody do whole computation?

-

Integration by parts will only complicate things. I suggest using substitution: $u=\cos x$. Then $du=-\sin xdx$ and so you have $$\int \tan x\, dx=-\int\frac{du}u$$

-
You are right, that's so simple. Thanks :) –  user50222 Dec 30 '12 at 12:53

Just substitute $u=\cos x$; then $du=-\sin x~dx$, and the integral becomes $$\int\tan x~dx=-\int\frac{du}u\;.$$

-
$$\int \tan xdx=\int\frac{\sec x\tan xdx}{\sec x}$$
Putting $\sec x=z, dz=\sec x\tan x dx$
$\int\frac{\sec x\tan xdx}{\sec x}=\int\frac{dz}z=\log |z|+C=\log|\sec x|+C=-\log|\cos x|+C$