LeoMath

Foundations of calculus

The derivative

The limit of a rate of change, and why eˣ is its own derivative.

about 9 min

Start from a problem

Problem

An object's position is x(t)x(t). Its average velocity from tt to t+Δtt+\Delta t is x(t+Δt)−x(t)Δt.\frac{x(t+\Delta t)-x(t)}{\Delta t}. But what we really want to ask is: at the instant tt, how fast is it going?

An instant has no length; at Δt=0\Delta t=0 the quotient is 00\tfrac00. Yet "instantaneous speed" clearly means something: the speedometer shows it. So we are forced to consider the limit of the average velocity as Δt→0\Delta t\to0. If that limit exists, it deserves the name instantaneous velocity: x′(t)=lim⁡Δt→0x(t+Δt)−x(t)Δt.x'(t)=\lim_{\Delta t\to0}\frac{x(t+\Delta t)-x(t)}{\Delta t}. The derivative is not a notation handed down from above; it is the only reasonable answer to the question "what is the rate of change right now?"

Observe

Play first, read later. Below are f(x)=axf(x)=a^x and its difference quotient f(x+h)−f(x)h.\frac{f(x+h)-f(x)}{h}. Drag the base aa and make the step hh small. The difference-quotient curve always looks like axa^x itself, just taller or shorter. Is there a base aa for which the two curves coincide exactly?

Interactive experimentWhy eˣ is its own derivative
ax+h−axh=ax⋅ah−1h\frac{a^{x+h}-a^{x}}{h}=a^{x}\cdot\frac{a^{h}-1}{h}
difference quotient ÷ function 0.8284
Conjecture

The difference-quotient curve is a constant multiple of axa^x; the constant ah−1h\dfrac{a^h-1}{h} depends only on aa and hh. As h→0h\to0 it tends to some number c(a)c(a) depending only on aa. c(a)c(a) increases with aa: about 0.690.69 at a=2a=2, about 1.101.10 at a=3a=3. So between 22 and 33 there should be a unique aa with c(a)=1c(a)=1. We call it ee.

First a geometric look: shrink the distance hh between two points and the secant turns into the tangent.

Interactive experimentSecant becomes tangent
Function
f(x0+h)−f(x0)h\frac{f(x_0+h)-f(x_0)}{h}secant slope -0.0275tangent slope f′(x₀) 0.5403gap 0.5678

Definition

Definition 2.1Derivative

Let ff be defined on a neighbourhood of x0x_0. If the limit f′(x0)=lim⁡h→0f(x0+h)−f(x0)hf'(x_0)=\lim_{h\to0}\frac{f(x_0+h)-f(x_0)}{h} exists, ff is differentiable at x0x_0 and f′(x0)f'(x_0) is its derivative there.

Geometrically the difference quotient is the slope of a secant and the derivative the slope of the tangent. Physically, average velocity and instantaneous velocity. The definition contains one limit and nothing else.

Definition 2.2The number e

ee is the unique positive real number with lim⁡h→0eh−1h=1\displaystyle\lim_{h\to0}\frac{e^h-1}{h}=1.

This looks engineered to make (ex)′=ex(e^x)'=e^x true, and that is exactly what it is. We now show such a number exists, is unique, and identify it.

Derivation

Proposition 2.1Derivative of a^x

For a>0a>0, ddxax=ax⋅lim⁡h→0ah−1h=axln⁡a.\frac{d}{dx}a^x=a^x\cdot\lim_{h\to0}\frac{a^h-1}{h}=a^x\ln a.

Proof

The first equality is the factorisation seen in the experiment: ax+h−ax=ax(ah−1)a^{x+h}-a^x=a^x(a^h-1).

For the second we need lim⁡h→0ah−1h=ln⁡a\lim_{h\to0}\frac{a^h-1}h=\ln a. Put u=ah−1u=a^h-1, so h=log⁡a(1+u)=ln⁡(1+u)ln⁡ah=\log_a(1+u)=\dfrac{\ln(1+u)}{\ln a} and u→0u\to0 as h→0h\to0. Then ah−1h=uln⁡aln⁡(1+u)=ln⁡a⋅1ln⁡(1+u)u→ln⁡a,\frac{a^h-1}{h}=\frac{u\ln a}{\ln(1+u)}=\ln a\cdot\frac1{\frac{\ln(1+u)}u}\to\ln a, using lim⁡u→0ln⁡(1+u)u=1\lim_{u\to0}\frac{\ln(1+u)}u=1, which is equivalent to lim⁡u→0(1+u)1/u=e\lim_{u\to0}(1+u)^{1/u}=e, the other common definition e=lim⁡n→∞(1+1n)ne=\lim_{n\to\infty}(1+\tfrac1n)^n.

