# Math Insight

### Applet: The derivative of a piecewise linear function

The blue line segments are the graph of a function $f(x)$ that is linear along each of a bunch of small intervals in $x$. You can change $f$ by dragging the blue points, which move the ends of line segments up and down. You can also drag the red points to move a line segment up and down without changing its slope. The derivative $f'(x)$ of the function $f(x)$ is shown by the green horizontal line segments. The derivative $f'(x)$ indicates the slope of the function $f(x)$. Since, along each small interval of $x$, the function $f(x)$ has the same slope, the derivative $f'(x)$ is constant along each of those intervals. If two adjacent line segments of $f(x)$ have two different slopes, then the derivative $f'(x)$ jumps to a new value at the point between the corresponding intervals in $x$. To test your ability to estimate the derivative from the function, you can uncheck the “show derivative” checkbox and attempt to sketch what you think the derivative is. Alternatively, you can uncheck the “show function” checkbox to test your ability to sketch the function from its derivative.

Applet file: derivative_piecewise_linear.ggb