Calculus

Derivatives of Exponential and Logarithmic Functions

See why eˣ is its own derivative, why ln x gives 1/x, and how to handle other bases and the chain rule with confidence.

Key takeaways

  • An exponential function grows at a rate proportional to its current value, and base e makes the constant of proportionality equal to 1.
  • The derivative of ln x is 1/x, which follows from differentiating the equation e^y = x.
  • Other bases add a factor of ln a: multiply by it for exponentials and divide by it for logarithms.
  • With a function in the exponent or inside the logarithm, the chain rule supplies one more factor.
  • The power rule does not apply when the variable is in the exponent.

The exponential function eˣ is its own derivative, and the natural logarithm ln x has derivative 1/x for x > 0. Every other exponential and logarithm follows from those two facts: the derivative of aˣ is aˣ ln a, and the derivative of the base a logarithm of x is 1/(x ln a).

Here a is a positive constant (and not 1 in the logarithm case), ln means the logarithm to base e, and e is a constant approximately equal to 2.71828.

Why an exponential reproduces itself

Take f(x) = aˣ and form the difference quotient, the average rate of change over a small step h.

(a^(x+h) − aˣ)/h = (aˣ · a^h − aˣ)/h      law of exponents
                 = aˣ · (a^h − 1)/h        factor out aˣ

Something remarkable happened. The x dependence came out front, and what remains involves only a and h. As h approaches zero, (a^h − 1)/h approaches a number that depends only on the base. That number is the slope of the graph at x = 0.

So every exponential function has a derivative equal to a constant times itself. You can estimate the constant with a calculator using h = 0.001:

Base a (a^0.001 − 1)/0.001 Limit as h → 0
2 about 0.6934 ln 2 ≈ 0.6931
e about 1.0005 exactly 1
3 about 1.0992 ln 3 ≈ 1.0986

The constant is below 1 for base 2 and above 1 for base 3. Somewhere between them is the base for which it equals exactly 1. That base is e, and this property is one standard way to define it.

The derivative of the natural logarithm

The natural logarithm undoes the exponential: y = ln x means e^y = x, with x > 0. Differentiate both sides of that equation with respect to x, treating y as a function of x.

e^y = x
e^y · y′ = 1        chain rule on the left
y′ = 1/e^y = 1/x    because e^y = x

This is implicit differentiation at work. It also has a clear picture. The graph of ln x is the reflection of the graph of eˣ across the line y = x, and reflecting a line swaps rise and run, so slopes turn into their reciprocals.

The formula says the logarithm always increases, since 1/x is positive, but ever more slowly. At x = 1 the slope is 1. At x = 100 it is 0.01. The curve never levels off completely and has no upper bound, yet it climbs with extraordinary reluctance, a theme explored in logarithmic scales.

Power function or exponential function?
Power: x⁵ Variable is the base Exponent is constant Derivative: 5x⁴ Use the power rule Exponential: 5ˣ Variable is the exponent Base is constant Derivative: 5ˣ · ln 5 Power rule does not apply Both vary: xˣ Variable in both places Needs x > 0 Derivative: xˣ(ln x + 1) Take logarithms first Power: x⁵ Variable is the base Exponent is constant Derivative: 5x⁴ Use the power rule Exponential: 5ˣ Variable is the exponent Base is constant Derivative: 5ˣ · ln 5 Power rule does not apply Both vary: xˣ Variable in both places Needs x > 0 Derivative: xˣ(ln x + 1) Take logarithms first

Other bases

You never need a separate theory for base 2 or base 10, because any positive a can be written as e^(ln a). Therefore aˣ = e^(x ln a), and the chain rule gives:

d/dx aˣ = e^(x ln a) · ln a = aˣ ln a

For logarithms, use the change of base formula, which says that log base a of x equals ln x divided by ln a. Since 1/ln a is a constant:

d/dx log_a x = 1/(x ln a)      for x > 0, a > 0, a ≠ 1

So the derivative of 2ˣ is about 0.693 · 2ˣ, and the derivative of the base 10 logarithm of x is about 0.434/x. The extra constants are the reason mathematicians prefer base e in calculus. It is the choice that leaves no clutter behind.

When 0 < a < 1, ln a is negative, so aˣ decreases, which agrees with its graph.

Adding the chain rule

Most exponentials and logarithms you meet have something more complicated than x inside. If u is a differentiable function of x:

d/dx e^u  = e^u · u′
d/dx ln u = u′/u          where u > 0
d/dx a^u  = a^u · ln a · u′

Four examples show the pattern:

  • The derivative of e^(3x) is 3e^(3x).
  • The derivative of ln(x² + 1) is 2x/(x² + 1), valid for all x because x² + 1 is always positive.
  • The derivative of 5^(x²) is 5^(x²) · ln 5 · 2x.
  • The derivative of the base 2 logarithm of 3x + 1 is 3/((3x + 1) ln 2), for x > −1/3.

