Differentiating ln x and e^x

A2 · P3 · 12 min

The exponential function exe^x is the one function that is its own derivative, and its inverse ln⁡x\ln x has the simplest possible derivative, 1x\dfrac{1}{x}. Together with the chain rule, these two facts let you differentiate every exponential and logarithmic expression on the syllabus. They appear on every P3 paper: inside stationary-point questions, in tangents and normals, in rates of growth and decay, and as the starting point for integrating 1x\dfrac{1}{x} and exe^{x}.

Why e^x is its own derivative

Look at any exponential curve y=axy = a^x with a>1a > 1. It gets steeper as it climbs, and the gradient at each point turns out to be proportional to the height at that point: ddxax=k⋅ax\dfrac{d}{dx}a^x = k \cdot a^x for some constant kk that depends on aa.

  • For a=2a = 2, the constant is about 0.6930.693: the gradient is a bit less than the height.
  • For a=3a = 3, the constant is about 1.0991.099: the gradient is a bit more than the height.

Somewhere between 2 and 3 there is a base for which the constant is exactly 1. That base is e=2.71828…e = 2.71828\ldots, and that is its definition for calculus. For y=exy = e^x, the gradient at every point equals the yy-coordinate. At (0,1)(0, 1) the gradient is 11; at (1,e)(1, e) the gradient is ee; at (ln⁡5,5)(\ln 5, 5) the gradient is 55.

The exponential function
ddxex=exddxef(x)=f′(x) ef(x)\frac{d}{dx}e^x = e^x \qquad\qquad \frac{d}{dx}e^{f(x)} = f'(x)\,e^{f(x)}

In particular ddxeax+b=a eax+b\dfrac{d}{dx}e^{ax+b} = a\,e^{ax+b}.

So differentiating e(something)e^{\text{(something)}} leaves the exponential exactly as it was and multiplies it by the derivative of the power.

ddxe5x=5e5x,ddxe−x=−e−x,ddxex2+1=2x ex2+1,ddxex=ex2x\frac{d}{dx}e^{5x} = 5e^{5x}, \qquad \frac{d}{dx}e^{-x} = -e^{-x}, \qquad \frac{d}{dx}e^{x^2 + 1} = 2x\,e^{x^2+1}, \qquad \frac{d}{dx}e^{\sqrt{x}} = \frac{e^{\sqrt{x}}}{2\sqrt{x}}

Why ln x has derivative 1/x

ln⁡x\ln x is the inverse of exe^x: y=ln⁡xy = \ln x means exactly x=eyx = e^y. Differentiate this with respect to yy:

dxdy=ey=x\frac{dx}{dy} = e^y = x

and turn it upside down:

dydx=1dx/dy=1x\frac{dy}{dx} = \frac{1}{dx/dy} = \frac{1}{x}

Geometrically, y=ln⁡xy = \ln x is the reflection of y=exy = e^x in the line y=xy = x. Reflection swaps the roles of xx and yy, so the gradient at a point becomes the reciprocal of the gradient at the mirror-image point. The gradient of exe^x at (0,1)(0, 1) is 11, so the gradient of ln⁡x\ln x at (1,0)(1, 0) is 11; the gradient of exe^x at (ln⁡4,4)(\ln 4, 4) is 44, so the gradient of ln⁡x\ln x at (4,ln⁡4)(4, \ln 4) is 14\tfrac{1}{4}.

y = e^x y = ln(x) y = x

The curves y=exy = e^x (solid) and y=ln⁡xy = \ln x (dashed) are reflections of each other in y=xy = x. Both have gradient 11 where they cross the axes.

