Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Tangent Line


Local view · f(x) = ⅓x³ − x

f′(x) = x² − 1 · max at x = −1 · min at x = 1
Drag c on the x-axis, or pick a scenario.
c =-0.50
f(c) =0.46
f′(c) =-0.75
slope of tangent =-0.75
f(x)tangentdrop







Key Terms

Tangent line — The straight line that touches ff at the single point P=(c,f(c))P = (c, f(c)) with the same slope as the curve at that point: slope =f(c)= f'(c).

Slope of the tangent — Equal to the derivative f(c)f'(c). This is the geometric meaning of the derivative.

Point-slope form — The standard equation: yf(c)=f(c)(xc)y - f(c) = f'(c)(x - c), or equivalently y=f(c)+f(c)(xc)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)(xc)L(x) = f(c) + f'(c)(x - c). It is the best linear approximation of ff near cc.

Critical point — A point where f(c)=0f'(c) = 0 (horizontal tangent) or where ff' is undefined. Candidates for local maxima and minima.

This widget uses the cubic f(x)=13x3xf(x) = \frac{1}{3}x^3 - x, whose derivative is f(x)=x21f'(x) = x^2 - 1. Horizontal tangents sit at x=±1x = \pm 1.

Getting Started

The visualizer shows the cubic f(x)=13x3xf(x) = \frac{1}{3}x^3 - x with a draggable point cc on the x-axis. P=(c,f(c))P = (c, f(c)) lifts vertically from cc to the curve, and the tangent line through PP extends in both directions with slope f(c)f'(c).

Drag cc left or right to move the point along the x-axis. The dashed drop line, the highlighted PP, and the tangent line all update in real time, along with the live readouts below the canvas: cc, f(c)f(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 cc tells you about the curve.

The Reset button clears the active scenario and returns cc to its default position.

Drag Mode vs Scenario Mode

Two interaction styles share the same canvas.

Free drag — Grab the cc 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)=c21f'(c) = c^2 - 1 changes. This is the fastest way to feel how the tangent rotates: drag through c=1c = -1 or c=1c = 1 and watch the tangent flatten exactly at the critical points where f=0f' = 0.

Scenario animation — Click any of the four scenario buttons to lock cc 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 cc — doing so clears the scenario tint and returns the visualizer to neutral.
-2-112-110xycP = (c, f(c))slope = -0.75
Free drag, frozen at c = -0.5

No scenario is running - this is the widget at its default point of tangency. P sits at (-0.5, 0.46) and the slope readout gives f′(-0.5) = -0.75, so the tangent already leans downhill. Drag c anywhere and this same picture redraws with a new slope.


Running the Four Scenarios

Positive slope sets c=1.7c = -1.7, where f(1.7)=1.89>0f'(-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.4c = 0.4, where f(0.4)=0.84<0f'(0.4) = -0.84 < 0. The tangent line tilts downward to the right, matching the curve&apos;s descending behavior across the middle interval between the local max and local min.

