Index Ai Academy
Foundation · Foundation mathCalculus

Rates of change

About 41 minLooking ahead: some prerequisites aren't done yet

Why this matters

Calculus is the math of change, and it starts with a question you already answer every day: how fast? A hiker covering 7 km in 2 hours averaged 3.5 km an hour. That number, change in one thing divided by change in another, is a rate, and this whole module is built on it. Shrink the interval and you get the slope at a single point, the derivative; follow the slope downhill and you get gradient descent, which is how every model in this academy is trained. This first lesson stays with the average rate: from tables, from graphs and from formulas, then in a few lines of NumPy, and finally on a real training run, where the rate of the loss says whether learning is still happening or has stalled.

  • Compute an average rate of change, Δy/Δx, from a table, a graph or a formula
  • Read the average rate between two points as the slope of the line joining them
  • Turn a list of readings into a list of rates with np.diff, dividing by the step
  • Read a training run's loss curve: where it falls fastest, and where it has flattened
Quick check
Have a guess before you start. A hiker is 4 km along the trail after 1 hour and 10 km along after 3 hours. How fast did they walk, on average, between those times?

The math: change over change

Purpose. Turn "how fast" into a number.

A rate of change compares how much an output changed with how much its input changed. Between two points (a, f(a)) and (b, f(b)):

ΔyΔx=f(b)−f(a)b−a\frac{\Delta y}{\Delta x} = \frac{f(b) - f(a)}{b - a}

In plain words: the change in y divided by the change in x. Δ ("delta") means "change in".

For f(x) = x² between x = 1 and x = 3: (9 − 1) ÷ (3 − 1) = 4. Over that stretch, y grows 4 times as fast as x, on average.