Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Tangent Line Visualizer


Quadraticf(x) = (x)²
×
880 × 500
Tangent point
x₀ = 1
-1010
Tangent lineslope m = 2
y = 2·(x − 1) + 1point-slope
y = 2x − 1slope-intercept
Applieda=1k=0b=1h=0x₀=1y₀=1m=2
Show







Getting Started with the Visualizer

Open the page and three panels appear. On the left is the function picker with ten base function families. In the center sits the plot panel, with the chosen function f(x)f(x) drawn in blue and its tangent line at the chosen point drawn in amber. On the right is the info panel with two tabs — a live explanation of the current state and a general theory tab about tangents.

Below the plot, the centerpiece of the tool is the tangent point card: an amber-bordered block containing the x0x_0 slider, the current values of x0x_0, y0y_0, and slope mm, and the tangent equation written in both point-slope and slope-intercept forms.

The page launches with the quadratic family and x0=1x_0 = 1. Drag the x0x_0 slider and the tangent line slides along the curve in real time, the equations recalculate, and the info panel updates with the new slope and intercept.

Picking a Base Function

The picker on the left lists ten base functions, with sine and cosine grouped under "Trigonometric". Each entry shows a small shape glyph and the family name:

• Polynomial: Identity (xx), Linear (2x), Quadratic (x2x^2), Cubic (x3x^3)
• Algebraic: Reciprocal (1/x1/x), Square root (x\sqrt{x}), Absolute (x|x|)
• Transcendental: Exponential (exe^x), Logarithmic (lnx\ln x)
• Trigonometric: Sine, Cosine

Click any entry to switch. The transformation parameters aa, kk, bb, hh reset to defaults and x0x_0 returns to its default value, so you always start each family from a clean slate. The picker covers the most pedagogically important functions for studying derivatives — including deliberately tricky ones (absolute value's corner, square root's vertical tangent) that demonstrate when the tangent fails to exist.

Transforming the Base Function

Below the function picker, four sliders apply the standard affine transformations to the chosen base f(x)f(x):

aavertical scale (stretches, compresses, or reflects across the xx-axis)
kkvertical shift
bbhorizontal scale
hhhorizontal shift

The transformed function is g(x)=af(b(xh))+kg(x) = a \cdot f(b(x - h)) + k. Its derivative — and therefore the slope mm of the tangent at any x0x_0 — follows the chain rule: g(x)=abf(b(xh))g'(x) = a \cdot b \cdot f'(b(x - h)).

Transformations are most useful here for two reasons. First, they let you keep the same function family while moving features around — drag the parabola's vertex to wherever you want it, then study tangents near that vertex. Second, they let you build a function whose tangent at the default x0=1x_0 = 1 is something specific you want to see.

Dragging x0x_0 — the Tangent Point

The x0x_0 slider lives at the top of the tangent point card below the plot, and it is the tool's primary interaction. Drag it to move the point of tangency along the curve from 10-10 to +10+10.

As you drag, four things change at once in real time:

• The point of tangency slides along the blue curve
• The amber tangent line pivots to match the new slope
• The tangent equations rewrite themselves with the new x0x_0, y0y_0, and mm
• The info panel's "Explanation" tab updates with the new numerical values

A green "critical point" badge appears next to the function name whenever the slope mm is effectively zero — flagging local extrema as you sweep across them. A red "tangent undefined" badge appears whenever x0x_0 lands at a corner, vertical tangent, or outside the function's domain.

Reading the Tangent Equation Card

The lower half of the tangent point card displays the tangent line in two equivalent forms:

Point-slope:y=m(xx0)+y0\text{Point-slope:} \quad y = m(x - x_0) + y_0


Slope-intercept:y=mx+(y0mx0)\text{Slope-intercept:} \quad y = mx + (y_0 - m \cdot x_0)


Both forms are computed automatically from the current x0x_0, y0y_0, and mm. Point-slope form makes the connection to the derivative obvious: this is the line through (x0,y0)(x_0, y_0) with slope f(x0)f'(x_0). Slope-intercept form is what you would simplify to in a homework problem and what graphing software typically expects.

The slope mm appears in the card header, and special cases are handled cleanly. When m=0m = 0, both forms collapse to y=y0y = y_0 — the horizontal tangent at a critical point. When x0=0x_0 = 0, the parenthesized (xx0)(x - x_0) in point-slope form simplifies to just xx.

