← Module 00 / Math starter kit

Lesson 00.5 · Prerequisite bridge

Change, one small step at a time

See derivatives as local slopes and integrals as accumulated contributions.

In this lesson 4 ideas
  1. Average change is a ratio
  2. Let a step shrink
  3. Several inputs, one at a time
  4. Add small contributions

Average change is a ratio

For the function f(x)=x2f(x)=x^2, moving from x=1x=1 to x=2x=2 changes the output from 1 to 4. The average change per input unit is (4−1)/(2−1)=3(4-1)/(2-1)=3. On the graph, it is the slope of the line connecting the two points: a secant line.

What if we want the rate at the starting point itself? Bring the second point closer.

Explore it yourself

Zoom in. Add up.

A derivative measures local change. An integral accumulates tiny contributions.

Preparing interactive controls…

xy0-3-2-11234
Solid red: secantDashed green: tangent

Secant = 3.00 · Tangent = 2.00 · Gap = 1.00

Making h smaller brings the two slopes together. We never divide by zero.

Let a step shrink

Starting at any xx and taking a nonzero step hh gives

f(x+h)−f(x)h=(x+h)2−x2h=2x+h.\frac{f(x+h)-f(x)}{h}=\frac{(x+h)^2-x^2}{h}=2x+h.

As hh approaches zero, the slope approaches 2x2x. We define

f′(x)=lim⁡h→0f(x+h)−f(x)h=2x.f'(x)=\lim_{h\to0}\frac{f(x+h)-f(x)}{h}=2x.

We do not substitute h=0h=0 into the fraction. We examine a limit of values with nonzero hh. At x=1x=1, the tangent slope is 2. For a small change Δx\Delta x, the output change is approximately 2Δx2\Delta x.

The approximation is local. At x=1x=1, a step of 0.10.1 predicts a change of 0.20.2; the actual change is 1.12−1=0.211.1^2-1=0.21. The missing 0.010.01 is the quadratic term.

Several inputs, one at a time

For f(x,y)=x2+3yf(x,y)=x^2+3y, a partial derivative changes one coordinate while holding the others fixed:

∂f∂x=2x,∂f∂y=3.\frac{\partial f}{\partial x}=2x,\qquad\frac{\partial f}{\partial y}=3.

At (1,2)(1,2), the first rate is 2 and the second is 3. Collecting these rates produces the gradient ∇f=(2x,3)⊤\nabla f=(2x,3)^\top. Module 5 will develop the geometry and formal rules; here the important idea is “one input direction at a time.”

Not every function has a derivative everywhere. The graph of ∣x∣|x| has a corner at zero: slopes from the left approach −1-1, while slopes from the right approach 1.

Add small contributions

Switch the experiment to Area. Divide [0,2][0,2] into intervals of width Δx=2/n\Delta x=2/n. Each rectangle uses the function value at the midpoint of its interval. Add the rectangle areas:

∑i=1nf ⁣((i−12)Δx)Δx.\sum_{i=1}^{n}f\!\left((i-\tfrac12)\Delta x\right)\Delta x.

For f(x)=x2f(x)=x^2, as the rectangles become narrower, this approaches

∫02x2 dx=[x33]02=83.\int_0^2 x^2\,dx=\left[\frac{x^3}{3}\right]_0^2=\frac83.

The integral is a limit of accumulated contributions. For a nonnegative function, it gives the area under the curve. More generally it is signed accumulation: portions below the axis contribute negatively. Integrating a speed over time gives distance; integrating a probability density over an interval gives probability.

Make a prediction

For f(x, y) = x² + 3y, what changes when computing ∂f/∂y?