Instant PDF download, name-and-email checkout. Complete Book Bundle: every Economics, Statistics, Mathematics, Econometrics and Research Methods book
Mathematics

Differentiating Exponentials and Logarithms: eˣ, ln x and aˣ with Examples

Differentiating exponentials and logarithms: derivatives of e^x, a^x, ln x and log x with the chain rule, plus growth rates, elasticity and worked examples.

In 30 seconds
  • The derivative of \( e^x \) is \( e^x \), and the derivative of \( \ln x \) is \( \frac{1}{x} \). Almost everything else follows from these two facts and the chain rule.
  • With the chain rule: \( \frac{d}{dx}e^{f(x)} = f'(x)e^{f(x)} \) and \( \frac{d}{dx}\ln f(x) = \frac{f'(x)}{f(x)} \).
  • Other bases bring in a natural log: \( \frac{d}{dx}a^x = a^x \ln a \) and \( \frac{d}{dx}\log_a x = \frac{1}{x \ln a} \).
  • In economics, \( \frac{d}{dt}\ln Y \) is the growth rate, and \( \frac{d \ln y}{d \ln x} \) is an elasticity.
  • Exam point: use log laws to simplify before you differentiate a logarithm. It saves time and errors.

The case: how fast is the economy growing?

An economy’s output, in billions of dollars, is modelled by \( Y(t) = 1500e^{0.03t} \), where \( t \) is years from now. (The figures are illustrative.) A finance ministry wants three answers. How fast is output rising today, in dollars per year? How fast will it be rising in ten years? And what is the growth rate, in per cent per year?

Today output is $1,500 billion. In ten years it will be \( 1500e^{0.3} \approx 2{,}024.79 \) billion. The rate of change in dollars per year keeps rising as the economy gets bigger. But the growth rate stays fixed at 3% a year. To see why, and to get the numbers, you need the derivative of the exponential function. Then, to turn “dollars per year” into “per cent per year”, you need the derivative of the natural logarithm.

This post covers both, with the chain rule, other bases, and three applications that exams and economics courses love: continuous growth, elasticity and optimisation.

The derivative of eˣ

Key termThe natural exponential function \( e^x \), where \( e \approx 2.71828 \), is the only exponential function whose gradient at every point equals its own value: \( \frac{d}{dx}e^x = e^x \). In particular its gradient at \( x = 0 \) is exactly 1. Its inverse is the natural logarithm, \( \ln x \).
\[ \frac{d}{dx}\,e^{x} = e^{x} \qquad\qquad \frac{d}{dx}\,e^{kx} = k\,e^{kx} \qquad\qquad \frac{d}{dx}\,e^{f(x)} = f'(x)\,e^{f(x)} \]

The first rule says the height of the curve and its slope are the same number. At \( x = 0 \), \( e^0 = 1 \), so the tangent there has gradient 1: it is the line \( y = x + 1 \) in Figure 1. The second and third rules come from the chain rule: differentiate the outside (\( e^{u} \) stays as \( e^{u} \)), then multiply by the derivative of the inside [1].

Mathematics Made Simple textbook coverMathematics Made Simple explains exponential and logarithmic derivatives with worked examples and graphs.Get the textbook · $12

Back to the case. \( Y(t) = 1500e^{0.03t} \), so \( Y'(t) = 1500 \times 0.03\,e^{0.03t} = 45e^{0.03t} \). Today, \( Y'(0) = 45 \): output is rising at $45 billion a year. In ten years, \( Y'(10) = 45e^{0.3} \approx 60.74 \) billion a year. Divide the rate by the level: \( \frac{Y'(t)}{Y(t)} = \frac{45e^{0.03t}}{1500e^{0.03t}} = 0.03 \). The growth rate is 3% every year.

Other bases: aˣ

What about \( 2^x \) or \( 5^x \)? Rewrite the base using \( e \): since \( a = e^{\ln a} \), we have \( a^x = e^{x \ln a} \). Now use the \( e^{kx} \) rule with \( k = \ln a \):