Local max sets c=1c = -1, where f(1)=0f'(-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=1c = 1, where f(1)=0f'(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.

Positive Slope: the Tangent Rises

The Positive slope scenario locks c=1.7c = -1.7, out on the left wing of the cubic. The slope there is f(1.7)=(1.7)21=1.89f'(-1.7) = (-1.7)^2 - 1 = 1.89, a positive number, so the tangent line tilts upward as you read it left to right.

The shaded band covers the interval the scenario is talking about — the stretch left of the local maximum, where the curve is climbing. A tangent drawn at any cc inside that band leans the same way, because f(x)=x21f'(x) = x^2 - 1 stays positive for every x<1x < -1.
-2-112-110xycP = (c, f(c))slope = 1.89
Positive slope, frozen at c = -1.7

The tangent through P = (-1.7, 0.06) carries slope 1.89. Curve and line both climb to the right, and inside the shaded band every other tangent would climb as well.

The general statement behind the picture: f(c)>0f'(c) > 0 means ff is increasing at cc. The tangent makes that visible, because the sign of the slope of a line is exactly the direction it travels.

Notice how far apart the tangent and the curve drift near the edges of the canvas. The agreement between them is local — they share the point PP and the slope at PP, and nothing beyond that is promised. The cubic bends away; the line cannot.

Reverse the sign and you get the negative slope case, where the same reasoning runs downhill.

Negative Slope: the Tangent Falls

The Negative slope scenario locks c=0.4c = 0.4, inside the middle interval between the two extrema. The slope is f(0.4)=0.421=0.84f'(0.4) = 0.4^2 - 1 = -0.84, a negative number, so the tangent line tilts downward to the right.

The shaded band here runs from 1-1 to 11 — exactly the interval where x2<1x^2 < 1, and therefore where f(x)=x21f'(x) = x^2 - 1 is negative. This is the descending stretch of the cubic, the run from the local maximum down to the local minimum.
-2-112-110xycP = (c, f(c))slope = -0.84
Negative slope, frozen at c = 0.4

The tangent through P = (0.4, -0.38) carries slope -0.84. The band spans (-1, 1), the whole interval on which the cubic descends from its peak to its valley.

The mirror of the previous case: f(c)<0f'(c) < 0 means ff is decreasing at cc. Nothing about the argument changes except the sign.

The two bands together account for all of the curve&apos;s direction. Outside [1,1][-1, 1] the slope is positive and the curve rises; inside, the slope is negative and it falls. The boundaries between those regimes are the two points where the slope passes through zero — the local maximum and the local minimum.

Horizontal Tangent at the Local Maximum

The Local max scenario locks c=1c = -1, the left boundary between the rising and falling regions. The slope is f(1)=(1)21=0f'(-1) = (-1)^2 - 1 = 0, so the tangent line is horizontal — perfectly parallel to the x-axis.

Chevron arrows appear along the curve on both sides of cc. To the left they point uphill, to the right they point downhill. That flip from positive to negative slope across cc is the signature of a local maximum, and the flat tangent sits exactly at the turning point.
-2-112-110xycP = (c, f(c))slope = 0.00
Local maximum, frozen at c = -1

Slope 0: the tangent is a horizontal line through P = (-1, 0.67), the peak of the curve. The chevrons point uphill on the left and downhill on the right - the sign change that confirms a maximum.

The direction that always holds is Fermat&apos;s theorem: if ff has a local extremum at an interior point cc and f(c)f'(c) exists, then f(c)=0f'(c) = 0. A smooth peak forces a horizontal tangent.

The converse fails, which is why the panel calls the flat tangent necessary but not sufficient. A horizontal tangent only says the curve is momentarily flat; f(x)=x3f(x) = x^3 has one at the origin and no extremum there at all. What certifies the maximum is the sign change of ff' — positive before cc, negative after — and that is precisely what the chevrons draw. The same test applied in the other order classifies the local minimum, and the full procedure is set out under horizontal tangents and critical points.

Horizontal Tangent at the Local Minimum

The Local min scenario locks c=1c = 1, the right boundary of the descending interval. Again f(1)=121=0f'(1) = 1^2 - 1 = 0, so the tangent is horizontal.

The chevrons run the other way this time: downhill on the left of cc, uphill on the right. The slope changes from negative to positive, which is the signature of a local minimum.
-2-112-110xycP = (c, f(c))slope = 0.00
Local minimum, frozen at c = 1

Slope 0 again, this time through P = (1, -0.67) at the bottom of the valley. The chevrons run downhill then uphill - the reversed sign change that confirms a minimum.

Both extrema of this cubic are found the same way: solve f(c)=0f'(c) = 0, which for f(x)=x21f'(x) = x^2 - 1 gives c=±1c = \pm 1. Those two values are the complete set of critical points, and the scenarios visit them one each.

Comparing the two flat tangents side by side is the fastest way to see that zero slope by itself carries no verdict. The tangent at c=1c = -1 and the tangent at c=1c = 1 are both horizontal lines; only the behavior of ff' around them tells the peak from the valley.

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 cc. A shaded band highlights the interval the analysis covers.

Step 2 — Mark the point cc on the x-axis. The marker animates into position from wherever it was previously.

Step 3 — Lift to the curve: P=(c,f(c))P = (c, f(c)). A dashed drop line connects cc on the axis to PP on the curve.

Step 4 — Evaluate the slope f(c)f'(c). The Computation tab highlights the substitution f(c)=c21f'(c) = c^2 - 1.

Step 5 — Draw the tangent through PP with slope f(c)f'(c). The tangent line extends outward from PP, and a floating label shows the numerical slope value.

Step 6 — Write the tangent equation: y=f(c)+f(c)(xc)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 cc and f(c)f(c). These are the coordinates of PP.

Step 1 — Slope from the derivative — Substitutes cc into f(x)=x21f'(x) = x^2 - 1 to give the numerical slope f(c)f'(c). The colored result is the slope of the tangent.

Step 2 — Point-slope form — Plugs cc, f(c)f(c), and f(c)f'(c) into the formula yf(c)=f(c)(xc)y - f(c) = f'(c)(x - c). The expanded slope-intercept form y=mx+by = mx + b is shown directly below, with bb computed from f(c)f(c)cf(c) - f'(c) \cdot c.

You can switch to Computation at any time during free drag — the displayed equation always reflects the current cc, 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&apos;s direction at cc; max and min cards highlight the horizontal tangent and the connection to Fermat&apos;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&apos;s theorem), and a worked breakdown of how the slope f(c)=c21f'(c) = c^2 - 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 ff at x=cx = c is the unique straight line that passes through P=(c,f(c))P = (c, f(c)) and matches the curve&apos;s direction at PP. "Matches the direction" is made precise by the slope: the tangent has slope equal to f(c)f'(c), the derivative of ff evaluated at cc.

