# Derivative of the natural log

**URL:** <https://boards.straightdope.com/t/derivative-of-the-natural-log/614245>\
**Category:** Factual Questions\
**Created:** [February 28, 2012, 10:57am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245 "2012-02-28T10:57:37Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mijin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mijin/32/9369_2.png) [@Mijin](https://boards.straightdope.com/u/Mijin)\
**Post date:** [February 28, 2012, 10:57am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/1 "2012-02-28T10:57:37Z")

</div>

So, trying to learn calculus (just because it’s a gap in my knowledge; this isn’t a homework question).

It’s all been good up to the point where my book just throws out that the derivative of ln(x) = 1 / x.  
I figure I’ll never remember it if I don’t understand it, so I look for some derivations on the web.

And I see the same explanation about 20 times, which I can’t parse:

> [@](#):
>
> chain rule:  
> exp(y) dy/dx = 1
> 
> so  
> x dy/dx = 1  
> dy/dx = 1/x

I understand the second bit but not the first.  
What two derivatives are being chained, and why is the result 1?

---

<div class="post-metadata">

**Author:** ![Nava](https://avatars.discourse-cdn.com/v4/letter/n/da6949/32.png) [@Nava](https://boards.straightdope.com/u/Nava)\
**Post date:** [February 28, 2012, 11:08am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/2 "2012-02-28T11:08:22Z")

</div>

The first derivative is 1 because we’re deriving exp(y) with respect to x: since exp(y) is not a function of x, it’s a constant with respect to x, therefore its derivative with respect to x is 1.

I can’t remember the rest right now…

---

<div class="post-metadata">

**Author:** ![Cabbage](https://avatars.discourse-cdn.com/v4/letter/c/f07891/32.png) [@Cabbage](https://boards.straightdope.com/u/Cabbage)\
**Post date:** [February 28, 2012, 11:17am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/3 "2012-02-28T11:17:44Z")

</div>

You start with y=ln x. You want the derivative of y with respect to x, but we’re starting from scratch and don’t know what it is.

Any logarithm can be rewritten as an exponential, so write:

e^y = x

Now take the derivative with respect to x (the left hand side requires the chain rule):

exp(y) dy/dx = 1

so  
x dy/dx = 1  
dy/dx = 1/x

Does that help?

---

<div class="post-metadata">

**Author:** ![Half\_Man\_Half\_Wit](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/half_man_half_wit/32/21766_2.png) [@Half\_Man\_Half\_Wit](https://boards.straightdope.com/u/Half_Man_Half_Wit)\
**Post date:** [February 28, 2012, 11:21am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/4 "2012-02-28T11:21:19Z")

</div>

If you know that d/dx (exp(f(x)) = f’(x)\*exp(f(x)), where f(x) is some arbitrary function, it’s immediate from there: d/dx (exp(ln(x)) = d/dx(ln(x))\*exp(ln(x)) = d/dx(ln(x)) \* x, but d/dx (exp(ln(x)) = 1 --\> 1 = d/dx(ln(x)) \* x --\> d/dx(ln(x)) = 1/x. Which is the same thing as has been said above, just phrased a little differently…

---

<div class="post-metadata">

**Author:** ![Jragon](https://avatars.discourse-cdn.com/v4/letter/j/e19b73/32.png) [@Jragon](https://boards.straightdope.com/u/Jragon)\
**Post date:** [February 28, 2012, 11:23am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/5 "2012-02-28T11:23:10Z")

</div>

Here’s how I remember it, if

y(x) = ln(x), then we can define  
f(x) = exp(y(x))

Of course, exp(y(x)) = exp(ln(x)) = x

So take the derivative of f, by the chain rule we get

f’(x) = y’(x) \* exp(y(x))

But ALSO

f(x) = x =\> f’(x) = 1

So, y’(x) \* exp(y(x)) = 1 =\> y’(x) = 1/(exp(y(x))

But wait, what’s y(x)?

y’(x) = 1/(exp(ln(x))) = 1/x

By properties of logs and exponents.

---

<div class="post-metadata">

**Author:** ![Mijin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mijin/32/9369_2.png) [@Mijin](https://boards.straightdope.com/u/Mijin)\
**Post date:** [February 28, 2012, 11:28am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/6 "2012-02-28T11:28:13Z")

</div>

> [@Nava](#):
>
> The first derivative is 1 because we’re deriving exp(y) with respect to x: since exp(y) is not a function of x, it’s a constant with respect to x, therefore its derivative with respect to x is 1.

Ah, this could be the critical thing I’m missing.

So it’s meaningful to get a derivative with respect to something that’s not in the function?

So I could validly write:

d / dx of a^3 + b^2 + c is 1

?

---

<div class="post-metadata">

**Author:** ![VunderBob](https://avatars.discourse-cdn.com/v4/letter/v/839c29/32.png) [@VunderBob](https://boards.straightdope.com/u/VunderBob)\
**Post date:** [February 28, 2012, 11:36am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/7 "2012-02-28T11:36:02Z")

</div>

> [@Mijin](#):
>
> Ah, this could be the critical thing I’m missing.
> 
> So it’s meaningful to get a derivative with respect to something that’s not in the function?
> 
> So I could validly write:
> 
> d / dx of a^3 + b^2 + c is 1
> 
> ?

No. The derivative of that is 0, because all the terms are constant with respect to x.

---

<div class="post-metadata">

**Author:** ![Half\_Man\_Half\_Wit](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/half_man_half_wit/32/21766_2.png) [@Half\_Man\_Half\_Wit](https://boards.straightdope.com/u/Half_Man_Half_Wit)\
**Post date:** [February 28, 2012, 11:37am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/8 "2012-02-28T11:37:28Z")

</div>

No, constants vanish upon derivation.

EDIT: Yeah, well, see above (again).

---

<div class="post-metadata">

**Author:** ![Mijin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mijin/32/9369_2.png) [@Mijin](https://boards.straightdope.com/u/Mijin)\
**Post date:** [February 28, 2012, 11:41am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/9 "2012-02-28T11:41:04Z")

</div>

ok, I get why the RHS of “exp(y) = x” is one now:

Because to find the derivative of “x”, with respect to x, we could implicitly use the equation:

derivative = knx^(n-1)  
= 1 \* 1 \* x^0  
= 1

Alternatively, we could just say the gradient of the function y = x is 1.

Seriously this is the level at which it takes for me to grok this stuff…

---

<div class="post-metadata">

**Author:** ![Mijin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mijin/32/9369_2.png) [@Mijin](https://boards.straightdope.com/u/Mijin)\
**Post date:** [February 28, 2012, 11:45am UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/10 "2012-02-28T11:45:01Z")

</div>

> [@VunderBob](#):
>
> No. The derivative of that is 0, because all the terms are constant with respect to x.

> [@Half Man Half Wit](#):
>
> No, constants vanish upon derivation.

So the explanation given in post #2 was incorrect?  
I’m not trying to diss anyone, I just have to get it clear in my mind.

---

<div class="post-metadata">

**Author:** ![Nancarrow](https://avatars.discourse-cdn.com/v4/letter/n/c37758/32.png) [@Nancarrow](https://boards.straightdope.com/u/Nancarrow)\
**Post date:** [February 28, 2012, 12:01pm UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/11 "2012-02-28T12:01:54Z")

</div>

> [@Mijin](#):
>
> Ah, this could be the critical thing I’m missing.
> 
> So it’s meaningful to get a derivative with respect to something that’s not in the function?
> 
> So I could validly write:
> 
> d / dx of a^3 + b^2 + c is 1
> 
> ?

While everyone’s done a good job of pointing out that your derivative above should equal zero, not one (and so, yes, the explanation in post #2 is indeed incorrect), we need to address your bigger question - is it meaningful to derive an expression with respect to a variable that isn’t in it?

And the answer to that is, yes it certainly is. However, to complicate things, the answer won’t always be zero. Rather than just looking at a bunch of different letters, you have to ask which variables may (or may not) depend on which other variables.

In the example you gave, you have assumed a, b and c are constants - or at least, they _are not themselves functions of x_, which is the key point. So the derivative is indeed zero.  
Now in the equation e^y = x, we want to differentiate both sides with respect to x. The RHS differentiates to 1 (for the reason you gave earlier). The LHS does NOT differentiate to zero here (if it did, we’d have 0=1 which just makes the baby Euler cry). The reason being, y depends on x. So you have to use the chain rule on the LHS. Suppose you have three variables x, y, z, where z=f(y) and y=g(x) (ie z depends on y, and y depends on x). Then the chain rule basically says you can differentiate z with respect to x: dz/dx = dz/dy \* dy/dx

So to d/dx the LHS, you first d/dy it (which gives you e^y, the exponential function differentiates to itself). Then you multiply that by the derivative of y w.r.t. x. You don’t know explicitly what that is yet (in fact the whole point of this symbol juggling is to find that out), so you just write dy/dx. So

e^y \* dy/dx = 1

Which gives dy/dx=1/x, I presume you followed the remaining bit.

---

<div class="post-metadata">

**Author:** ![Half\_Man\_Half\_Wit](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/half_man_half_wit/32/21766_2.png) [@Half\_Man\_Half\_Wit](https://boards.straightdope.com/u/Half_Man_Half_Wit)\
**Post date:** [February 28, 2012, 12:04pm UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/12 "2012-02-28T12:04:29Z")

</div>

> [@Mijin](#):
>
> So the explanation given in post #2 was incorrect?

Yes. d/dx (c), if c is a constant independent of x, is 0.

What you need is really just the chain rule, which says that the derivative of a function of a function, is the derivative of the (outer) function (of the function) times the derivative of the inner function, i.e. d/dx (f(g(x))) = g’(x)\*f’(g(x)), in the example with f(x) = exp(x) and g(x) = ln(x), this is d/dx (exp(ln(x))) = d/dx(ln(x)\*exp’(ln(x)), but exp’(x) = exp(x), and so d/dx (exp(ln(x))) = d/dx(ln(x)\*exp(ln(x)). But exp(ln(x)) is just equal to x, so ultimately d/dx (exp(ln(x))) = d/dx(ln(x)\*x. On the other hand, for the same reason, d/dx (exp(ln(x))) = d/dx (x) = 1, so, equating those last two results, d/dx(ln(x)\*x = 1, or d/dx(ln(x) = 1/x.

---

<div class="post-metadata">

**Author:** ![Mijin](https://sea3.discourse-cdn.com/straightdope/user_avatar/boards.straightdope.com/mijin/32/9369_2.png) [@Mijin](https://boards.straightdope.com/u/Mijin)\
**Post date:** [February 28, 2012, 12:19pm UTC](https://boards.straightdope.com/t/derivative-of-the-natural-log/614245/13 "2012-02-28T12:19:59Z")

</div>

Excellent **Nancarrow** , I just heard the click I think.  
It’s that explanation that these web resources are missing: that we want d/dx so on the LHS we have to do d/dy \* dy/dx.  
Just saying “chain rule” it wasn’t obvious to me.

You picked up very well the thing I wasn’t getting.

I’m now going to re-read the other responses now that it should all make sense to me 🙂
