Average rate of change — the slope of the line through two points on a function's graph, measuring how much the output changes per unit of input across an interval.
Secant line — the straight line that passes through two distinct points on a curve. Its slope equals the average rate of change between those points.
Δx — the change in the input, computed as x2−x1.
Δy — the change in the output, computed as f(x2)−f(x1).
Derivative — the instantaneous rate of change at a single point, defined as the limit of the average rate of change as Δx→0.
Local maximum / minimum — an interior point where the function reaches a peak or valley relative to nearby values.
Getting Started with the Visualizer
The visualizer shows the cubic function f(x)=31x3−x together with two sample points labeled P1 and P2. The straight line connecting them is the secant line, and its slope is the average rate of change between the two points.
The interface is split into two parts. The left panel holds the graph, four scenario buttons, and a row of numeric readouts. The right panel is a tabbed sidebar with three views: Computation, Meaning, and Theory.
There are two ways to drive the tool:
DragP1 or P2 along the curve to place them anywhere you like. The slope, Δx, and Δy all update in real time.
Pick a scenario to play a guided animation that moves the points into a textbook configuration and walks through every measurement step by step.
Use dragging to explore freely; use scenarios to learn what each configuration is telling you.
Choosing Among the Four Scenarios
Four buttons sit below the graph, each tied to a color theme and a short narrated animation.
Ascending (blue) — places both points on the left wing where the curve is climbing. The secant slope comes out positive.
Descending (red) — places the points on either side of the middle interval where the curve is falling. The slope is negative.
Local max (amber) — straddles the peak at x=−1. The animation continues with two extra tighten steps that bring the points together symmetrically, shrinking the slope toward zero.
Local min (teal) — does the same around the valley at x=1, with the slope approaching zero from the other side.
Click Reset to clear the scenario and return P1 and P2 to their default positions for free dragging. While an animation is running, dragging is temporarily disabled so the scripted sequence can play out without interference.
Ascending: a Positive Average Rate
The Ascending scenario puts P1 at x=−2.05 and P2 at x=−1.35, both on the left wing where the cubic is climbing. The two coordinates are f(−2.05)=−0.8217 and f(−1.35)=0.5299, so
A positive average rate, and the chevrons along the shaded band all point uphill to confirm it.
Ascending, frozen at the end of the run
Both points on the rising left wing, Δx = 0.70 and Δy = 1.35, so the secant slope is +1.93. Every chevron in the shaded band points the same way the secant does.
The number 1.93 is not the derivative at any particular point — it is the *average* over the whole interval. Compare it with the two endpoint derivatives, f′(−2.05)=3.20 and f′(−1.35)=0.82: the average sits between them, as the mean value theorem promises it must.
That is the honest reading of any secant slope. It reports the net change per unit of x across the interval and says nothing about what happened inside. Shrink the interval and the average converges on a single instantaneous rate, which is the move traced in from secant slope to derivative.
Descending: a Negative Average Rate
The Descending scenario straddles the middle interval symmetrically, P1 at x=−0.55 and P2 at x=0.55. Because f is an odd function the two heights are exact opposites, f(−0.55)=0.4945 and f(0.55)=−0.4945, so
The chevrons run downhill through the whole band, matching the sign.
Descending, frozen at the end of the run
A symmetric interval about the origin: Δy = -0.99 over Δx = 1.10 gives -0.90. The band covers (-1, 1), where the derivative is negative at every single point.
On (−1,1) the derivative f′(x)=x2−1 is negative everywhere, so every secant drawn inside that interval comes out negative too. There is no way to pick two points in this band and get a rising average.
This scenario also gives the cleanest view of the symmetric case: over [−a,a] the average rate is exactly rac{a^2}{3} - 1. At a=0.55 that is −0.90, the value on screen; as a shrinks the reading climbs toward −1, which is f′(0).
Closing In on the Local Maximum
The Local max scenario starts wide, with P1 at −1.45 and P2 at −0.55 straddling the peak at x=−1, then plays two extra tighten steps that pull the points inward symmetrically. The slope readout collapses as it goes:
[−1.45,−0.55] — slope 0.0675
[−1.25,−0.75] — slope 0.0208
[−1.08,−0.92] — slope 0.0021
The frozen picture below is the last of the three, where the two points sit almost on top of each other and the secant has flattened to nearly horizontal.
Local max, frozen after both tighten steps
The final pair, [-1.08, -0.92]. The points have closed to within 0.16 of each other and the secant has flattened to m = 0.00 - the limit being f′(-1) = 0.
Each tightening cuts the slope by roughly a factor of ten, and the limit is f′(−1)=0. That is the derivative being constructed in front of you: not defined at a point out of nowhere, but reached as the limit of averages over ever-shorter intervals.
The chevrons explain why the slope has to vanish. They point uphill to the left of −1 and downhill to the right, so a symmetric interval collects a rise and a matching fall that very nearly cancel. What is left over is second-order small, which is why the numbers fall so much faster than the interval width does.
Closing In on the Local Minimum
The Local min scenario is the same procedure around the valley at x=1: start at [0.55,1.45], then tighten to [0.75,1.25] and [0.92,1.08].
Because f is odd and the intervals are mirror images, the slopes are identical to the maximum case — 0.0675, then 0.0208, then 0.0021 — heading for f′(1)=0.
Local min, frozen after both tighten steps
The mirror image at [0.92, 1.08], with the same flattened secant. The chevrons reverse: down on the approach, up on the way out.
The chevrons are the part that differs. Here they point downhill on the approach and uphill on the way out, so the sign change runs negative → positive. That ordering is the whole difference between a valley and a peak; the vanishing slope on its own cannot tell them apart, as Fermat's theorem makes precise.
Both extrema also demonstrate the limitation of a single secant reading. A slope of 0.0021 would look like "barely rising" if you did not know where the points were, when in fact the curve falls and then rises across the interval. Average rates hide everything that happens between their endpoints.
Reading the Computation Tab
The Computation tab breaks the slope calculation into three highlighted sections that light up as the animation reaches them.
The two points — shows the coordinates (x1,f(x1)) and (x2,f(x2)) for the current positions of P1 and P2.
Step 1 — horizontal and vertical change — computes Δx=x2−x1 and Δy=f(x2)−f(x1) with the actual numbers substituted in.
Step 2 — average rate of change — divides Δy by Δx to produce the secant slope m=Δy/Δx.
Each formula box dims while its quantity has not yet been revealed in the animation, so the panel mirrors the geometry on the canvas. Drag the points freely and all three blocks recalculate continuously, giving a live numeric companion to the visual.
Reading the Meaning and Theory Tabs
The Meaning tab opens automatically once an animation finishes. It shows a colored verdict card that names the configuration — ascending, descending, local maximum, or local minimum — and explains what the sign of the slope says about the function on that interval. A second card underneath gives the deeper reason: why the sign tells you about monotonicity, or why a zero slope at a peak is necessary but not sufficient on its own.
The Theory tab is always available and holds four reference blocks:
Definition — the formal limit definition of the derivative.
Sign and monotonicity — the connection between the sign of f′ and whether the function is increasing or decreasing.
Fermat's theorem — why smooth local extrema force f′(c)=0.
On this function — what each of these statements looks like for the specific cubic shown.
Use Meaning for interpretation of the current scenario; use Theory for the underlying rules that apply to any differentiable function.
Tips for Exploring the Curve
A few patterns are worth trying once you have the controls in hand.
Sweep through the interval — keep P1 at a fixed position and slide P2 across the curve. Watch the slope readout flip sign as P2 crosses the local max and local min.
Shrink the interval manually — place P1 and P2 very close to each other near x=−1. The slope approaches zero, mirroring what the tighten animation does automatically.
Compare equal intervals — put both points on the left wing, then on the right wing. Both readings are positive, but the magnitudes differ because the curve steepens away from the origin.
Cross the inflection — straddle x=0 symmetrically. Over [−a,a] the average rate works out to rac{a^2}{3} - 1, so it is always negative and climbs toward −1 as the interval shrinks. The Descending scenario uses a=0.55 and reads −0.90.
The bottom-of-graph readouts and the formulas in the Computation tab stay synchronized, so any drag is immediately reflected in the arithmetic.
Free drag, frozen at the default pair
No scenario running: P1 at x = -1.40 and P2 at x = -0.40, the positions Reset returns to. The secant reads m = -0.11 - very slightly falling, because the interval straddles the peak unevenly.
What is the Average Rate of Change?
The average rate of change of a function f over an interval [x1,x2] is the slope of the secant line joining the points (x1,f(x1)) and (x2,f(x2)). It measures, on average, how many units the output gains or loses for each unit gained in the input.
The formula is:
Average rate of change=x2−x1f(x2)−f(x1)=ΔxΔy
Geometrically, this is rise over run — exactly the slope formula from algebra applied to two points selected on the curve. It is the discrete, interval-based counterpart of the derivative, which deals with an infinitesimal interval.
For deeper coverage of slopes, see the slope theory page, and for the move from intervals to instants, see the derivative as a limit page.
From Secant Slope to Derivative
Holding P1 fixed at a point c and sliding P2 toward it makes the interval Δx shrink. The secant line connecting the two points rotates as it shrinks, and in the limit it becomes the tangent line at c. The slope of that tangent line is the value of the derivative f′(c).
The formal statement is the limit definition of the derivative:
f′(c)=Δx→0limΔxf(c+Δx)−f(c)
So the derivative is the average rate of change over a vanishing interval — an instantaneous rate. The Local max and Local min scenarios visualize this collapse directly: the slope readout falls toward zero as the two points squeeze together around the extremum.
For the full treatment see the derivative theory page and the limit definition page.
Sign of the Derivative and Monotonicity
On any interval where f is differentiable, the sign of f′ controls whether f is increasing or decreasing.
f′(x)>0 for every x in the interval, then f is strictly increasing there.
f′(x)<0 for every x in the interval, then f is strictly decreasing there.
For the cubic in the visualizer, f′(x)=x2−1. This is positive when ∣x∣>1 and negative when ∣x∣<1, which is exactly what the Ascending and Descending scenarios are showcasing: the left and right wings climb, and the middle section falls.
This connection is the practical engine of curve sketching — the sign chart of f′ tells you the monotonicity intervals of f. For the rigorous statement and proof, see the monotonicity theorem page.
Local Extrema and Fermat's Theorem
Fermat's theorem states that if f has a local maximum or local minimum at an interior point c and f′(c) exists, then f′(c)=0. Points where the derivative is zero or undefined are called critical points.
The intuition matches what the Local max and Local min scenarios animate: just before a peak the function is rising, just after it the function is falling, and a continuous slope must pass through zero in between. The same argument with the signs reversed applies to a valley.
A zero derivative on its own does not guarantee an extremum — it only certifies a horizontal tangent. To confirm a maximum or minimum, check that f′ actually changes sign at c (the first derivative test) or that f′′(c) has the right sign (the second derivative test).
For deeper coverage, see the critical points page and the extrema classification page.
Related Concepts and Tools
Related concepts:
Slope formula — the algebraic origin of the average rate of change.
Derivative — the limit of the average rate of change as the interval shrinks to a single point.
Tangent line — the limiting position of the secant line as the two points coincide.
Monotonicity — the property of being increasing or decreasing, controlled by the sign of f′.
Critical points — points where the derivative is zero or undefined, the candidates for local extrema.
Mean value theorem — guarantees that on a closed interval the derivative somewhere equals the average rate of change.
Related tools:
Function derivative visualizer — explore the derivative as a function in its own right.
Tangent line visualizer — see the tangent line rotate as the point of tangency moves.
Limit visualizer — watch a quantity approach a limit from both sides.