AP Calculus AB and BC

Derivative of ln x, e^x, and a^x: Answers and Proofs

The derivative of ln x is 1/x, the derivative of e^x is e^x itself, and the derivative of a^x is a^x times ln a (so d/dx of 2^x is 2^x ln 2). Each is proved below: e^x from the limit defining e, ln x by inverting x = e^y, and a^x by rewriting a^x as e^(x ln a).

Recognize the function before you pick a rule

Three rules hide behind functions that look nearly identical, and choosing the wrong one is the most common way to lose these points. Before you differentiate, ask two questions. First: is the variable in the exponent or in the base? Second: if the variable is in the exponent, is the base ee or some other constant aa? Your answers pick the rule.

If the variable sits in the base with a constant exponent, like x5x^5, that is the power rule from Topic 2.5, not an exponential rule at all. The functions on this page put the variable somewhere else: in the exponent, as in exe^x and axa^x, or inside a logarithm, as in lnx\ln x. CED Topic 2.7 supplies the rules for exe^x and lnx\ln x, and the axa^x result follows from a single rewrite that the later sections prove. The recognition habit worth building is to label the function by name (exponential, power, or logarithm) out loud before you write anything down, because the wrong label sends you to the wrong rule and no amount of careful algebra recovers from that.

FunctionWhat to noticeDerivative
exe^xvariable exponent, base eeexe^x
axa^xvariable exponent, constant base a>0a > 0axlnaa^x \ln a
lnx\ln xnatural logarithm1x\frac{1}{x}
logax\log_a xlogarithm, base aa1xlna\frac{1}{x \ln a}
xnx^nconstant exponent (power rule, not here)nxn1n x^{n-1}

The exe^x and lnx\ln x rows are the Topic 2.7 rules to memorize; the axa^x and logax\log_a x rows are not separate CED rules but derived results, following from those two through the ax=exlnaa^x = e^{x \ln a} and change-of-base rewrites proved in the later sections.

The a^x versus x^n trap

2x2^x and x2x^2 are not the same kind of function. In x2x^2 the exponent is constant, so the power rule gives 2x2x. In 2x2^x the exponent is the variable, so the exponential rule gives 2xln22^x \ln 2. Reading which slot the variable sits in, base or exponent, decides everything. Writing ddx2x=x2x1\frac{d}{dx} 2^x = x \cdot 2^{x-1} applies the power rule to an exponential and is simply wrong.

Why e^x is its own derivative

Start from the limit definition of the derivative applied to f(x)=exf(x) = e^x.

ddxex=limh0ex+hexh\frac{d}{dx} e^x = \lim_{h \to 0} \frac{e^{x+h} - e^x}{h}

Use the exponent law ex+h=exehe^{x+h} = e^x \cdot e^h, then factor exe^x out of the numerator. That factor does not depend on hh, so it comes outside the limit.

=limh0ex(eh1)h=exlimh0eh1h= \lim_{h \to 0} \frac{e^x(e^h - 1)}{h} = e^x \lim_{h \to 0} \frac{e^h - 1}{h}

Everything now hinges on that last limit. The number ee is defined to be the one base for which limh0eh1h=1\lim_{h \to 0} \frac{e^h - 1}{h} = 1. For any other base the analogous limit is a different constant (it turns out to equal lna\ln a, which the axa^x section confirms). Because the base here is ee, the limit is exactly 11, and the derivative collapses to exe^x itself.

ddxex=ex\frac{d}{dx} e^x = e^x

That self-reproducing property, a function equal to its own rate of change, is why exe^x runs through exponential growth, differential equations, and Taylor series. Topic 2.7 lists it as a rule to memorize; the limit above is where the rule comes from.

Proving d/dx ln x = 1/x with inverse functions (Topic 3.3)

The natural logarithm is the inverse of exe^x: lnx\ln x and exe^x undo each other. Topic 3.3 says you can differentiate an inverse function using the chain rule together with the defining relationship, and lnx\ln x is the cleanest example. Set y=lnxy = \ln x. By the definition of the logarithm as an inverse, that is the same statement as this equation.

ey=xe^y = x

Differentiate both sides with respect to xx. The right side is just xx, whose derivative is 11. The left side is eye^y, where yy is a function of xx, so the chain rule applies: the derivative of eye^y is eye^y times dydx\frac{dy}{dx}.

