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

See also



Join the GraphicMaths Newsletter

Sign up using this form to receive an email when new content is added:

Popular tags

adder adjacency matrix alu and gate angle answers area argand diagram binary maths cartesian equation chain rule chord circle cofactor combinations complex modulus complex numbers complex polygon complex power complex root cosh cosine cosine rule countable cpu cube decagon demorgans law derivative determinant diagonal directrix dodecagon e eigenvalue eigenvector ellipse equilateral triangle erf function euclid euler eulers formula eulers identity exercises exponent exponential exterior angle first principles flip-flop focus gabriels horn galileo gamma function gaussian distribution gradient graph hendecagon heptagon heron hexagon hilbert horizontal hyperbola hyperbolic function hyperbolic functions infinity integration integration by parts integration by substitution interior angle inverse function inverse hyperbolic function inverse matrix irrational irrational number irregular polygon isomorphic graph isosceles trapezium isosceles triangle kite koch curve l system lhopitals rule limit line integral locus logarithm maclaurin series major axis matrix matrix algebra mean minor axis n choose r nand gate net newton raphson method nonagon nor gate normal normal distribution not gate octagon or gate parabola parallelogram parametric equation pentagon perimeter permutation matrix permutations pi pi function polar coordinates polynomial power probability probability distribution product rule proof pythagoras proof quadrilateral questions quotient rule radians radius rectangle regular polygon rhombus root sech segment set set-reset flip-flop simpsons rule sine sine rule sinh sloping lines solving equations solving triangles square square root squeeze theorem standard curves standard deviation star polygon statistics straight line graphs surface of revolution symmetry tangent tanh transformation transformations translation trapezium triangle turtle graphics uncountable variance vertical volume volume of revolution xnor gate xor gate