Start the course

Derivatives

Derivatives of eˣ, ln x, and other exponential and log functions

7 min readUpdated

Quick answer

The derivative of ex is ex, and the derivative of ln⁡x is 1x (for x>0). For other bases, ddxbx= bxln⁡b and ddxlogb⁡x= 1xln⁡b. With an inside function g(x), the chain rule gives ddxeg(x)= eg(x)g′(x) and ddxln⁡g(x)= g′(x)g(x).

Key points
  • ex is its own derivative: at every point, its slope equals its height.
  • ddxln⁡x= 1x, and ddxln⁡g(x)= g′(x)g(x).
  • Other bases bring in a factor ln⁡b: ddx2x= 2xln⁡2.
  • Use logarithm rules to simplify before differentiating, and logarithmic differentiation for functions like xx.

What is the derivative of e^x?

The derivative of ex is ex. To see why the number e≈2.718 is special, look at any exponential bx (a fixed base b raised to the variable power x). Its derivative from the definition is

ddxbx=limh→0bx+h−bxh=bx⋅limh→0bh−1h,

because bx+h=bxbh, so bx factors out. The remaining limit is a number that depends only on the base: about 0.693 for b=2 and about 1.099 for b=3. The number e is defined as the base for which this limit is exactly 1. So for ex the derivative is ex⋅1: the function is its own derivative.

Derivative of the natural exponential
ddxex= ex

On a graph, this says that at every point of y=ex, the slope equals the height. At x=0 the height is 1, so the tangent line there has slope 1.

-2-1123-2-11234y = eˣy = ln xslope 1 at (0, 1)
y=ex with its tangent line of slope 1 at (0,1), and y=ln⁡x, the mirror image of ex across the line y=x.

What is the derivative of ln x?

The natural logarithm ln⁡x is the logarithm with base e: ln⁡x is the power you raise e to in order to get x. So y=ln⁡x means ey=x. Differentiating both sides of ey=x with respect to x (using implicit differentiation) gives eydydx=1, so dydx= 1ey= 1x.

Derivative of the natural logarithm
ddxln⁡x= 1x for x>0, and more generally ddxln⁡|x|= 1x for x≠0.

How do you differentiate other bases, like 2^x and log base 2?

Rewrite the base in terms of e: since b=eln⁡b, we have bx=exln⁡b, and the chain rule gives exln⁡b⋅ln⁡b= bxln⁡b. For logarithms, the change-of-base rule logb⁡x= ln⁡xln⁡b turns every log into a natural log divided by a constant.

FunctionDerivativeExample
exexddx5ex= 5ex
bxbxln⁡bddx2x= 2xln⁡2
ln⁡x1xddx4ln⁡x= 4x
logb⁡x1xln⁡bddxlog10⁡x= 1xln⁡10
eg(x)eg(x)g′(x)ddxe3x= 3e3x
ln⁡g(x)g′(x)g(x)ddxln⁡(x2+1)= 2xx2+1
Common mistake

Using the power rule on an exponential. In xn the variable is in the base; in bx it's in the exponent. ddxe2x is not 2xe2x−1; it is 2e2x, by the chain rule.

How do you use the chain rule with e and ln?

Most exponential and log derivatives in practice have an inside function, so they need the chain rule. For eg(x), the outside eu is its own derivative, so the result is the same exponential times g′(x). For ln⁡g(x), the outside ln⁡u has derivative 1u, so the result is 1g(x) times g′(x).

Worked example: An exponential with an inside

Differentiate y=e3x2.

  1. Inside: 3x2, with derivative 6x. Outside: eu, its own derivative.
  2. Outside's derivative, inside unchanged: e3x2.
  3. Times the inside's derivative: y′=6xe3x2.

Answer: y′=6xe3x2

Worked example: A logarithm with an inside

Differentiate y=ln⁡(x2+1).

  1. Inside: x2+1, with derivative 2x.
  2. ddxln⁡g= g′g, so y′= 2xx2+1.

Answer: y′= 2xx2+1

Worked example: A product with a logarithm

Differentiate y=x2ln⁡x.

  1. Product rule with f=x2 (f′=2x) and g=ln⁡x (g′=1x).
  2. y′= 2xln⁡x+x2⋅1x.
  3. Simplify x2⋅1x=x: y′=2xln⁡x+x, which factors as x(2ln⁡x+1).

Answer: y′=x(2ln⁡x+1)

Should you use log rules before differentiating?

Yes, whenever a logarithm contains a product, a quotient or a power. The rules ln⁡(AB)=ln⁡A+ln⁡B, ln⁡AB= ln⁡A−ln⁡B and ln⁡(Ak)=kln⁡A turn one hard derivative into several easy ones.

Worked example: Log rules first

Differentiate y= ln(x3x+1).

  1. Write the root as a power: x+1= (x+1)1/2.
  2. Split the product, then bring the powers down: y= ln⁡x3+ln⁡(x+1)1/2= 3ln⁡x+12ln⁡(x+1).
  3. Differentiate each term: y′= 3x+12⋅1x+1.
  4. Tidy: y′= 3x+12(x+1).

Answer: y′= 3x+12(x+1)

Common mistake

Splitting a log of a sum. There is no rule for ln⁡(A+B); in particular ln⁡(x2+1)≠ln⁡x2+ln⁡1. Log rules only split products, quotients and powers.

What is logarithmic differentiation?

Some functions fit none of the rules directly, most famously xx, which has the variable in both the base and the exponent (so neither the power rule nor the exponential rule applies). Logarithmic differentiation takes ln of both sides, uses log rules to bring the exponent down, and then differentiates implicitly. It is also a shortcut for long products and quotients of many factors.

Worked example: A variable base and exponent

Differentiate y=xx for x>0.

  1. Take ln of both sides: ln⁡y= ln⁡(xx)= xln⁡x.
  2. Differentiate both sides with respect to x. Left: 1ydydx (chain rule). Right, by the product rule: 1⋅ln⁡x+x⋅1x= ln⁡x+1.
  3. So 1ydydx= ln⁡x+1. Multiply both sides by y: dydx= y(ln⁡x+1).
  4. Replace y by xx: dydx= xx(ln⁡x+1).

Answer: dydx= xx(ln⁡x+1)

Why do exponential functions describe growth and decay?

Because ddtCekt= k⋅Cekt, the function P(t)=Cekt has a rate of change proportional to its own size: P′=kP. That's exactly how populations, investments with continuous interest, and radioactive material behave: the more there is, the faster it changes. A positive k gives growth and a negative k gives decay.

Learn it step by step

The full lessons in the course explain this from the ground up, with graphs, worked examples, and practice problems that each have a complete worked solution.

Open the lesson

Frequently asked questions

Why is the derivative of e^x equal to e^x?

Every exponential bx has derivative bx times a constant that depends on b. The number e is chosen so that this constant is exactly 1.

What is the derivative of ln(2x)?

1x. By the chain rule it is 22x= 1x; or use log rules: ln⁡(2x)=ln⁡2+ln⁡x, and ln⁡2 is a constant.

What is the derivative of 2^x?

2xln⁡2, about 0.693⋅2x. Don't use the power rule: the variable is in the exponent.

What is the derivative of e^(-x)?

−e−x, by the chain rule: the inside −x has derivative −1.

What is the derivative of ln|x|?

1x for every x≠0. For negative x, ln⁡|x|=ln⁡(−x), and the chain rule gives −1−x= 1x.

When should I use logarithmic differentiation?

When the variable is in both the base and the exponent, like xx or xsin⁡x, or for a long product and quotient of many factors.