The Applied Chip Strip and Visibility Toggles

Below the tangent equation card sit two horizontal strips.

The Applied strip shows seven chips: four for the transformation parameters aa, kk, bb, hh, and three for the tangent-specific values x0x_0, y0y_0, mm. Active (non-default) parameters glow blue; the tangent values are color-coded amber for the xx-axis quantities and blue for y0y_0. The chip strip is a scannable summary of the entire current state — useful for screenshots, classroom display, and step-back verification when sliders have been dragged far from defaults.

The Show strip below has two toggle buttons, one each for the function ff and the tangent line. Click a button to hide that curve from the plot. Hiding ff leaves the tangent line alone in the plot window, useful for verifying that the equation in the card is in fact the line drawn. Hiding the tangent leaves only the function, useful for cleanly observing where you want to place x0x_0 next.

The Info Panel

The side info panel has two tabs:

Explanation — reads the current state. Shows the symbolic forms of f(x)f(x) and f(x)f'(x), the numerical values of x0x_0, y0y_0, mm, and the yy-intercept of the tangent, and renders the tangent equation in both forms. When x0x_0 is at a critical point (m0m \approx 0), an extra note explains that this is a candidate for a local extremum. When the tangent is undefined, a different note explains why and suggests sliding x0x_0 to a smooth part of the curve.

Concepts — general theory of tangent lines independent of the current state. Covers the secant-to-tangent limit definition, the relationship between the slope of the tangent and the derivative, the two equivalent forms of the equation, and the three ways the tangent can fail to exist (corners, vertical tangents, points outside the domain).

The Explanation tab is the right place to look when you want to know *what is happening right now*; the Concepts tab is the right place for *why it works that way in general*.

What the Tangent Line Is

At any smooth point on a curve, the tangent line is the unique straight line that touches the curve at that point and matches its direction. Its slope is the function's instantaneous rate of change at that point — the derivative f(x0)f'(x_0).

The tangent emerges as the limit of secant lines. Pick two points on the curve, (x0,f(x0))(x_0, f(x_0)) and (x0+Δx,f(x0+Δx))(x_0 + \Delta x, f(x_0 + \Delta x)). The line through them has slope

f(x0+Δx)f(x0)Δx\frac{f(x_0 + \Delta x) - f(x_0)}{\Delta x}


As Δx0\Delta x \to 0 the second point slides into the first and the secant rotates into the tangent. Its slope becomes

f(x0)=limΔx0f(x0+Δx)f(x0)Δxf'(x_0) = \lim_{\Delta x \to 0} \frac{f(x_0 + \Delta x) - f(x_0)}{\Delta x}


This is the definition of the derivative. Every tangent line you see in the visualizer is the geometric realization of this limit at the chosen x0x_0.

When the Tangent Fails to Exist

Not every point on every curve has a tangent. The visualizer flags three failure modes with a red "tangent undefined" badge:

Corners — the absolute value function x|x| at x=0x = 0 has a sharp V; the slope jumps from 1-1 to +1+1 with no single line that fits both sides. The left and right derivatives exist but disagree.
Vertical tangents — the square root function x\sqrt{x} at x=0x = 0 has a tangent whose slope is infinite. A vertical line cannot be written in the form y=mx+by = mx + b, so the equation forms break down even though the geometric line exists.
Outside the domain — the logarithm lnx\ln x has no values at x0x \leq 0, so there is no curve there to be tangent to. The reciprocal 1/x1/x similarly has no value at x=0x = 0.

In all three cases the derivative does not exist at the affected point. Sliding x0x_0 across one of these points lets you watch the badge appear and the equation card reset — a concrete tour of the differentiability failures discussed in introductory calculus.

Tangent to the Identity

The line y=xy = x is its own tangent everywhere: slope 11 at every point, so the tangent construction returns the function itself.
-10-5510-55f(x) = x · x₀ = 2
y = x, tangent at x₀ = 2

The dashed amber tangent lies exactly on the blue line: a line is its own best linear approximation, everywhere.

The frozen scene dashes the amber tangent so the coincidence stays visible — it lies exactly on the blue line, whatever x0x_0 you drag to. A constant derivative means one tangent serves all points.

Self-tangency is the degenerate case that calibrates all the others: the tangent line is the *best linear approximation*, and a line's best linear approximation is itself, error zero everywhere.

