Interactive Explainer · Calculus Toolkit
The Derivative is a Local Line
A derivative is not a formula to memorize — it is the slope of the straight line a curve becomes when you zoom in far enough. Drag the base point, collapse a secant onto the tangent, and zoom until the curve straightens. The number you land on is $f'(x_0)$.
Slope of what, exactly?
The derivative $f'(x_0)$ is defined as a limit of slopes of secant lines. Pick a nearby point a distance $h$ away, draw the line through $(x_0, f(x_0))$ and $(x_0+h,\, f(x_0+h))$, and read off its slope. Now let the second point slide in toward the first:
Two pictures of the same fact live below. The secant slider shrinks $h$ so the average slope converges to the instantaneous one. The zoom slider does it geometrically: magnify the graph around $(x_0, f(x_0))$ and any smooth curve flattens into a straight line — the tangent. That line, and its slope, is the entire content of "derivative."
Secant, tangent, zoom
Choose a curve, then drag left/right on the plot (or use the $x_0$ slider) to move the base point. Pull the $h$ slider toward $0$ and watch the orange secant swing onto the blue tangent. Then push the zoom slider and watch the curve itself straighten.
Differentiable means locally linear
Zoom into a differentiable function anywhere and it looks like a line. That is the whole reason calculus powers deep learning: near the current weights, a loss surface is well approximated by its tangent (its gradient), so we can take a confident step downhill. Formally, the tangent is the best linear approximation, with error that dies faster than $h$:
- Corners break it. Try $f(x)=|x|$ in your head at $x_0=0$: zooming never straightens the kink, and the left/right secant slopes disagree. No single tangent, no derivative — the same reason $\mathrm{ReLU}$ needs a subgradient at $0$.
- The slope is the derivative. There is nothing else in the definition: it is literally the number the secant slopes converge to.
- Backprop is this, everywhere at once. Each layer contributes its local slope; the chain rule multiplies them. Every arrow in a computation graph is a tiny version of this picture.