TOPIC

Derivative of logarithmic functions

MY PROGRESS

Pug Score

0%

Best Streak

0 in a row

Study Points

+0

Overview

Practice

Watch

Read

Quiz

Next Steps


Get Started

Get unlimited access to all videos, practice problems, and study tools.

Unlimited practice
Full videos

Back to Menu

Topic Progress

Pug Score

0%

Videos Watched

0/0

Best Practice

No score

Read

Not viewed

Best Quiz

No attempts


Best Streak

0 in a row

Study Points

+0

Read

Derivative of Logarithmic Functions

A focused guide to differentiating logarithmic functions: the basic rule for ln x, the general log base a rule, the chain rule for ln of a function, and logarithmic differentiation for tricky products and powers.

What Is the Derivative of a Logarithmic Function?

Logarithmic functions show up everywhere in calculus, from population growth models to sound intensity formulas, so knowing how to differentiate them is essential. The good news is that there are only a couple of core rules to learn, and once you combine them with the chain rule, you can handle almost any log expression you meet.

The Derivative of Natural Log, ln x

The most important rule to memorize is the derivative of the natural logarithm:

\( \dfrac{d}{dx}\left[\ln x\right] = \dfrac{1}{x}, \qquad x > 0 \)

This rule comes directly from the fact that \( \ln x \) is the inverse of \( e^x \). If you have already looked at the derivative of exponential functions, you can see the two are closely linked: differentiating an inverse function essentially "undoes" the exponential relationship, leaving the simple expression \( \frac{1}{x} \).

Graph of y equals natural log of x, showing the curve increasing and flattening as x grows Plot of y = log(x) for x in [0.1, 6] 1 2 3 4 5 6 -2 -1 0 1 2 x y x = 1 x = e
The graph of \( y = \ln x \). Its slope at any point equals \( \frac{1}{x} \), so the curve gets flatter as x increases.

The Derivative of Log Base a

For a logarithm with a different base, use:

\( \dfrac{d}{dx}\left[\log_a x\right] = \dfrac{1}{x\ln a} \)

Notice that when \( a = e \), \( \ln a = \ln e = 1 \), and the formula reduces to the natural log rule above. This is why \( \ln x \) is the preferred base in calculus, all the other log derivatives are just a constant multiple of it.

Using the Chain Rule with Logarithms

Most real problems do not ask for the derivative of \( \ln x \) by itself, they ask for the derivative of \( \ln \) of some function \( u(x) \). The chain rule extends the basic rule to:

\( \dfrac{d}{dx}\left[\ln u\right] = \dfrac{u'}{u} \)

and similarly \( \dfrac{d}{dx}\left[\log_a u\right] = \dfrac{u'}{u \ln a} \). If you want a refresher on why this "outside times inside" pattern always works, see the chain rule lesson.

Example 1: Derivative of ln(2x)

Let \( u = 2x \), so \( u' = 2 \). Then:

\( \dfrac{d}{dx}\left[\ln(2x)\right] = \dfrac{2}{2x} = \dfrac{1}{x} \)

Notice the constant 2 cancels out completely, this happens for \( \ln(kx) \) with any nonzero constant \( k \), because \( \ln(kx) = \ln k + \ln x \) and the derivative of the constant \( \ln k \) is zero.

Example 2: Derivative of ln(1/x)

Rewrite \( \ln\left(\frac{1}{x}\right) \) using log properties as \( -\ln x \). Differentiating gives:

\( \dfrac{d}{dx}\left[\ln\left(\dfrac{1}{x}\right)\right] = -\dfrac{1}{x} \)

You get the same answer using the chain rule directly with \( u = \frac{1}{x} \), but simplifying with log properties first is usually faster.

Example 3: Derivative of x ln x

This one needs the product rule as well, since it is \( x \) multiplied by \( \ln x \):

\( \dfrac{d}{dx}\left[x \ln x\right] = (1)\ln x + x\left(\dfrac{1}{x}\right) = \ln x + 1 \)

Example 4: Derivative of ln(x squared) versus (ln x) squared

These two expressions look similar but are not the same function, so their derivatives differ:

\( \dfrac{d}{dx}\left[\ln(x^2)\right] = \dfrac{2x}{x^2} = \dfrac{2}{x} \)

\( \dfrac{d}{dx}\left[(\ln x)^2\right] = 2\ln x \cdot \dfrac{1}{x} = \dfrac{2\ln x}{x} \)

The first uses the chain rule on the inside function \( x^2 \), while the second treats \( \ln x \) itself as the inner function of a squaring operation.

Simplify with Log Properties First

Before differentiating a complicated logarithm, it often pays to expand it using log properties:

\( \ln(ab) = \ln a + \ln b, \qquad \ln\left(\dfrac{a}{b}\right) = \ln a - \ln b, \qquad \ln(a^n) = n\ln a \)

For example, an expression like \( \ln\left(\dfrac{1+x}{1-x}\right) \) becomes \( \ln(1+x) - \ln(1-x) \), which differentiates term by term to:

\( \dfrac{1}{1+x} - \dfrac{-1}{1-x} = \dfrac{1}{1+x} + \dfrac{1}{1-x} \)

This is much cleaner than trying to apply the chain rule to the quotient directly.

Logarithmic Differentiation

Some functions are awkward to differentiate directly, especially products or quotients of several factors, or a variable raised to a variable power. Logarithmic differentiation solves this by taking the natural log of both sides first, then differentiating implicitly. The steps are:

  1. Take \( \ln \) of both sides of \( y = f(x) \).
  2. Use log properties to expand the right side into sums and differences.
  3. Differentiate both sides with respect to \( x \) (the left side gives \( \frac{y'}{y} \)).
  4. Multiply both sides by \( y \) and substitute the original \( f(x) \) back in for \( y \).

Example: y = x to the power of x

This function cannot be handled by the power rule or the exponential rule alone, since both the base and the exponent contain \( x \).

\( y = x^x \)

\( \ln y = x \ln x \)

Differentiating both sides:

\( \dfrac{y'}{y} = \ln x + 1 \)

\( y' = y(\ln x + 1) = x^x(\ln x + 1) \)

This technique is also handy any time you need the slope of a log-based curve at a specific point, which connects directly to the idea of the slope and equation of a tangent line.

Quick Reference Table

Function Derivative ln x 1 / x log_a x 1 / (x · ln a) ln u(x) u′ / u

Related lessons