The scaled linear function repeats the story at slope 22; the first genuinely moving tangent belongs to the quadratic.

Tangent to the Scaled Linear

The line f(x)=2xf(x) = 2x has derivative 22 everywhere — a constant slope read directly off the function, no limit needed.
-10-5510-55f(x) = 2x · x₀ = 1
y = 2x, tangent at x₀ = 1

Constant slope 2: one tangent serves every point, coinciding with the curve itself.

As with the identity, the tangent coincides with the curve at every point; the dashed amber overlay is the only way to see it at all. Drag x0x_0 and nothing about the line changes — only the marked point slides.

The pair of line families anchors the derivative scale: slope 11 and slope 22, the two reference speeds against which every curved tangent below can be compared.

Tangent to the Quadratic

The parabola is where the tangent starts to move: f(x)=2xf'(x) = 2x, so the slope at the frozen x0=1.5x_0 = 1.5 is exactly 33.
-10-5510-55f(x) = x² · x₀ = 1.5
x², tangent at x₀ = 1.5

Slope 2x₀ = 3 at the frozen point; drag left and the tangent tilts down through the horizontal rest at the vertex.

Drag the point and watch the slope track twice its position: negative on the left arm, zero at the vertex, positive on the right. The vertex is the tangent's resting place — the horizontal tangent that marks every smooth extremum.

The parabola also keeps a geometric secret: the tangent at x0x_0 crosses the x-axis exactly at x0/2x_0/2, halfway to the origin — a fact worth verifying with the draggable point.

The tangent equation card assembles y=f(x0)+f(x0)(xx0)y = f(x_0) + f'(x_0)(x - x_0) live; the quadratic is the cleanest place to watch each ingredient move.

Tangent to the Cubic

The cubic's derivative 3x23x^2 is never negative — every tangent points weakly uphill, even through the flat moment at the origin.
-10-5510-55f(x) = x³ · x₀ = 1
x³, tangent at x₀ = 1

Slope 3x₀² = 3 — and never negative anywhere: every cubic tangent points weakly uphill.

The frozen x0=1x_0 = 1 gives slope 33. Drag toward zero and the tangent flattens into the horizontal — but unlike the parabola's vertex, this is not an extremum: the curve pauses and continues upward. A horizontal tangent marks a critical point; only the surrounding slopes decide what kind.

That distinction — extremum versus inflection with zero slope — is the classic first-derivative-test lesson, and the cubic is its canonical exhibit.

Symmetric positions give equal slopes: f(x0)=f(x0)f'(-x_0) = f'(x_0), the derivative of an odd function being even.

Tangent to the Reciprocal

Every tangent to 1/x1/x points downhill: f(x)=1/x2f'(x) = -1/x^2 is negative on both branches, steepening without bound near the wall at x=0x = 0.
-10-5510-55f(x) = 1/x · x₀ = 1
1/x, tangent at x₀ = 1

Slope −1 at (1, 1); the tangent and the axes enclose a triangle of area 2 — the same area from every tangent point.

At the frozen x0=1x_0 = 1 the slope is exactly 1-1, and the tangent y=2xy = 2 - x encloses a triangle with the axes of area 22 — remarkably, the *same* area for every choice of x0x_0, one of the reciprocal's classic invariants.

Approach the singularity and the tangent tilts toward vertical while sliding off to infinity; there is no tangent *at* x=0x = 0 because there is no point there at all — the domain hole, not a differentiability failure.

Tangent to the Exponential

The exponential's defining property becomes visible geometry: f(x)=ex=f(x)f'(x) = e^x = f(x), so the tangent's slope always equals the curve's height.
-10-5510-55f(x) = eˣ · x₀ = 1
eˣ, tangent at x₀ = 1

Height e, slope e: the tangent’s steepness equals the curve’s value at every point.

At the frozen x0=1x_0 = 1: height ee, slope ee. Drag anywhere and the equality holds — the only function (up to scaling) whose steepness is its own value.

A consequence worth checking with the equation card: every tangent to exe^x crosses the x-axis exactly at x01x_0 - 1, one unit to the left of the tangent point, at every position. The subtangent has constant length 11.

Its inverse partner the logarithm flips the relationship: slope equal to the reciprocal of position.

Tangent to the Logarithm