eydydx=1e^y \cdot \frac{dy}{dx} = 1

Solve for dydx\frac{dy}{dx}, then replace eye^y with xx using ey=xe^y = x from the setup.

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

So ddxlnx=1x\frac{d}{dx} \ln x = \frac{1}{x}, valid for x>0x > 0, the domain of lnx\ln x. A useful extension, ddxlnx=1x\frac{d}{dx} \ln|x| = \frac{1}{x} for all x0x \ne 0, covers negative inputs and shows up whenever you antidifferentiate 1x\frac{1}{x}. This inverse-function move (write the inverse relation, differentiate implicitly, solve) is exactly the method Topic 3.3 asks you to reuse for inverse trig functions in Topic 3.4.

a^x = e^(x ln a): one rewrite handles every base

You do not need a separate rule for axa^x; you need one algebra step. Any positive number aa can be written as a=elnaa = e^{\ln a}, because ee and ln\ln are inverses. Raise both sides to the xx power and use the exponent law (eb)x=ebx(e^b)^x = e^{bx}.

ax=(elna)x=exlnaa^x = \left(e^{\ln a}\right)^x = e^{x \ln a}

Now axa^x is an exponential with base ee and inner function xlnax \ln a, so the chain rule finishes it. Because lna\ln a is a constant, the derivative of the inner function xlnax \ln a is just lna\ln a.

ddxax=ddxexlna=exlnalna=axlna\frac{d}{dx} a^x = \frac{d}{dx} e^{x \ln a} = e^{x \ln a} \cdot \ln a = a^x \ln a

This also settles the loose end from Section 2. Differentiating axa^x straight from the definition produces the factor limh0ah1h\lim_{h \to 0} \frac{a^h - 1}{h}, and the proof above shows that factor equals lna\ln a. For base ee, lne=1\ln e = 1, which is precisely why exe^x carries no extra constant.

Logarithms with other bases yield to the same trick through the change-of-base identity logax=lnxlna\log_a x = \frac{\ln x}{\ln a}. Since 1lna\frac{1}{\ln a} is a constant multiplier, differentiate using ddxlnx=1x\frac{d}{dx}\ln x = \frac{1}{x}.

ddxlogax=1lnaddxlnx=1xlna\frac{d}{dx} \log_a x = \frac{1}{\ln a} \cdot \frac{d}{dx} \ln x = \frac{1}{x \ln a}

Where students lose points

Almost every error on these derivatives is one of a handful of predictable slips.

  • Treating axa^x like a power. ddx2x\frac{d}{dx} 2^x is 2xln22^x \ln 2, not x2x1x \cdot 2^{x-1}. The exponent is the variable, so the power rule does not apply.
  • Dropping the lna\ln a factor. ddx5x=5xln5\frac{d}{dx} 5^x = 5^x \ln 5; writing just 5x5^x forgets the constant that every base other than ee carries.
  • Forgetting the chain rule inside a logarithm. ddxln(3x2+1)\frac{d}{dx} \ln(3x^2 + 1) is 13x2+16x\frac{1}{3x^2 + 1} \cdot 6x, not 13x2+1\frac{1}{3x^2 + 1}. The 1x\frac{1}{x} rule is really 1inside\frac{1}{\text{inside}} times the derivative of the inside.
  • Mixing up the two directions. The derivative of lnx\ln x is 1x\frac{1}{x}, but the antiderivative of 1x\frac{1}{x} is lnx+C\ln|x| + C; keep which way you are going straight.
  • Assuming e2xe^{2x} differentiates to e2xe^{2x}. Only exe^x is its own derivative. ddxe2x=2e2x\frac{d}{dx} e^{2x} = 2e^{2x}, because the chain rule contributes the inner derivative 22.

One-line check

After differentiating any exponential, ask whether the base was ee. If not, a ln(base)\ln(\text{base}) factor must appear. After differentiating any logarithm, ask whether the inside was more complicated than xx; if so, a chain-rule factor must appear.

Worked examples

Worked example

Separate exponential, power, and natural-exponential terms