\[ \frac{d}{dx}\,a^{x} = a^{x}\ln a \qquad\qquad \frac{d}{dx}\,a^{f(x)} = f'(x)\,a^{f(x)}\ln a \]

When \( a = e \), \( \ln e = 1 \) and the rule collapses back to \( e^x \). That is exactly why \( e \) is the “natural” base: it is the one where the extra factor disappears.

The derivative of ln x

Let \( y = \ln x \). Then \( x = e^{y} \), so \( \frac{dx}{dy} = e^{y} = x \). Turn it upside down: \( \frac{dy}{dx} = \frac{1}{x} \). The same argument, with the chain rule, gives the general form:

\[ \frac{d}{dx}\ln x = \frac{1}{x} \;\;(x > 0) \qquad\qquad \frac{d}{dx}\ln f(x) = \frac{f'(x)}{f(x)} \;\;(f(x) > 0) \]

In Figure 1, the tangent to \( \ln x \) at \( (1, 0) \) has gradient \( \frac11 = 1 \): it is the line \( y = x – 1 \), the mirror image of the tangent to \( e^x \) at \( (0, 1) \). For other bases, change base first: \( \log_a x = \frac{\ln x}{\ln a} \), and \( \ln a \) is just a constant, so

\[ \frac{d}{dx}\log_a x = \frac{1}{x \ln a} \]

Before differentiating any logarithm, simplify with the log laws: \( \ln(ab) = \ln a + \ln b \), \( \ln\frac{a}{b} = \ln a – \ln b \), \( \ln a^n = n\ln a \). Our free guide on exponentials and logarithms revises these laws.

eˣ and ln x are mirror images, and so are their tangents
y = eˣy = ln xTangents of gradient 1
-3-2-1012345-3-2-1012345xyy = eˣy = ln xtangent y = x + 1 at (0, 1)tangent y = x − 1 at (1, 0)y = x
Figure 1. The graphs of y = eˣ and y = ln x are reflections of each other in the line y = x. The tangent to eˣ at (0, 1) is y = x + 1 and the tangent to ln x at (1, 0) is y = x − 1; both have gradient 1, because the gradient of eˣ at x = 0 is e⁰ = 1 and the gradient of ln x at x = 1 is 1/1 = 1.

Summary table of rules

FunctionDerivativeExample
\( e^{x} \)\( e^{x} \)gradient at \( x = 0 \) is 1
\( e^{kx} \)\( ke^{kx} \)\( \frac{d}{dx}e^{3x} = 3e^{3x} \)
\( e^{f(x)} \)\( f'(x)e^{f(x)} \)\( \frac{d}{dx}e^{x^2} = 2xe^{x^2} \)
\( a^{x} \)\( a^{x}\ln a \)\( \frac{d}{dx}5^{x} = 5^{x}\ln 5 \)
\( \ln x \)\( \frac{1}{x} \)gradient at \( x = 1 \) is 1
\( \ln f(x) \)\( \frac{f'(x)}{f(x)} \)\( \frac{d}{dx}\ln(3x – 2) = \frac{3}{3x – 2} \)
\( \log_a x \)\( \frac{1}{x\ln a} \)\( \frac{d}{dx}\log_{10}x = \frac{1}{x\ln 10} \)

Applications: growth rates, elasticity and optimisation

Growth rates. For any positive quantity \( Y(t) \), \( \frac{d}{dt}\ln Y = \frac{Y'(t)}{Y(t)} \), the proportional growth rate. That is why economists plot GDP on a log scale: a straight line means a constant growth rate. With \( Y = 1500e^{0.03t} \), \( \ln Y = \ln 1500 + 0.03t \), whose derivative is 0.03. The doubling time is \( \frac{\ln 2}{0.03} \approx 23.1 \) years.

Elasticity. Price elasticity of demand is \( \frac{dQ}{dP}\cdot\frac{P}{Q} \), which is the same as \( \frac{d\ln Q}{d\ln P} \). For a constant-elasticity demand curve \( Q = 500P^{-1.5} \), taking logs gives \( \ln Q = \ln 500 – 1.5\ln P \), so the elasticity is \( -1.5 \) at every price. For \( Q = 200e^{-0.05P} \), \( \ln Q = \ln 200 – 0.05P \), so \( \frac{d\ln Q}{dP} = -0.05 \) and the elasticity is \( -0.05P \). Demand is unit elastic at \( P = 20 \), which is exactly where revenue \( R = 200Pe^{-0.05P} \) is highest, at about $1,471.52 [4]. See our price elasticity of demand post for the economics.

Optimisation. Functions like \( xe^{-x} \) rise then fall, and they model things such as a drug’s concentration in the blood or the sales of a product after launch. You find the peak with the product rule and the exponential rule together, as in the third worked example.

Worked examples

Worked example

Differentiate (a) \( e^{3x} \), (b) \( 5^{x} \), evaluating the gradient at \( x = 2 \), and (c) \( 2^{3x} \).

Step 1(a) Inside is \( 3x \), derivative 3. So \( \frac{d}{dx}e^{3x} = 3e^{3x} \).
Step 2(b) \( \frac{d}{dx}5^{x} = 5^{x}\ln 5 \). At \( x = 2 \): \( 25\ln 5 = 25 \times 1.6094 \approx 40.24 \).
Step 3(c) Base 2, inside \( 3x \): \( \frac{d}{dx}2^{3x} = 3 \cdot 2^{3x}\ln 2 \).

Every non-\( e \) base produces a \( \ln a \) factor; every inside function produces a chain-rule factor.

Worked example

Differentiate (a) \( \ln(x^2 + 1) \) and find the gradient at \( x = 1 \); (b) \( \ln\sqrt{x^2 + 4} \); (c) \( \log_{10}x \) at \( x = 100 \).

Step 1(a) \( f = x^2 + 1 \), \( f’ = 2x \). So \( \frac{dy}{dx} = \frac{2x}{x^2 + 1} \). At \( x = 1 \): \( \frac{2}{2} = 1 \).
Step 2(b) Simplify first: \( \ln\sqrt{x^2 + 4} = \tfrac12\ln(x^2 + 4) \).
Step 3Then \( \frac{dy}{dx} = \tfrac12 \cdot \frac{2x}{x^2 + 4} = \frac{x}{x^2 + 4} \).
Step 4(c) \( \frac{d}{dx}\log_{10}x = \frac{1}{x\ln 10} \). At \( x = 100 \): \( \frac{1}{100 \times 2.3026} \approx 0.00434 \).

Using \( \ln a^n = n\ln a \) in part (b) removed the square root before any differentiation.

Worked example

Find the maximum value of \( f(x) = xe^{-x} \) for \( x \ge 0 \), and confirm it is a maximum.

Step 1Product rule with \( u = x \), \( u’ = 1 \), \( v = e^{-x} \), \( v’ = -e^{-x} \): \( f'(x) = e^{-x} – xe^{-x} = (1 – x)e^{-x} \).
Step 2\( e^{-x} \) is never zero, so \( f'(x) = 0 \) only when \( x = 1 \).
Step 3\( f(1) = e^{-1} \approx 0.3679 \).
Step 4\( f”(x) = (x – 2)e^{-x} \), so \( f”(1) = -e^{-1} \approx -0.3679 < 0 \): a maximum.

The function peaks at \( x = 1 \) with value \( \frac{1}{e} \). Every answer above was checked with a computer algebra system.

Mathematics Made Simple Practice Questions coverMake exponential and logarithmic derivatives automatic with the Practice Questions book: 1,565 questions, all fully worked.Get 1,565 questions · $9
Common mistakeForgetting the chain-rule factor. \( \frac{d}{dx}e^{3x} \) is \( 3e^{3x} \), not \( e^{3x} \). Likewise \( \frac{d}{dx}\ln(5x) \) is \( \frac{5}{5x} = \frac1x \), not \( \frac{1}{5x} \). (Check: \( \ln 5x = \ln 5 + \ln x \), and \( \ln 5 \) is a constant.)
Common mistakeUsing the power rule on an exponential. \( \frac{d}{dx}2^{x} \) is not \( x \cdot 2^{x-1} \). The power rule is for a variable base with a fixed power, like \( x^2 \); here the base is fixed and the power varies, so the answer is \( 2^{x}\ln 2 \).
Exam tipIn Cambridge 9709, the derivatives of \( e^x \) and \( \ln x \) appear in Pure Mathematics 2 and 3, while the chain rule is already in Pure Mathematics 1 [3]. AP Calculus AB and BC and IB Mathematics also test these rules [2]. In any paper, write the inside function and its derivative before you start: “let \( u = x^2 + 1 \), \( u’ = 2x \)”. It earns method marks and catches errors.

For the full path from indices and functions through limits and derivatives to their applications, with 282 worked examples, see the Mathematics Made Simple textbook. To build speed, the Mathematics Made Simple Practice Questions book has exam-style questions in AP Calculus, Cambridge 9709 and IB formats, every one with a fully worked answer. Revise the chain rule first in the chain rule step of our free guide.

Mathematics Made Simple bundle coverMaster differential calculus with both Mathematics Made Simple books for $16.Both books · $16

Practice questions

EasyQ1. Differentiate \( y = 4e^{2x} \). Show worked answer
\( \frac{dy}{dx} = 4 \times 2e^{2x} = 8e^{2x} \).
EasyQ2. Differentiate \( y = \ln(3x – 2) \), for \( x > \tfrac23 \). Show worked answer
\( f = 3x – 2 \), \( f’ = 3 \).
\( \frac{dy}{dx} = \frac{3}{3x – 2} \).
MediumQ3. Find the gradient of \( y = 3e^{4x} – \ln(5x) \) at \( x = \tfrac14 \). Show worked answer
\( \frac{dy}{dx} = 12e^{4x} – \frac{1}{x} \).
At \( x = \tfrac14 \): \( 12e – 4 \approx 32.62 – 4 = 28.62 \).
MediumQ4. Find the stationary point of \( y = x^2\ln x \) for \( x > 0 \) and determine its nature. Show worked answer
\( \frac{dy}{dx} = 2x\ln x + x = x(2\ln x + 1) \).
Set to zero: \( \ln x = -\tfrac12 \), so \( x = e^{-1/2} \approx 0.607 \).
\( y = e^{-1} \times (-\tfrac12) = -\frac{1}{2e} \approx -0.184 \).
\( \frac{d^2y}{dx^2} = 2\ln x + 3 = -1 + 3 = 2 > 0 \): a minimum.
ExamQ5. Monthly sales of a new app, in thousands, are modelled by \( S(t) = 20te^{-0.5t} \), where \( t \) is months after launch. (a) Show that \( S'(t) = 10(2 – t)e^{-0.5t} \). (b) Find when sales peak and the peak value. (c) Show that this is a maximum. (d) Find the rate of change of sales at \( t = 4 \) and interpret it. [8] Show worked answer
(a) Product rule: \( 20e^{-0.5t} + 20t(-0.5)e^{-0.5t} \) [1] \( = (20 – 10t)e^{-0.5t} = 10(2 – t)e^{-0.5t} \) [1].
(b) \( e^{-0.5t} \ne 0 \), so \( t = 2 \) [1]; \( S(2) = 40e^{-1} \approx 14.72 \) thousand [1].
(c) \( S”(t) = 5(t – 4)e^{-0.5t} \) [1]; \( S”(2) = -10e^{-1} \approx -3.68 < 0 \), so a maximum [1].
(d) \( S'(4) = -20e^{-2} \approx -2.71 \) [1]: sales are falling by about 2,710 per month at four months [1].

Frequently asked questions

Why is the derivative of eˣ equal to eˣ?

Because \( e \) is defined as the base for which the exponential’s gradient at \( x = 0 \) is exactly 1. For any exponential, the gradient at each point is the height times the gradient at zero, so for base \( e \) the gradient equals the height everywhere.

What is the derivative of ln(kx)?

It is \( \frac{1}{x} \), for any positive constant \( k \). Since \( \ln kx = \ln k + \ln x \) and \( \ln k \) is a constant, only \( \ln x \) contributes.

Do I need log base 10 in calculus exams?

Rarely, but you should know \( \frac{d}{dx}\log_{10}x = \frac{1}{x\ln 10} \). Calculus works most naturally in base \( e \), so convert other bases using \( \log_a x = \frac{\ln x}{\ln a} \).

What is logarithmic differentiation?

Taking logs of both sides before differentiating, useful for functions like \( x^x \) or long products. For \( y = x^x \): \( \ln y = x\ln x \), so \( \frac{1}{y}\frac{dy}{dx} = \ln x + 1 \) and \( \frac{dy}{dx} = x^x(\ln x + 1) \).

References

  1. Strang, G. and Herman, E. (2016) Calculus Volume 1. Houston, TX: OpenStax. Section 3.9, Derivatives of exponential and logarithmic functions. Available at: https://openstax.org/books/calculus-volume-1/pages/3-9-derivatives-of-exponential-and-logarithmic-functions.
  2. College Board (n.d.) AP Calculus AB and AP Calculus BC Course and Exam Description. New York: College Board. Available at: https://apcentral.collegeboard.org/media/pdf/ap-calculus-ab-and-bc-course-and-exam-description.pdf.
  3. Cambridge International (n.d.) Cambridge International AS & A Level Mathematics 9709: Syllabus for examination in 2026 and 2027. Cambridge: Cambridge University Press & Assessment. Available at: https://www.cambridgeinternational.org/Images/697427-2026-2027-syllabus.pdf.
  4. Sydsæter, K., Hammond, P., Strøm, A. and Carvajal, A. (2016) Essential Mathematics for Economic Analysis. 5th edn. Harlow: Pearson.
Mathematics Made Simple complete bundle cover
This topic has a full chapter in Mathematics Made Simple, with 1,565 fully worked practice questions in the bundle.Mathematics Made Simple Complete Bundle — Textbook + 1,565 Practice Questions
Get it for $19
E

The EconTutorials team writes clear, exam-focused lessons in economics and statistics for A-Level, IB, AP and university students, with more than 13 years of classroom teaching behind every guide and book in the Made Simple series.