Tangent line — The straight line that touches f at the single point P=(c,f(c)) with the same slope as the curve at that point: slope =f′(c).
Slope of the tangent — Equal to the derivative f′(c). This is the geometric meaning of the derivative.
Point-slope form — The standard equation: y−f(c)=f′(c)(x−c), or equivalently y=f(c)+f′(c)(x−c).
Linearization — Another name for the tangent line equation written as a function: L(x)=f(c)+f′(c)(x−c). It is the best linear approximation of f near c.
Critical point — A point where f′(c)=0 (horizontal tangent) or where f′ is undefined. Candidates for local maxima and minima.
This widget uses the cubic f(x)=31x3−x, whose derivative is f′(x)=x2−1. Horizontal tangents sit at x=±1.
Getting Started
The visualizer shows the cubic f(x)=31x3−x with a draggable point c on the x-axis. P=(c,f(c)) lifts vertically from c to the curve, and the tangent line through P extends in both directions with slope f′(c).
Drag c left or right to move the point along the x-axis. The dashed drop line, the highlighted P, and the tangent line all update in real time, along with the live readouts below the canvas: c, f(c), f′(c), and the tangent slope.
For a guided walkthrough, click one of the four scenario buttons at the bottom: Positive slope, Negative slope, Local max, or Local min. Each runs a six-step animation explaining what the tangent at that c tells you about the curve.
The Reset button clears the active scenario and returns c to its default position.
Drag Mode vs Scenario Mode
Two interaction styles share the same canvas.
Free drag — Grab the c marker on the x-axis and slide it anywhere in the visible range. The tangent line pivots in real time as the slope f′(c)=c2−1 changes. This is the fastest way to feel how the tangent rotates: drag through c=−1 or c=1 and watch the tangent flatten exactly at the critical points where f′=0.
Scenario animation — Click any of the four scenario buttons to lock c to a specific value and play the six-step explanation. The full color theme of the visualizer changes to match: blue for positive slope, red for negative slope, amber for the local max, teal for the local min.
Starting a scenario interrupts dragging. Once an animation completes, you can still drag c — doing so clears the scenario tint and returns the visualizer to neutral.
Running the Four Scenarios
Positive slope sets c=−1.7, where f′(−1.7)=1.89>0. The tangent line tilts upward to the right, matching the curve's ascending behavior on the left wing of the cubic.
Negative slope sets c=0.4, where f′(0.4)=−0.84<0. The tangent line tilts downward to the right, matching the curve's descending behavior across the middle interval between the local max and local min.
Local max sets c=−1, where f′(−1)=0. The tangent line is horizontal, parallel to the x-axis. Chevron arrows on the curve show the slope flipping from positive on the left to negative on the right — the signature of a local maximum.
Local min sets c=1, where f′(1)=0. The tangent line is horizontal. Chevron arrows show the slope flipping from negative on the left to positive on the right — the signature of a local minimum.
Each scenario takes a few seconds across the six animation phases.
Following the 6-Step Animation
Each scenario plays the same six phases, labeled in a banner at the top of the canvas:
Step 1 — Identify the region near c. A shaded band highlights the interval the analysis covers.
Step 2 — Mark the point c on the x-axis. The marker animates into position from wherever it was previously.
Step 3 — Lift to the curve: P=(c,f(c)). A dashed drop line connects c on the axis to P on the curve.
Step 4 — Evaluate the slope f′(c). The Computation tab highlights the substitution f′(c)=c2−1.
Step 5 — Draw the tangent through P with slope f′(c). The tangent line extends outward from P, and a floating label shows the numerical slope value.
Step 6 — Write the tangent equation: y=f(c)+f′(c)(x−c). The Computation tab displays the equation with the numerical values substituted in.
When the animation finishes, the right-side panel switches automatically to the Meaning tab.
Using the Computation Tab
The Computation tab walks through the tangent line construction algebraically, with the active step highlighted in the scenario color.
The point of tangency — Shows the current values of c and f(c). These are the coordinates of P.
Step 1 — Slope from the derivative — Substitutes c into f′(x)=x2−1 to give the numerical slope f′(c). The colored result is the slope of the tangent.
Step 2 — Point-slope form — Plugs c, f(c), and f′(c) into the formula y−f(c)=f′(c)(x−c). The expanded slope-intercept form y=mx+b is shown directly below, with b computed from f(c)−f′(c)⋅c.
You can switch to Computation at any time during free drag — the displayed equation always reflects the current c, so it updates as you move the marker.
Using the Meaning and Theory Tabs
Meaning explains what the current tangent reveals about the curve, with a verdict card themed to the active scenario. Positive and negative slope cards describe the curve's direction at c; max and min cards highlight the horizontal tangent and the connection to Fermat's theorem. A "why" note adds context — for example, clarifying that a horizontal tangent alone is necessary but not sufficient for a maximum or minimum. The Meaning tab opens automatically when a scenario animation finishes.
Theory provides the formal background in five blocks: the definition of the tangent line and its point-slope equation, the derivative as the slope of the tangent, the tangent as the best linear approximation (linearization), horizontal tangents and critical points (including Fermat's theorem), and a worked breakdown of how the slope f′(c)=c2−1 behaves across the specific cubic used in this widget.
Switch tabs at any time without interrupting the canvas.
What is a Tangent Line?
A tangent line to a function f at x=c is the unique straight line that passes through P=(c,f(c)) and matches the curve's direction at P. "Matches the direction" is made precise by the slope: the tangent has slope equal to f′(c), the derivative of f evaluated at c.
The defining equation in point-slope form is:
y−f(c)=f′(c)(x−c)
Or equivalently:
y=f(c)+f′(c)(x−c)
This is the best linear approximation of f near c. Any other line through P would diverge from f faster as x moves away from c, because it would have the wrong slope. The tangent shares both the value and the first derivative of f at c.
For a deeper treatment with proofs and worked examples, see the tangent line theory page.
Derivative as Slope and the Point-Slope Form
The derivative f′(c) is defined geometrically as the slope of the tangent line at c. Algebraically, it is the limit of secant slopes:
f′(c)=limh→0hf(c+h)−f(c)
Each secant is a chord of f passing through (c,f(c)) and a nearby point (c+h,f(c+h)). As h shrinks toward zero, those secants rotate toward a single limiting line — the tangent at c. Its slope is f′(c).
To write the tangent equation, you only need two pieces of information: a point on the line and its slope. The point is (c,f(c)), the slope is f′(c), and point-slope form is the standard way to combine them:
y−f(c)=f′(c)(x−c)
The same line can also be written as the linearizationL(x)=f(c)+f′(c)(x−c) — a useful viewpoint for approximation and Taylor series.
Horizontal Tangents and Critical Points
When f′(c)=0, the tangent line at c is horizontal. Such a point is called a critical point of f.
Critical points are candidates for local maxima and local minima. Fermat's theorem guarantees the connection in the other direction: if f has a local extremum at an interior point c where f′ exists, then f′(c)=0. So every smooth interior extremum has a horizontal tangent.
The reverse is not automatic. A horizontal tangent alone only says that the curve is momentarily flat at c. It might be a local maximum, a local minimum, or an inflection point with a flat tangent. Examples:
f(x)=−x2 has a horizontal tangent at 0, and it is a local maximum
f(x)=x2 has a horizontal tangent at 0, and it is a local minimum
f(x)=x3 has a horizontal tangent at 0, but no extremum — 0 is an inflection point with a flat tangent
To classify a critical point, examine the sign change of f′ across c or use the second derivative test. See the critical points page for the full procedure.
Related Concepts
Derivative — The fundamental operation: rate of change of f at a point, defined as the limit of secant slopes.
Average rate of change — The slope of a secant line over an interval; the discrete cousin of f′(c).
Linearization — The tangent line viewed as a function L(x)=f(c)+f′(c)(x−c), used for approximation.
Critical points — Where f′(c)=0 or is undefined; the starting set for finding extrema.
First derivative test — Sign analysis of f′ to classify critical points as maxima, minima, or neither.
Inflection points — Points where the second derivative changes sign and the tangent crosses the curve.
Newton's method — Numerical root-finding algorithm that iteratively follows tangent lines back to the x-axis.
Taylor series — Higher-order generalization of linearization, using all derivatives at c.