09. Limits and the Definition of the Derivative — Inventing the Instantaneous Rate of Change
Calculus 1/5. Differentiation turns the observation that "a curve looks like a line when viewed closely enough" into mathematics. This page rigorously defines differentiation in the language of limits and explains why the second definition, "linear approximation," is more powerful.
Limits
The - definition rigorously expresses the intuition that a function "approaches" some value near a point .
How to read it: "No matter how small an error tolerance is chosen, bringing the input sufficiently close to (within ) confines the output error inside it." As a game, the opponent names and I answer with . The limit exists only if every can be answered.
Two points to note:
- Because of the condition , the value at is irrelevant to the limit. A limit may exist even when is undefined.
- Both the left limit and right limit must exist and agree for the limit to exist.
Continuity
The limit and function value coincide. This is the rigorous version of "it can be drawn without a break."
Definition 1 of the derivative — limit of a difference quotient
The fraction is the slope of the secant connecting the two points and . Taking the limit makes the secant converge to the tangent, whose slope is the derivative.
Physically, the limit of average velocity (rate of change over an interval) is instantaneous velocity (instantaneous rate of change). Three notations are commonly used.
| Notation | Name | Emphasis |
|---|---|---|
| Lagrange | Operation that maps a function to a new function | |
| Leibniz | Ratio of changes; strong for substitutions and chains | |
| Newton | Derivative with respect to time (physics) |
Definition 2 of the derivative — best linear approximation
The same content can be written differently. A function is differentiable at if and only if some number exists such that
Here is an error that approaches zero faster than , meaning . Then .
This perspective is the real definition. Differentiation is "finding the linear function that best imitates a function locally," and the derivative is the slope of that linear function. Its advantages are:
- Generalization is immediate — for a multivariable function, "one slope" becomes a "linear map (matrix)," which is the Jacobian. The difference-quotient definition does not extend directly to several variables (what should we divide by?).
- The chain rule is natural — the chain rule follows from the one sentence, "the composition of linear approximations is the product of linear approximations."
- The zeroth step of Taylor expansion — adding second-, third-, and higher-order terms to a linear approximation yields the Taylor expansion.
Differentiable ⟹ continuous (the converse is false)
Differentiability implies continuity. The proof is one line:
The converse does not hold. Counterexamples come in several grades.
- — continuous at the origin, but not differentiable because the left derivative and right derivative differ. This is the archetypal kink. ReLU in ML is exactly this situation; in practice, one subgradient value is chosen at the origin.
- — the derivative diverges at the origin because the tangent is vertical.
- Weierstrass function — there are functions that are continuous everywhere but differentiable nowhere. The intuition that "a continuous function is generally differentiable" is wrong. Sample paths of Brownian motion also have this property (with probability 1).
Basic examples — calculate directly from the definition
:
:
The final limit being 1 is the very definition of . The property of being "a function equal to its own derivative" makes special, and it is why the exponential function is a fundamental building block throughout differential equations, probability (moment-generating functions), and analysis.
A taste of numerical differentiation — why the definition should not be coded literally
Translating the definition directly into code gives the forward difference:
The error of this approximation is , while the central difference
has error (proved with Taylor expansion in Part 3). But decreasing indefinitely amplifies floating-point rounding error by , making the result worse. The trade-off between truncation error and rounding error produces an optimal (roughly in double precision), and this limitation is the fundamental reason for using automatic differentiation instead of numerical differentiation.
Summary
- A limit is an - game, and a derivative is the limit of a difference quotient.
- The better definition is the best linear approximation: . Multivariable calculus, the chain rule, and Taylor expansion all emerge from this perspective.
- Differentiable ⟹ continuous, but the converse is false—kinks (ReLU), vertical tangents, and Weierstrass functions.
- Directly numericalizing the definition hits a precision limit, which is why automatic differentiation exists.