If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

### Course: Calculus, all content (2017 edition)>Unit 5

Lesson 3: Reverse chain rule

# Integral of tan x

It might not look like it at first, but the reverse chain rule let's us find the integral of tan(x).

## Want to join the conversation?

• This is all nice and logical, but when I look up a definition of the integral of tanx dx, I see that it's the postive natural log of the absolute value of secant x, plus C. How do we get from -ln of the absolute value of cosine to the postive ln of the absolute value of secant?
• That is an application of basic properites of trigonometric functions and logarithms:
first cos x = 1 / sec x
Thus,
− ln | cos x| = − ln |1/sec x|
= − {ln (1) − ln |sec x|}
= − {0 - ln |sec x|}
= ln |sec x|
Thus,
−ln |cos x| = ln |sec x|
• Can we apply the same logic for the integral of Cot(x) dx? If so, wouldn't that imply that the integral of Cot(x) is equal ln |sinx| + c?
• Yes, that is correct. ∫ cot (x) dx = ln (sin (x)) + C
• At , I understand the concept of looking for f'(x)*f(x). I don't understand how f(x) is equal to 1/f(x). I'm missing an important piece of logic here. Can you help me understand it better? Thanks
• I think it is a matter of f(x) in the example being used in more than one way. Let me try to explain the same thing in a way that might be more clear:

All of the standard forms for integrals involve the following:
(some function of u)(derivative of u -- note, of u, not the whole function) You must have the derivative of whatever you are calling u in order to use the form. If you don't have that derivative, then you have to solve the integral some other way.
So, the key to solving these problems is to pick something to call u so that you have a function of u that you know how to integrate multiplied by the derivative of whatever you called u.

The form that Sal was using was:
∫ (1/u) du = ln |u| + C

Thus anytime you have:
[ 1/(some function) ] (derivative of that function) then the integral is
ln | (some function) | + C
Let us use this to find ∫− tan (x) dx
tan x = sin x / cos x, thus:
∫− tan (x) dx = ∫ (− sin x / cos x) dx
Now let us see if we can put this in the form of 1/u du
= 1/(cos x) [− sin x dx ]
Let cos x = u , thus - sin x dx = du
So, yes, this matches the form of ∫ (1/u) du = ln |u| + C
thus, since we declared u = cos x, we know that
∫− tan (x) dx = ln |cos x| + C
• I'm a little confused here...isn't the integral of tan(x)= ln |Sec(x)| ? I'm sorry this might be a dumb question but i missed this lecture.
• Those are the same thing:
ln |sec x| = - log |cos x|
When dealing with integrals involving trig functions, you can get very different-looking forms that are actually equivalent, based on how you do the computations.
• how would u antiderivate log (x+1)
• What follows is one way to proceed, assuming you take `log` to refer to the natural logarithm.

Recall that `∫ log(u) du = ulog(u) - u + C`, where `C` is any real number. Using the substitution `u = x + 1`, `du = dx`, we may write `∫ log(x + 1) dx = ∫ log(u) du = ulog(u) - u + C`. Now we may substitute `u = x + 1` back into the last expression to arrive at the answer:
`∫ log(x + 1) dx = (x + 1)log(x + 1) - x + C,`
where `C` is any real number.

If you take `log` to mean logarithm to the base ten, you would proceed exactly as above, using the relation `log(x) = ln(x) / ln(10)`. The answer would then be
`∫ log(x + 1) dx`
`= (1 / ln[10]) ∫ ln(u) du`
`= (1 / ln[10]) · [uln(u) - u] + C`
`= ulog(u) - u / ln(10) + C`
`= (x + 1)log(x + 1) - x / ln(10) + C'.`
• Is it possible to take the integral of ln(x) using the reverse chain rule? If not, what other method(s) apply?
• Is u-substitution slightly more general than the reverse chain rule, or are they essentially identical? Is u-substitution just a mnemonic for the reverse chain rule? Is there any advantage to using one over the other?
• They are the same thing and when Sal refers to the reverse chain rule it's the same as "doing u-substitution in your head". In general to start you should do u-substitution and formally write out your values for u and du. But when you are comfortable with that and/or you have simpler integration problems you can just do the u-substitution "in your head". It's analogous to knowing that 4 * 25 = 100 and so you don't have to do the long multiplication every time.
• It would be worth stating that cos(x) cannot equal any multiple of (pi +*n)\2 where n is an odd integer, right?
• cos x cannot equal anything greater than 1 nor less than -1, unless you delve into complex cosine. Thus, you would be constrained to
|½ (π+n)| ≤ 1
Whence, `-2-π ≤ n ≤ 2-π`
Which is approximately: `-5.14 ≤ n ≤ -1.14`
If n is required to be an integer, the only valid integers are:
`-5, -4, -3, and -2`
(1 vote)
• if we u substitute as -cos x instead of cos x, we would, in the end result, get -ln|-cos x| + c as the integral of tan x. How is this possible
(1 vote)
• Realize that |-cosx| = |cosx| hence the integral is still -ln|cosx| + c
Consider the graphs of y = -cosx and y = cosx. If you reflect that portion below the x axis in each both graphs are identical; and the graph of y = |cosx|.
• Integral of (tan x dx) ==> integral (sin x/cos x)dx
U=1/cos x;
dU/dx = (sin x) / ( cos x)^2 ;
cos x dU= ((sin x)/(cos x) )dx;
(1/U)*dU = ( (sinx)/(cosx))*dx
so
integral (sin x/cos x)dx = integral (1/U)*dU
===> ln(U)+c
===>ln(1/cos x) +C ? where i'm making mistake
(1 vote)
• I can't tell where you made the mistake (because of your unorthodox method) so I'll solve the integral and you try to see where you made a mistake.
let u = cos(x)
then du/dx is -sin(x) or du = -sin(x)dx
∫ (tan(x))dx = ∫ (sin(x)/cos(x))dx = ∫ (-1/-1)(sin x/cos x)dx = (-1)∫(-1)(sin x/cos x) dx
= -∫(-sin x/cos x)dx = -∫ du/u = -(ln|u|) + C = -ln|cos x| + C