Derivatives of exponentials and logarithms
The derivative of ln x is 1/x, and e<sup>x</sup> is its own derivative. These two facts, plus the chain rule, let you differentiate every exponential and logarithmic function you will meet in AP Calculus and A level Maths.
On this page
The core results
- d/dx (ex) = ex
- d/dx (ln x) = 1/x, for x > 0 (and d/dx ln|x| = 1/x for x ≠ 0)
- d/dx (ax) = ax ln a
- d/dx (logb x) = 1/(x ln b)
Why ex is special
Every exponential function ax has a derivative proportional to itself: the slope at any point is a constant multiple of the height. For a = 2 the constant is about 0.693; for a = 3 it is about 1.099. The number e ≈ 2.718 is the unique base for which the constant is exactly 1, so the slope of ex always equals its value. That is why e appears throughout calculus, and why natural growth and decay are written with e.
Why the derivative of ln x is 1/x
Let y = ln x, so x = ey. Differentiate both sides with respect to x, using implicit differentiation: 1 = ey · dy/dx. So dy/dx = 1/ey = 1/x. This short proof is worth knowing; it shows that ln x and ex are inverse functions, and that their derivatives are linked.
Other bases
Rewrite ax as ex ln a. By the chain rule, its derivative is ex ln a · ln a = ax ln a. Similarly, logb x = ln x / ln b, so its derivative is 1/(x ln b). When b = e, ln e = 1 and these reduce to the natural log results.
With the chain rule
- d/dx (ef(x)) = f'(x) ef(x)
- d/dx (ln f(x)) = f'(x)/f(x)
The second rule is especially useful: the derivative of the log of anything is “derivative of the inside over the inside”.
Worked examples
Example 1: exponential with a chain
Differentiate y = e3x².
- The inside is 3x², with derivative 6x.
- dy/dx = 6x e3x².
Example 2: a log of a function
Differentiate y = ln(x² + 5).
- Derivative of the inside over the inside.
- dy/dx = 2x/(x² + 5).
Example 3: simplify first
Differentiate y = ln(5x).
- Use log laws: ln(5x) = ln 5 + ln x. The derivative of the constant ln 5 is 0.
- dy/dx = 1/x. Surprisingly, the 5 disappears.
Example 4: log laws before differentiating
Differentiate y = ln(x³√(x + 1)).
- Expand: y = 3 ln x + ½ ln(x + 1).
- dy/dx = 3/x + 1/(2(x + 1)). Much easier than the product and chain rules on the original.
Example 5: another base
Differentiate y = 2x and y = log10 x.
- d/dx 2x = 2x ln 2.
- d/dx log10 x = 1/(x ln 10).
Example 6: with the product rule
Differentiate y = x e−x and find its maximum.
- dy/dx = e−x − x e−x = e−x(1 − x).
- e−x is never zero, so dy/dx = 0 only at x = 1. The derivative changes from positive to negative, so the maximum is at (1, 1/e).
Example 7: logarithmic differentiation
Differentiate y = xx for x > 0.
- Neither the power rule nor the exponential rule applies, because x is in both the base and the exponent. Take logs: ln y = x ln x.
- Differentiate implicitly: (1/y) dy/dx = ln x + 1.
- dy/dx = xx(ln x + 1).
Example 8: a tangent line
Find the tangent to y = ln x at x = e.
- Point: (e, 1). Gradient: 1/e.
- Tangent: y − 1 = (1/e)(x − e), which simplifies to y = x/e. It passes through the origin.
Rates of change in exponential models
Many real quantities follow N = N0ekt. Differentiating gives dN/dt = kN0ekt = kN: the rate of change is proportional to the amount present. That single fact explains compound growth, radioactive decay and cooling, and AP questions often ask you to find and interpret the rate at a particular time, with units.
Example 9: a growth rate
A bacteria culture grows as N = 500e0.04t, with t in minutes. Find the rate of growth at t = 10 and interpret it.
- dN/dt = 500 × 0.04 × e0.04t = 20e0.04t.
- At t = 10: 20e0.4 ≈ 29.8 bacteria per minute. At that moment, the population is increasing by about 30 bacteria each minute.
What the graphs show
The graph of ex is always increasing and always concave up, because its first and second derivatives are both ex, which is always positive. The graph of ln x is always increasing but concave down, because its derivative 1/x is positive and its second derivative −1/x² is negative. Their gradients mirror each other across the line y = x, as you would expect for inverse functions.
Integrals that come with these derivatives
Reversing the results gives two of the most useful integrals: ∫ ex dx = ex + C and ∫ 1/x dx = ln|x| + C. The second explains why ∫ f'(x)/f(x) dx = ln|f(x)| + C, which you can spot whenever the top of a fraction is the derivative of the bottom, such as ∫ 2x/(x² + 1) dx = ln(x² + 1) + C.
Common mistakes
- Writing the derivative of e3x as e3x and forgetting the 3.
- Writing the derivative of ln(x² + 5) as 1/(x² + 5), forgetting the inside derivative.
- Using the power rule on ax, as if it were xa.
- Forgetting that ln x is only defined for x > 0.
Practice questions
Try each one before opening the answer.
Q1. Differentiate e5x − 2.
Show answer
Q2. Differentiate ln(cos x).
Show answer
Q3. Differentiate 3x.
Show answer
Q4. Differentiate x² ln x.
Show answer
Q5. Differentiate ln((x + 1)/(x − 1)).
Show answer
Frequently asked questions
Are these derivatives on AP Calculus AB?
Yes. Derivatives of ex and ln x are in Unit 2, and they are combined with the chain rule in Unit 3. ax and logb x are also part of the course.
Are they in A level Maths?
Yes. Differentiating ekx and ln x is in the first and second years of A level Maths, along with ax using ln a.
Key takeaways
- d/dx ex = ex; d/dx ln x = 1/x.
- d/dx ax = ax ln a; d/dx logb x = 1/(x ln b).
- Chain rule: d/dx ln f(x) = f'(x)/f(x).
- Use log laws to simplify before differentiating.
- Use logarithmic differentiation for xx-type functions.