If any of these steps feels unclear, review how the chain rule works and identify the inside function before you differentiate.

Simplify with log laws first

Logarithm laws turn products into sums and powers into multipliers. Using them before differentiating can save a page of work. For x > 0, take f(x) = ln(x² √(x + 1)).

f(x)  = 2 ln x + (1/2) ln(x + 1)
f′(x) = 2/x + 1/(2(x + 1))

Differentiating the original form directly would require the chain rule, the product rule and another chain rule, then a good deal of simplifying.

A related curiosity: ln(7x) and ln x have the same derivative, 1/x, because ln(7x) = ln 7 + ln x and ln 7 is a constant. Multiplying the input shifts a logarithm graph up or down without changing its slope.

You will also meet ln |x|, defined for every x except 0. Its derivative is 1/x on both sides. For negative x, the chain rule gives (1/(−x)) · (−1) = 1/x. This is why the antiderivative of 1/x is written ln |x| plus a constant on each interval.

Growth and decay

The self-reproducing property explains why exponentials appear whenever a rate of change is proportional to the amount present. The equation y′ = ky, with k constant, has solutions y = Ce^(kt), where C is the value at t = 0. These are the only solutions.

Say a hypothetical population follows P(t) = 200e^(0.03t), with t in years. Then P′(t) = 6e^(0.03t). At the start it is growing at 6 individuals per year, and at every moment its growth rate is 3 percent of its size. Note that this is an instantaneous rate: after one full year the population has grown by a factor of e^0.03, slightly more than 3 percent.

A negative k describes decay, such as radioactive material dwindling. Real populations eventually run short of resources, so a pure exponential is only a model for a limited period, as discussed in linear, exponential and logistic growth.

Two combinations worth knowing

Products involving these functions often simplify nicely. For g(x) = x e^(−x), the product rule gives:

g′(x) = e^(−x) − x e^(−x) = (1 − x) e^(−x)

Since e^(−x) is never zero, the only place the slope vanishes is x = 1. The slope changes from positive to negative there, so g has its largest value at x = 1, namely 1/e ≈ 0.368.

For h(x) = x ln x − x, with x > 0:

h′(x) = ln x + x · (1/x) − 1 = ln x

Read backward, this tells you that an antiderivative of ln x is x ln x − x, a result usually derived by integration by parts.

Tangent lines and quick estimates

Because the slopes are so simple at special points, these functions give some of the handiest approximations in mathematics. At x = 0, the graph of eˣ has height 1 and slope 1, so its tangent line is y = 1 + x. At x = 1, the graph of ln x has height 0 and slope 1, so its tangent line is y = x − 1.

In other words, for small t:

e^t ≈ 1 + t
ln(1 + t) ≈ t

For t = 0.02, the true values are about 1.020201 and 0.019803, both within about 0.0002 of the estimates. The errors grow roughly with the square of t, so the approximations fade quickly as t gets large.

The tangent lines also give inequalities that hold everywhere they make sense. The graph of eˣ bends upward and so lies on or above its tangent: eˣ ≥ 1 + x for every real x. The graph of ln x bends downward and lies on or below its tangent: ln x ≤ x − 1 for every x > 0.

A famous comparison settled by a derivative

Which is bigger, e^π or π^e? You can decide without computing either one. Consider q(x) = ln x / x for x > 0. By the quotient rule:

q′(x) = ((1/x) · x − ln x · 1)/x² = (1 − ln x)/x²

The derivative is positive when x < e and negative when x > e, so q reaches its largest value at x = e. In particular, q(e) > q(π), which says 1/e > ln π / π. Multiply both sides by the positive number πe to get π > e ln π. Applying the exponential function to both sides gives e^π > π^e. A calculator agrees: the values are roughly 23.14 and 22.46.

Mistakes to avoid

  • Writing the derivative of 2ˣ as x · 2^(x−1). That applies the power rule to an exponential.
  • Treating e⁵ as a function. It is a constant, so its derivative is 0, and so is the derivative of ln 5.
  • Claiming ln(a + b) equals ln a + ln b. The law applies to products, not sums.
  • Dropping the inner derivative, as in writing the derivative of e^(x²) as e^(x²).
  • Forgetting that ln u requires u > 0.

To check an answer, estimate the slope numerically at one point using a very small step and compare. For ln x at x = 2, the change from 2 to 2.001 divided by 0.001 comes out very near 0.5, just as 1/x predicts.

Written for 4Mathematics with AI writing tools and not reviewed line by line by a person. Check anything you rely on against a textbook or primary source. Report an error.

Keep reading

All 39 articles in Calculus →

Latest news on this topic