The natural logarithm
ddxln⁡x=1xddxln⁡f(x)=f′(x)f(x)\frac{d}{dx}\ln x = \frac{1}{x} \qquad\qquad \frac{d}{dx}\ln f(x) = \frac{f'(x)}{f(x)}

In particular ddxln⁡(ax+b)=aax+b\dfrac{d}{dx}\ln(ax + b) = \dfrac{a}{ax+b}.

The general form is worth reading aloud: the derivative of ln⁡\ln of something is the derivative of the something, divided by the something.

ddxln⁡(x2−3x)=2x−3x2−3x,ddxln⁡(1+ex)=ex1+ex,ddxln⁡(cos⁡x)=−sin⁡xcos⁡x=−tan⁡x\frac{d}{dx}\ln(x^2 - 3x) = \frac{2x - 3}{x^2 - 3x}, \qquad \frac{d}{dx}\ln(1 + e^x) = \frac{e^x}{1 + e^x}, \qquad \frac{d}{dx}\ln(\cos x) = \frac{-\sin x}{\cos x} = -\tan x

The surprising case ln(kx)

ddxln⁡4x=44x=1x\frac{d}{dx}\ln 4x = \frac{4}{4x} = \frac{1}{x}

This looks wrong at first, but it is right: ln⁡4x=ln⁡4+ln⁡x\ln 4x = \ln 4 + \ln x, and ln⁡4\ln 4 is a constant, which differentiates to zero. The graphs of ln⁡x\ln x, ln⁡4x\ln 4x and ln⁡100x\ln 100x are vertical translations of one another, so they have the same gradient at every xx.

Use the log laws before you differentiate

The laws of logarithms turn products, quotients and powers inside a log into sums, differences and multiples outside it. Since sums are much easier to differentiate than quotients, always expand first.

Log laws to apply before differentiating
ln⁡(ab)=ln⁡a+ln⁡b,ln⁡ab=ln⁡a−ln⁡b,ln⁡ak=kln⁡a\ln(ab) = \ln a + \ln b, \qquad \ln\frac{a}{b} = \ln a - \ln b, \qquad \ln a^k = k\ln a
y=ln⁡x23x+1=2ln⁡x−12ln⁡(3x+1)⇒dydx=2x−32(3x+1)y = \ln\frac{x^2}{\sqrt{3x+1}} = 2\ln x - \tfrac{1}{2}\ln(3x+1) \quad\Rightarrow\quad \frac{dy}{dx} = \frac{2}{x} - \frac{3}{2(3x+1)}

Without the expansion you would need the quotient rule and the chain rule nested inside the chain rule.

Watch out

ln⁡(a+b)\ln(a + b) does not split. There is no law for the log of a sum. ln⁡(x2+1)\ln(x^2 + 1) must be differentiated with the chain rule as it stands: 2xx2+1\dfrac{2x}{x^2+1}.

Also distinguish:

ExpressionMeansDerivative
ln⁡x3\ln x^3ln⁡(x3)=3ln⁡x\ln(x^3) = 3\ln x3x\dfrac{3}{x}
(ln⁡x)3(\ln x)^3the cube of ln⁡x\ln x3(ln⁡x)2⋅1x=3(ln⁡x)2x3(\ln x)^2 \cdot \dfrac{1}{x} = \dfrac{3(\ln x)^2}{x}
ln⁡(ln⁡x)\ln(\ln x)log of a log1ln⁡x⋅1x=1xln⁡x\dfrac{1}{\ln x}\cdot\dfrac{1}{x} = \dfrac{1}{x\ln x}

Simplifying exponentials first

Index laws do the same job for exponentials.

  • 2e3x=2e−3x\dfrac{2}{e^{3x}} = 2e^{-3x}, derivative −6e−3x-6e^{-3x}.
  • (ex+e−x)2=e2x+2+e−2x(e^x + e^{-x})^2 = e^{2x} + 2 + e^{-2x}, derivative 2e2x−2e−2x2e^{2x} - 2e^{-2x}.
  • e2x−1ex=ex−e−x\dfrac{e^{2x} - 1}{e^x} = e^{x} - e^{-x}, derivative ex+e−xe^x + e^{-x}.
  • eln⁡x=xe^{\ln x} = x and e2ln⁡x=x2e^{2\ln x} = x^2: simplify these on sight.
Other bases

The syllabus only requires exe^x, but axa^x occasionally appears. Write a=eln⁡aa = e^{\ln a}, so ax=exln⁡aa^x = e^{x\ln a}, and differentiate with the chain rule:

ddxax=ln⁡a⋅exln⁡a=axln⁡a,e.g. ddx2x=2xln⁡2\frac{d}{dx}a^x = \ln a \cdot e^{x\ln a} = a^x\ln a, \qquad \text{e.g. } \frac{d}{dx}2^x = 2^x\ln 2

Equations that come out of these derivatives

Setting a derivative to zero frequently gives an equation in exe^x or ln⁡x\ln x. These standard moves finish the job:

  • ekx=c⇒kx=ln⁡ce^{kx} = c \Rightarrow kx = \ln c, valid only for c>0c > 0. If c≤0c \le 0 there is no solution, and that is often the point of the question.
  • ln⁡x=c⇒x=ec\ln x = c \Rightarrow x = e^c.
  • An equation in e2xe^{2x} and exe^x is a quadratic in u=exu = e^x, because e2x=(ex)2e^{2x} = (e^x)^2.
  • 4ex=9e−x4e^x = 9e^{-x}: multiply through by exe^x to get 4e2x=94e^{2x} = 9.

See logarithms and Euler's number for more on solving them.

Worked examples

Exponential composites

Differentiate (a) 3e4x−13e^{4x - 1} (b) ex2+1e^{x^2 + 1} (c) 2e3x\dfrac{2}{e^{3x}} (d) ex+1\sqrt{e^x + 1}.

Solution

(a) 3×4e4x−1=12e4x−13 \times 4e^{4x-1} = 12e^{4x-1}.

(b) The power x2+1x^2 + 1 has derivative 2x2x:  2x ex2+1\ 2x\,e^{x^2+1}.

(c) Rewrite as 2e−3x2e^{-3x}: derivative 2×(−3)e−3x=−6e−3x2 \times (-3)e^{-3x} = -6e^{-3x}.

(d) Write as (ex+1)1/2(e^x + 1)^{1/2}. Chain rule:

12(ex+1)−1/2×ex=ex2ex+1\frac{1}{2}(e^x + 1)^{-1/2} \times e^x = \frac{e^x}{2\sqrt{e^x + 1}}
Logarithmic composites

Differentiate (a) ln⁡(x2−3x)\ln(x^2 - 3x) (b) ln⁡x23x+1\ln\dfrac{x^2}{\sqrt{3x+1}} (c) (ln⁡x)3(\ln x)^3, giving (b) as a single fraction.

Solution

(a) 2x−3x2−3x\dfrac{2x - 3}{x^2 - 3x}.

(b) Expand first: y=2ln⁡x−12ln⁡(3x+1)y = 2\ln x - \tfrac{1}{2}\ln(3x + 1).

dydx=2x−12⋅33x+1=4(3x+1)−3x2x(3x+1)=9x+42x(3x+1)\frac{dy}{dx} = \frac{2}{x} - \frac{1}{2}\cdot\frac{3}{3x + 1} = \frac{4(3x+1) - 3x}{2x(3x + 1)} = \frac{9x + 4}{2x(3x+1)}

(c) Outer function is a cube: 3(ln⁡x)2×1x=3(ln⁡x)2x3(\ln x)^2 \times \dfrac{1}{x} = \dfrac{3(\ln x)^2}{x}.

Stationary point from an exponential equation

Find the exact coordinates of the stationary point of y=4ex+9e−xy = 4e^x + 9e^{-x} and determine its nature.

Solutiondydx=4ex−9e−x\frac{dy}{dx} = 4e^x - 9e^{-x}

Set to zero and multiply by exe^x: 4e2x=94e^{2x} = 9, so e2x=94e^{2x} = \tfrac{9}{4}, ex=32e^x = \tfrac{3}{2} (since ex>0e^x > 0), and x=ln⁡32x = \ln\tfrac{3}{2}.

y=4⋅32+9⋅23=6+6=12y = 4 \cdot \tfrac{3}{2} + 9 \cdot \tfrac{2}{3} = 6 + 6 = 12. The point is (ln⁡32, 12)\left(\ln\tfrac{3}{2},\ 12\right).

d2ydx2=4ex+9e−x>0\dfrac{d^2y}{dx^2} = 4e^x + 9e^{-x} > 0 for all xx, so it is a minimum.

Showing a curve has no stationary points

Show that the curve y=ln⁡(x2+4)−xy = \ln(x^2 + 4) - x has no stationary points, and state whether yy is increasing or decreasing.

Solutiondydx=2xx2+4−1=2x−x2−4x2+4=−x2−2x+4x2+4\frac{dy}{dx} = \frac{2x}{x^2 + 4} - 1 = \frac{2x - x^2 - 4}{x^2 + 4} = -\frac{x^2 - 2x + 4}{x^2 + 4}

Complete the square: x2−2x+4=(x−1)2+3>0x^2 - 2x + 4 = (x - 1)^2 + 3 > 0 for all xx. The denominator is also positive.

So dydx<0\dfrac{dy}{dx} < 0 for all xx: it is never zero, so there are no stationary points, and yy is decreasing for all xx.

Rate of decay

The mass, mm grams, of a radioactive substance after tt days is m=50e−0.02tm = 50e^{-0.02t}.

(a) Find the rate at which the mass is decreasing when t=10t = 10.

(b) Find the value of tt at which the mass is decreasing at a rate of 0.50.5 grams per day.

Solution

(a) dmdt=50×(−0.02)e−0.02t=−e−0.02t\dfrac{dm}{dt} = 50 \times (-0.02)e^{-0.02t} = -e^{-0.02t}. At t=10t = 10: −e−0.2=−0.819-e^{-0.2} = -0.819. The mass is decreasing at 0.8190.819 grams per day (3 s.f.).

(b) e−0.02t=0.5⇒−0.02t=ln⁡0.5⇒t=ln⁡20.02=50ln⁡2=34.7e^{-0.02t} = 0.5 \Rightarrow -0.02t = \ln 0.5 \Rightarrow t = \dfrac{\ln 2}{0.02} = 50\ln 2 = 34.7 days (3 s.f.).

Note the sign: "decreasing at a rate of 0.50.5" means dmdt=−0.5\dfrac{dm}{dt} = -0.5.

Exam-hard: a tangent through a given point

The tangent to the curve y=e2xy = e^{2x} at the point where x=px = p passes through the point (1,0)(1, 0). Find pp, and the equation of this tangent.

Solution

At x=px = p: y=e2py = e^{2p} and dydx=2e2p\dfrac{dy}{dx} = 2e^{2p}. Tangent:

y−e2p=2e2p(x−p)y - e^{2p} = 2e^{2p}(x - p)

It passes through (1,0)(1, 0):

−e2p=2e2p(1−p)-e^{2p} = 2e^{2p}(1 - p)

Divide by e2pe^{2p}, which is never zero: −1=2−2p-1 = 2 - 2p, so p=32p = \tfrac{3}{2}.

The tangent is y−e3=2e3(x−32)y - e^3 = 2e^3\left(x - \tfrac{3}{2}\right), i.e. y=2e3x−2e3=2e3(x−1)y = 2e^3x - 2e^3 = 2e^3(x - 1).

Common mistakes
  • ddxex2=x2ex2−1\dfrac{d}{dx}e^{x^2} = x^2e^{x^2 - 1}. The power rule does not apply to exponentials. The power stays the same; multiply by its derivative: 2xex22xe^{x^2}.
  • ddxln⁡(x2+1)=1x2+1\dfrac{d}{dx}\ln(x^2 + 1) = \dfrac{1}{x^2 + 1}. The inner derivative 2x2x is missing.
  • Splitting ln⁡(a+b)\ln(a + b). ln⁡(x+3)≠ln⁡x+ln⁡3\ln(x + 3) \ne \ln x + \ln 3.
  • Losing solutions or inventing them. ex=−2e^x = -2 has no solution; do not write x=ln⁡(−2)x = \ln(-2). e2x=9e^{2x} = 9 gives ex=3e^x = 3 only.
  • Forgetting that ln⁡x\ln x needs x>0x > 0. A stationary point at x=−1x = -1 of a function containing ln⁡x\ln x is not on the curve.
Exam tip
  • The phrase "exact" with an exponential or log answer means leave it as ln⁡32\ln\tfrac{3}{2}, e−2e^{-2}, 50ln⁡250\ln 2. Simplify eln⁡3=3e^{\ln 3} = 3 and ln⁡e2=2\ln e^2 = 2 when they appear.
  • When you multiply an equation through by exe^x or divide by e2pe^{2p}, say why it is allowed ("ex>0e^x > 0"). It costs nothing and protects the method mark.
  • Context questions: "rate of decrease" is the size of a negative derivative. State the final answer with units and a sentence.
  • Expanding a log with the log laws first is not just faster, it is safer; examiners routinely report quotient-rule errors on functions that should have been simplified.
Summary
  • ddxex=ex\dfrac{d}{dx}e^x = e^x; ddxef(x)=f′(x)ef(x)\dfrac{d}{dx}e^{f(x)} = f'(x)e^{f(x)}.
  • ddxln⁡x=1x\dfrac{d}{dx}\ln x = \dfrac{1}{x}; ddxln⁡f(x)=f′(x)f(x)\dfrac{d}{dx}\ln f(x) = \dfrac{f'(x)}{f(x)}.
  • ddxln⁡kx=1x\dfrac{d}{dx}\ln kx = \dfrac{1}{x} because ln⁡k\ln k is a constant.
  • Expand logs with the log laws before differentiating. ln⁡(a+b)\ln(a+b) does not split.
  • ln⁡x3=3ln⁡x\ln x^3 = 3\ln x, but (ln⁡x)3(\ln x)^3 needs the chain rule.
  • Equations from dydx=0\dfrac{dy}{dx} = 0: take logs, or use u=exu = e^x for quadratics in exe^x. Reject ex≤0e^x \le 0.
  • ddxax=axln⁡a\dfrac{d}{dx}a^x = a^x\ln a (via ax=exln⁡aa^x = e^{x\ln a}).

Practice

Question
  1. Differentiate (a) 5e2−3x5e^{2 - 3x} (b) exe^{\sqrt{x}} (c) (ex+e−x)2(e^x + e^{-x})^2.
  2. Differentiate (a) ln⁡(7−x2)\ln(7 - x^2) (b) ln⁡(x+1)2x−2\ln\dfrac{(x+1)^2}{x - 2} (c) ln⁡(ln⁡x)\ln(\ln x).
  3. Find the equation of the tangent to y=e2x−4y = e^{2x - 4} at the point where x=2x = 2.
  4. Find the exact coordinates of the stationary point of y=e3x−6xy = e^{3x} - 6x and show that it is a minimum.
  5. Find the exact coordinates of the stationary point of y=x−2ln⁡(x+1)y = x - 2\ln(x + 1), for x>−1x > -1, and determine its nature.
  6. Find the point on y=3ln⁡xy = 3\ln x at which the tangent passes through the origin.
  7. The curve y=Aekxy = Ae^{kx} passes through (0,5)(0, 5), where its gradient is −10-10. Find AA and kk, and the exact value of xx at which the gradient is −0.1-0.1.
  8. Show that the curve y=e2x−2ex+2xy = e^{2x} - 2e^x + 2x has no stationary points.
  9. The curve y=ln⁡(2x−1)+axy = \ln(2x - 1) + \dfrac{a}{x}, where aa is a constant, has a stationary point at x=2x = 2. Find aa, the exact yy-coordinate of the stationary point, and determine its nature.
Answers
  1. (a) 5×(−3)e2−3x=−15e2−3x5 \times (-3)e^{2-3x} = -15e^{2-3x}. (b) The power x1/2x^{1/2} has derivative 12x−1/2\tfrac{1}{2}x^{-1/2}: ex2x\dfrac{e^{\sqrt{x}}}{2\sqrt{x}}. (c) Expand: e2x+2+e−2xe^{2x} + 2 + e^{-2x}, derivative 2e2x−2e−2x2e^{2x} - 2e^{-2x}.

  2. (a) −2x7−x2\dfrac{-2x}{7 - x^2}. (b) y=2ln⁡(x+1)−ln⁡(x−2)y = 2\ln(x+1) - \ln(x-2), so dydx=2x+1−1x−2\dfrac{dy}{dx} = \dfrac{2}{x + 1} - \dfrac{1}{x - 2}, which simplifies to x−5(x+1)(x−2)\dfrac{x - 5}{(x+1)(x-2)}. (c) 1ln⁡x⋅1x=1xln⁡x\dfrac{1}{\ln x}\cdot\dfrac{1}{x} = \dfrac{1}{x\ln x}.

  3. At x=2x = 2: y=e0=1y = e^0 = 1, dydx=2e2x−4=2\dfrac{dy}{dx} = 2e^{2x-4} = 2. Tangent: y−1=2(x−2)y - 1 = 2(x - 2), i.e. y=2x−3y = 2x - 3.

  4. dydx=3e3x−6=0⇒e3x=2⇒x=13ln⁡2\dfrac{dy}{dx} = 3e^{3x} - 6 = 0 \Rightarrow e^{3x} = 2 \Rightarrow x = \tfrac{1}{3}\ln 2. Then y=2−6⋅13ln⁡2=2−2ln⁡2y = 2 - 6 \cdot \tfrac{1}{3}\ln 2 = 2 - 2\ln 2. d2ydx2=9e3x=18>0\dfrac{d^2y}{dx^2} = 9e^{3x} = 18 > 0, a minimum at (13ln⁡2, 2−2ln⁡2)\left(\tfrac{1}{3}\ln 2,\ 2 - 2\ln 2\right).

  5. dydx=1−2x+1=0⇒x=1\dfrac{dy}{dx} = 1 - \dfrac{2}{x + 1} = 0 \Rightarrow x = 1, y=1−2ln⁡2y = 1 - 2\ln 2. d2ydx2=2(x+1)2=12>0\dfrac{d^2y}{dx^2} = \dfrac{2}{(x+1)^2} = \tfrac{1}{2} > 0: a minimum at (1, 1−2ln⁡2)(1,\ 1 - 2\ln 2).

  6. At x=ax = a the tangent is y−3ln⁡a=3a(x−a)y - 3\ln a = \dfrac{3}{a}(x - a). Through (0,0)(0, 0): −3ln⁡a=−3-3\ln a = -3, so ln⁡a=1\ln a = 1, a=ea = e. The point is (e,3)(e, 3).

  7. (0,5)(0, 5) gives A=5A = 5. dydx=5kekx\dfrac{dy}{dx} = 5ke^{kx}, and at x=0x = 0 this is 5k=−105k = -10, so k=−2k = -2. Then −10e−2x=−0.1⇒e−2x=0.01⇒−2x=ln⁡0.01=−2ln⁡10-10e^{-2x} = -0.1 \Rightarrow e^{-2x} = 0.01 \Rightarrow -2x = \ln 0.01 = -2\ln 10, so x=ln⁡10x = \ln 10.

  8. dydx=2e2x−2ex+2=2(u2−u+1)\dfrac{dy}{dx} = 2e^{2x} - 2e^x + 2 = 2(u^2 - u + 1) with u=exu = e^x. Since u2−u+1=(u−12)2+34>0u^2 - u + 1 = \left(u - \tfrac{1}{2}\right)^2 + \tfrac{3}{4} > 0, the derivative is always positive and never zero. No stationary points.

  9. dydx=22x−1−ax2\dfrac{dy}{dx} = \dfrac{2}{2x - 1} - \dfrac{a}{x^2}. At x=2x = 2: 23−a4=0⇒a=83\tfrac{2}{3} - \tfrac{a}{4} = 0 \Rightarrow a = \tfrac{8}{3}. Then y=ln⁡3+8/32=ln⁡3+43y = \ln 3 + \dfrac{8/3}{2} = \ln 3 + \tfrac{4}{3}. d2ydx2=−4(2x−1)2+2ax3\dfrac{d^2y}{dx^2} = -\dfrac{4}{(2x-1)^2} + \dfrac{2a}{x^3}; at x=2x = 2: −49+16/38=−49+23=29>0-\tfrac{4}{9} + \dfrac{16/3}{8} = -\tfrac{4}{9} + \tfrac{2}{3} = \tfrac{2}{9} > 0, so a minimum at (2, ln⁡3+43)\left(2,\ \ln 3 + \tfrac{4}{3}\right).

How well do you know this?

Builds on

Where this leads

Console

Search notes, courses and tools, or run an action