So c(a)=ln⁡ac(a)=\ln a, and c(a)=1  ⟺  a=ec(a)=1\iff a=e. The "coincidence" you saw in the experiment is ln⁡e=1\ln e=1.

Basic rules and their proofs

Theorem 2.2Rules of differentiation

Let f,gf,g be differentiable at xx. Then

  1. (f+g)′=f′+g′(f+g)'=f'+g';
  2. (fg)′=f′g+fg′(fg)'=f'g+fg';
  3. if g(x)≠0g(x)\ne0, (fg)′=f′g−fg′g2\left(\dfrac fg\right)'=\dfrac{f'g-fg'}{g^2};
  4. (chain rule) if gg is differentiable at xx and ff at g(x)g(x), then (f∘g)′(x)=f′(g(x)) g′(x)(f\circ g)'(x)=f'(g(x))\,g'(x).
Proof

We prove the product rule; the method is the same add-and-subtract trick as for products of limits. f(x+h)g(x+h)−f(x)g(x)h=f(x+h)−f(x)h g(x+h)+f(x) g(x+h)−g(x)h.\frac{f(x+h)g(x+h)-f(x)g(x)}{h}=\frac{f(x+h)-f(x)}{h}\,g(x+h)+f(x)\,\frac{g(x+h)-g(x)}{h}. As h→0h\to0 the first term tends to f′(x)g(x)f'(x)g(x) (differentiability of gg implies continuity, so g(x+h)→g(x)g(x+h)\to g(x)) and the second to f(x)g′(x)f(x)g'(x).

Theorem 2.3Differentiable implies continuous

If ff is differentiable at x0x_0, then ff is continuous at x0x_0.

Proof

f(x0+h)−f(x0)=f(x0+h)−f(x0)h⋅h→f′(x0)⋅0=0f(x_0+h)-f(x_0)=\dfrac{f(x_0+h)-f(x_0)}h\cdot h\to f'(x_0)\cdot0=0.

The converse fails: ∣x∣|x| is continuous at 00 but not differentiable; the one-sided difference quotients tend to −1-1 and 11.

Common mistake

f′(x0)f'(x_0) is a number; f′(x)f'(x) is a function. In f′(x0)=lim⁡h→0f(x0+h)−f(x0)hf'(x_0)=\lim_{h\to0}\frac{f(x_0+h)-f(x_0)}h the point x0x_0 is fixed and hh is what moves. Writing "f′(x)=2xf'(x)=2x" means: for every xx, this limit was computed, and it happened to equal 2x2x.

Applications

ApplicationWhy e appears everywhere

(ex)′=ex(e^x)'=e^x says: the rate of change is proportional to the current value, with constant 1. Any process whose growth rate is proportional to its size (compound interest, populations, radioactive decay, a discharging capacitor) is solved by CektCe^{kt}. This is the first equation, y′=kyy'=ky, in What is an ODE.

ApplicationTrigonometric functions

From lim⁡x→0sin⁡xx=1\lim_{x\to0}\frac{\sin x}x=1 and lim⁡x→0cos⁡x−1x=0\lim_{x\to0}\frac{\cos x-1}x=0, sin⁡(x+h)−sin⁡xh=sin⁡x cos⁡h−1h+cos⁡x sin⁡hh→cos⁡x.\frac{\sin(x+h)-\sin x}h=\sin x\,\frac{\cos h-1}h+\cos x\,\frac{\sin h}h\to\cos x.

Remark

Observe → conjecture → define → derive → prove → apply. We did not start from "e≈2.718e\approx2.718". We first saw that a special base exists, then defined it, then proved it is the base of ln⁡\ln. A definition is the tidying-up of a conclusion, not something handed down from above.

Exercises

01
Let f(x)=x3−2xf(x)=x^3-2x. Find f′(2)f'(2).
02
Compute lim⁡h→02h−1h\displaystyle\lim_{h\to0}\frac{2^h-1}{h} to three decimals. This is the derivative of 2x2^x at x=0x=0.