Derivative of the natural log

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:

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

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…

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?

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…

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.

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.

No, constants vanish upon derivation.

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

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…

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.

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.

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.

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 :slight_smile: