Skip to main content

M04.2 · The derivative as slope and rate

A free, illustrated module of 4 lessons and one interactive in M04 Calculus I: Single Variable: From average rate to instantaneous rate; The tangent line and linear approximation; The derivative as a function; Derivatives by computer: finite differences.

M04.2 L1 · Core 4 lessons · about 100 min Live · in review

Part of M04 Calculus I: Single Variable in the Mathematics track.

A speedometer reads one speed at one instant, yet speed is distance over time, which needs two instants. These four lessons settle that puzzle with one picture, a secant line that turns into the tangent as its second point slides in, and then use the result four ways: as a rate with units, as the tangent line that stands in for a curve near a point, as a new function read off a graph, and as a number a computer estimates from a few values. On the way, the derivative of a loss becomes the sensitivity that every gradient step relies on.

What you need first. Limits, one-sided limits and continuity (M04.1), and the slope of a straight line (M01.3). The code uses Python functions, loops and NumPy arrays (P01), and explains each line.

Lessons

  1. From average rate to instantaneous rate M04.2.1 25 min

    A speedometer shows a speed at one instant, yet speed is distance over time, which needs two instants. See how the slope of a secant line becomes the derivative as its second point slides in, and compute it for x squared and for a moving cart.

  2. The tangent line and linear approximation M04.2.2 25 min

    Zoom in on a smooth curve and it straightens into its tangent line. Write that line from the derivative, estimate a square root with it by hand, watch its error shrink like the square of the step, and read the slope of a loss as the sensitivity behind every gradient step.

  3. The derivative as a function M04.2.3 25 min

    Take the slope at every input and you get a new function, the derivative. Derive it for x squared and 1/x, read its sign and size off a graph and sketch it, and see where it fails: at the corners of the absolute value and of ReLU, which are continuous but have no slope there.

  4. Derivatives by computer: finite differences M04.2.4 25 min

    With no formula at hand, a computer estimates a slope from a few function values. Build the forward and central differences, find their errors exactly on x cubed, watch rounding take over at tiny steps, then use numpy.gradient, scipy.differentiate and the gradient check.

The interactive

M04.2-X1 · Secant slider. Drag a second point along a curve towards a fixed point, or slide the step h: the secant turns into the tangent while its slope is printed beside the limit. Zoom in to watch a curve straighten, and try the corner of the absolute value, where the two sides never agree. It lives in From average rate to instantaneous rate.

Back to top