Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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 got stuck 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 the whole computation?

share|cite|improve this question
up vote 3 down vote accepted

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$$

share|cite|improve this answer
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\;.$$

share|cite|improve this answer

$$\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$

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.