The defining equation in point-slope form is:

yf(c)=f(c)(xc)y - f(c) = f'(c)(x - c)

Or equivalently:

y=f(c)+f(c)(xc)y = f(c) + f'(c)(x - c)

This is the best linear approximation of ff near cc. Any other line through PP would diverge from ff faster as xx moves away from cc, because it would have the wrong slope. The tangent shares both the value and the first derivative of ff at cc.

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)f'(c) is defined geometrically as the slope of the tangent line at cc. Algebraically, it is the limit of secant slopes:

f(c)=limh0f(c+h)f(c)hf'(c) = \lim_{h \to 0} \frac{f(c+h) - f(c)}{h}

Each secant is a chord of ff passing through (c,f(c))(c, f(c)) and a nearby point (c+h,f(c+h))(c+h, f(c+h)). As hh shrinks toward zero, those secants rotate toward a single limiting line — the tangent at cc. Its slope is f(c)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))(c, f(c)), the slope is f(c)f'(c), and point-slope form is the standard way to combine them:

yf(c)=f(c)(xc)y - f(c) = f'(c)(x - c)

The same line can also be written as the linearization L(x)=f(c)+f(c)(xc)L(x) = f(c) + f'(c)(x - c) — a useful viewpoint for approximation and Taylor series.

Horizontal Tangents and Critical Points

    When f(c)=0f'(c) = 0, the tangent line at cc is horizontal. Such a point is called a critical point of ff.

    Critical points are candidates for local maxima and local minima. Fermat&apos;s theorem guarantees the connection in the other direction: if ff has a local extremum at an interior point cc where ff' exists, then f(c)=0f'(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 cc. It might be a local maximum, a local minimum, or an inflection point with a flat tangent. Examples:

  • f(x)=x2f(x) = -x^2 has a horizontal tangent at 00, and it is a local maximum
  • f(x)=x2f(x) = x^2 has a horizontal tangent at 00, and it is a local minimum
  • f(x)=x3f(x) = x^3 has a horizontal tangent at 00, but no extremum — 00 is an inflection point with a flat tangent

  • To classify a critical point, examine the sign change of ff' across cc or use the second derivative test. See the critical points page for the full procedure.