The logarithm's tangent flattens as it climbs: f(x)=1/xf'(x) = 1/x, steep against the wall, nearly horizontal far out.
-10-5510-55f(x) = ln(x) · x₀ = 2
ln(x), tangent at x₀ = 2

Slope 1/x₀ = ½: gentle out here, rearing toward vertical as the point approaches the wall at zero.

At the frozen x0=2x_0 = 2 the slope is 12\tfrac{1}{2}. Drag toward zero and the tangent rears toward vertical as 1/x1/x blows up — the graphical version of the logarithm's unbounded steepness at its domain edge.

The mirror fact to the exponential's constant subtangent: every tangent to ln(x)\ln(x) crosses the y-axis at ln(x0)1\ln(x_0) - 1, one unit below the tangent point's height.

Only positive x0x_0 is available — the slider simply cannot cross into territory where the function does not exist.

Tangent to the Square Root

The square root's tangents flatten with distance — f(x)=12xf'(x) = \tfrac{1}{2\sqrt{x}} — but the interesting drama is at the start of the curve.
-10-5510-55f(x) = √x · x₀ = 4
√x, tangent at x₀ = 4

Slope ¼ at (4, 2) — and an endpoint drama off-screen left: the tangent turns vertical at x = 0.

At the frozen x0=4x_0 = 4: height 22, slope 14\tfrac{1}{4}. Drag the point toward zero and the tangent tilts up and up, approaching vertical — infinite slope at the endpoint. The tangent at x=0x = 0 exists geometrically (the y-axis itself) but not as a y=mx+by = mx + b equation, which is why the tool reports it as undefined.

This is one of the two failure modes cataloged in When the Tangent Fails to Exist: a vertical tangent — direction defined, slope not.

Everywhere else the root behaves: half the reciprocal of its own height, the chain rule's first classic exercise.

Tangent to the Absolute Value

Away from the corner, x|x| is just a line in disguise: slope +1+1 on the right arm, 1-1 on the left, the tangent coinciding with whichever arm holds the point.
-10-5510-55f(x) = |x| · x₀ = 2
|x|, tangent at x₀ = 2

The dashed tangent coincides with the right arm; at the corner itself, no single line fits and the tangent fails.

The frozen x0=2x_0 = 2 shows the coincidence — the dashed amber tangent lies along the right arm exactly, as on the identity. Drag across to negative territory and the tangent snaps to the other arm; slope jumps from +1+1 to 1-1 with nothing in between.

At x=0x = 0 itself there is no tangent at all: the left and right slopes disagree, so no single line fits. This is the corner failure mode — the second entry in When the Tangent Fails to Exist, and the standard first example of continuity without differentiability.

Tangent to Sine

Sine's tangents cycle with the wave itself: f(x)=cos(x)f'(x) = \cos(x), the slope at every point read off the *other* wave.
-10-5510-55f(x) = sin(x) · x₀ = 0
sin(x), tangent at x₀ = 0

Slope cos(0) = 1: the tangent is y = x — the small-angle approximation drawn as geometry.

The frozen x0=0x_0 = 0 shows the most celebrated tangent in trigonometry: slope cos(0)=1\cos(0) = 1, giving the line y=xy = x — the small-angle approximation sin(x)x\sin(x) \approx x drawn as geometry.

Drag to the crest at π/2\pi/2 and the tangent goes horizontal; every peak and trough of the wave is a resting point. Between them the slope oscillates through the full [1,1][-1, 1] range, peaking exactly at the zero crossings.

Cosine tells the same story a quarter period out of phase — with a sign flip in its derivative.

Tangent to Cosine

Cosine's slopes are sine's values negated: f(x)=sin(x)f'(x) = -\sin(x) — downhill through the first half period, uphill through the second.
-10-5510-55f(x) = cos(x) · x₀ = π/2
cos(x), tangent at x₀ = π/2

Caught at its steepest descent: slope −sin(π/2) = −1 as the wave crosses zero.

The frozen x0=π/2x_0 = \pi/2 catches cosine at its descent through zero: slope sin(π/2)=1-\sin(\pi/2) = -1, the steepest the wave ever gets. At the crests (x=0x = 0, 2π2\pi) the tangent rests horizontal.

The derivative pair closes into a cycle — sine to cosine to negative sine to negative cosine and back — which the tangent point makes tactile: four drags of a quarter period each return the slope pattern to its start.

Together with sine, this pair is the reason simple harmonic motion never escapes trigonometry.