Derivative of ln x

By Martin McBride, 2025-10-17
Tags: first principles derivative ln inverse function
Categories: differentiation calculus
Level:


In this article, we will find the derivative of the natural logarithm function, ln(x). The natural logarithm, of course, is the logarithm using base e, where e is Euler's number. Here is a graph of the function:

Natural logarithm

The ln function is defined for all x > 0, and is differentiable over that entire range. The graph shows the slope of the curve at point A.

We will see how to find the derivative from first principles. It is also possible to use the inverse function rule to find the derivative, because ln is the inverse of the exponential function. This article on the inverse function rule uses the ln function as a worked example.

We will also extend this to cover logarithms using any base.

Derivative of ln x from first principles

We can find the derivative of some function f(x) using the general first principles formula:

First principles

If you want to learn more about this technique, see the linked article. The first step is to substitute the general formula f(x) with pur specific formula ln(x)

First principles

Here we are subtracting two logarithms, which, of course, is equivalent to the logarithm of the quotient of the two terms:

First principles

So:

First principles

Putting this back into the main equation gives us:

First principles

In the second line, we have simply rearranged the term in the brackets.

There are a couple of important things we can observe about x. First, we are calculating f'(x) for some particular value of x. This means that when we calculate the limit, x is effectively a constant. For example, if we wanted to find f'(2), we would calculate the limit taking x as the fixed value 2.

The second thing to remember is that, because we are dealing with the ln function, we know that x will always be positive. In particular, it cannot be zero.

So we can make the following variable substitution, where u is simply h divided by the positive constant x:

First principles

Let's make the substitution. Notice that because u is just h divided by a positive constant, it follows that as h tends to zero, then u tends to zero:

First principles

Finally, because x is a constant as far as the limit is concerned, we can take it outside the limit:

First principles

Now the limit itself only depends on u, so the limit will be a constant. But what is that constant? Well, we can use another logarithm law:

First principles

Applying this to the term inside the limit gives us:

First principles

Now the term inside the limit is the natural log of an expression that depends only on u. So the limit will be the log of whatever that expression tends to as u tends to zero. This means that we can move the limit to inside the log function:

First principles

Now you might recognise this famous limit (if not, it is covered here). The limit evaluates to Euler's number, e:

First principles

So we can find the natural log of this limit. Since e is the base of natural logarithms, the log of e is simply 1:

First principles

So, the entire limit expression evaluates to 1. Putting this back into equation (1) gives the final result:

First principles

This agrees with the result obtained using the inverse function rule, shown here.

Differentiating logarithms using different bases

We can easily differentiate logarithms using other bases (for example, 10 and 2 are commonly used).

In general, any logarithm using base a can be expressed in terms of natural logarithms (ie base e) using a simple scaling factor based on the natural log of a:

Log base a

Differentiating this gives:

Log base a

Related articles

Join the GraphicMaths Newsletter

Want article discussions, announcements, and discounts on GraphicMaths books and products? Join the newsletter: