The derivative, visualized
The derivative measures how fast a curve is changing at a single point — its instantaneous slope. You find it by drawing a line through two nearby points (a secant) and shrinking the gap between them until the line just grazes the curve (the tangent).
This idea is the foundation of gradient descent and backpropagation, so getting an intuitive feel for it early pays off through the entire machine-learning curriculum.
Drag the point (x) and shrink the gap (h)
Function
Tangent slope = f′(x)
3
f′(x) = 2x
Secant slope (gap h)
4.5
As h → 0, this closes in on 3. That limit IS the derivative.
Free · runs entirely in your browser · nothing to install
How to use it
- Drag the point along the curve to move the tangent line with it.
- Shrink the gap between the two points and watch the secant approach the tangent.
- Read off how the slope changes as you move to steeper parts of the curve.
What you'll take away
- What 'instantaneous rate of change' really means.
- Why the derivative is a limit of secant slopes.
- The direct link to gradients used in training models.
Want to actually build this?
This demo is one moment inside a full Math to Machine lesson — predict, build, and explain the concept, with an AI tutor that gives hints, not answers. The first five lessons are free.
FAQ
- What does a derivative tell you?
- It tells you the slope of a function at a specific point — how quickly the output changes as you nudge the input. A large derivative means a steep curve; zero means a flat spot like a peak or valley.
- Why do derivatives matter in machine learning?
- Training a model means minimising an error function, and derivatives (gradients) point in the direction that reduces error. Gradient descent and backpropagation are built entirely on them.