Derivative as slope of the tangent: interactive simulation
The derivative f′(x) is the slope of the curve at a single point. You cannot measure the slope from one point, so you take a second point h away, draw the secant line through both, and let h shrink to 0.
Useful for: AP Calculus AB, AP Calculus BC, IB Math, A-level Maths, JEE Main · India (JEE / NEET / CBSE) and worldwide (AP / SAT / IB / GCSE / A-level)
Try this
Slide the point and the gap h. The purple secant line swings onto the red tangent line as h gets small, and the lower graph plots that tangent slope for every x — that curve is f′(x).
- 1
Pick f(x) = x², set x = 1.5 and h = 1.
What you should see
The secant slope is (6.25 − 2.25)/1 = 4, but the tangent slope is 2(1.5) = 3.
- 2
Keep x = 1.5 and shrink h to 0.1, then 0.01.
What you should see
The secant slope drops to 3.1, then 3.01 — closing in on f′(1.5) = 3.
- 3
Switch to x³ − 3x and move the point to x = 1 and x = −1.
What you should see
The tangent is flat and f′ = 0 there: a local minimum at x = 1 and a local maximum at x = −1.
- 4
Choose sin x and compare the lower graph with cos x.
What you should see
The slope graph is exactly cos x — at x = 0 the slope is 1, at x = π/2 it is 0.
Formulas behind it
Secant slope (average rate of change)
Derivative (limit definition)
Tangent line at x = a
Power rule
Common mistakes
- Plugging h = 0 straight into the difference quotient — that gives 0/0. You must simplify first, then take the limit.
- Writing the tangent line as y = f′(x)·x without the point: it must pass through (a, f(a)).
- Thinking f′(a) = 0 always means a maximum or minimum — x³ has a flat tangent at 0 but no turning point.
FAQ
What is the difference between a secant and a tangent line?
A secant line passes through two points on the curve and its slope is the average rate of change. The tangent line touches at one point and its slope is the instantaneous rate of change, the derivative.
How do I find the equation of a tangent line?
Find the point (a, f(a)), find the slope f′(a), then use point-slope form: y − f(a) = f′(a)(x − a).
Is this on the AP Calculus exam?
Yes. Unit 2 of AP Calculus AB/BC covers the definition of the derivative, tangent lines and the link between the graphs of f and f′.
Related simulations
All 70 simulationsWant a specific topic or simulation added?
Tell us in our feedback box which chapter or concept you want visualised next.