Differentiate f(x)=3x+x3+exf(x) = 3^x + x^3 + e^x.

  1. Classify each term before touching a rule. 3x3^x is exponential (variable in the exponent, base 33), x3x^3 is a power (variable in the base, constant exponent), and exe^x is the natural exponential. Three look-alike terms, three different rules.
  2. Differentiate 3x3^x with the exponential rule: the derivative of axa^x is axlnaa^x \ln a. Here a=3a = 3, giving 3xln33^x \ln 3.
  3. Differentiate x3x^3 with the power rule: the derivative of xnx^n is nxn1n x^{n-1}. Here n=3n = 3, giving 3x23x^2.
  4. Differentiate exe^x: it is its own derivative, exe^x.
  5. Add the three results in order: f(x)=3xln3+3x2+exf'(x) = 3^x \ln 3 + 3x^2 + e^x.

f(x)=3xln3+3x2+exf'(x) = 3^x \ln 3 + 3x^2 + e^x

Worked example

A logarithm that needs the chain rule

Differentiate g(x)=ln(x2+4)g(x) = \ln(x^2 + 4).

  1. Recognize the structure: a natural log wrapped around x2+4x^2 + 4. The inside is more complicated than xx, so the 1x\frac{1}{x} rule needs a chain-rule factor. Name the inner function u=x2+4u = x^2 + 4.
  2. Apply the chain rule: if y=lnuy = \ln u, then y=1uuy' = \frac{1}{u} \cdot u'. The outer log gives 1x2+4\frac{1}{x^2 + 4}, with the inside left intact.
  3. Differentiate the inside: u=2xu' = 2x.
  4. Multiply the outer and inner pieces: g(x)=1x2+42xg'(x) = \frac{1}{x^2 + 4} \cdot 2x.
  5. Combine into a single fraction: g(x)=2xx2+4g'(x) = \frac{2x}{x^2 + 4}.

g(x)=2xx2+4g'(x) = \frac{2x}{x^2 + 4}

Worked example

Read a limit as a known derivative (Topic 2.7)

Evaluate limh02h1h\lim_{h \to 0} \frac{2^h - 1}{h}.

  1. This looks like an indeterminate 00\frac{0}{0} limit, but Topic 2.7 flags a shortcut: sometimes a limit is exactly the definition of a derivative you already know. Compare it to the derivative definition f(a)=limh0f(a+h)f(a)hf'(a) = \lim_{h \to 0} \frac{f(a+h) - f(a)}{h}.
  2. Match the pieces. If f(x)=2xf(x) = 2^x and a=0a = 0, then f(a+h)=20+h=2hf(a+h) = 2^{0+h} = 2^h and f(a)=20=1f(a) = 2^0 = 1, so f(a+h)f(a)h=2h1h\frac{f(a+h) - f(a)}{h} = \frac{2^h - 1}{h}. The limit is therefore f(0)f'(0) for f(x)=2xf(x) = 2^x.
  3. Differentiate with the exponential rule: f(x)=2xln2f'(x) = 2^x \ln 2.
  4. Evaluate at a=0a = 0: f(0)=20ln2=1ln2=ln2f'(0) = 2^0 \ln 2 = 1 \cdot \ln 2 = \ln 2.

limh02h1h=ln2\lim_{h \to 0} \frac{2^h - 1}{h} = \ln 2

Frequently asked questions

What is the derivative of 2^x?

ddx2x=2xln2\frac{d}{dx} 2^x = 2^x \ln 2. It follows the general exponential rule ddxax=axlna\frac{d}{dx} a^x = a^x \ln a with a=2a = 2. A frequent mistake is writing x2x1x \cdot 2^{x-1}, but that is the power rule, which applies only when the variable is in the base, not the exponent.

Why does a^x differentiate to a^x ln a instead of just a^x?

Only base ee gives a derivative with no extra factor, because ee is defined so that limh0eh1h=1\lim_{h \to 0} \frac{e^h - 1}{h} = 1. Rewriting ax=exlnaa^x = e^{x \ln a} and applying the chain rule produces the inner derivative lna\ln a, so ddxax=axlna\frac{d}{dx} a^x = a^x \ln a. When a=ea = e, lne=1\ln e = 1 and the factor disappears.

What is the derivative of ln(x)?

ddxlnx=1x\frac{d}{dx} \ln x = \frac{1}{x} for x>0x > 0. If the logarithm wraps a more complicated expression, say ln(x2+4)\ln(x^2 + 4), the chain rule adds the derivative of the inside: 1x2+42x\frac{1}{x^2 + 4} \cdot 2x. For negative inputs, ddxlnx=1x\frac{d}{dx} \ln|x| = \frac{1}{x} holds for all x0x \ne 0.