Visual Tools
Calculators
Tables
Mathematical Keyboard
Converters
Other Tools


Tangent Line Visualizer

How to use
  1. Pick a base function in the Base function menu at the top; its derivative is shown in the explanation. Learn more about picking a base function
  2. On the tab Tangent point x₀, drag x0x_0 to slide the point along the curve; the amber tangent follows. Learn more about dragging x₀
  3. On the tab Transform f, the sliders aa, kk, bb, hh change the curve; the tangent at the same x0x_0 follows by the chain rule. Learn more about transforming
  4. The explanation gives the tangent in point-slope and slope-intercept form, and flags critical points and points with no tangent. Learn more about the equation
  5. The switches show the base function or hide the tangent; ▶ runs a slider by itself and Reset puts back the sliders of the tab. Learn more about the switches


Tangent line
f(x)=a⋅p(b(x−h))+kf(x) = a \cdot p\big(b(x - h)\big) + k
x0=1x_0 = 1a=1a = 1k=0k = 0b=1b = 1h=0h = 0f′(x0)=2f'(x_0) = 2
Tangent line · Quadratic
y=f(x0)+f′(x0) (x−x0)\displaystyle y = f(x_0) + f'(x_0)\,(x - x_0)
General

The tangent at x0x_0 passes through (x0,f(x0))(x_0, f(x_0)) with slope f′(x0)f'(x_0), the instantaneous rate of change of ff there. Slide x0x_0 and watch the slope change sign at the highest and lowest points.

For the current setup

Base function · p(x)=x2p(x) = x^2, p′(x)=2xp'(x) = 2x

At this point · x0=1x_0 = 1, so y0=f(x0)=1y_0 = f(x_0) = 1, and the slope is m=f′(x0)=2m = f'(x_0) = 2.

Tangent line

  • Point-slope: y=1+2 (x−1)y = 1 + 2\,(x - 1)
  • Slope-intercept: y=2 x−1y = 2\,x - 1
x0=1x_0 = 1
Speed






Getting Started with the Visualizer

The tool has three parts. Across the top runs a bar with the Base function menu and the buttons for zooming, the starting view, saving a picture and full screen. On the left is the graph. On the right is the explanation, with the controls under it.

The graph shows f(x)=a⋅p(b(x−h))+kf(x) = a \cdot p(b(x - h)) + k in blue, a navy dot at the tangent point (x0,f(x0))(x_0, f(x_0)), and the tangent line through it in amber. Along the bottom, labels give x0x_0 and the slope f′(x0)f'(x_0).

The tool opens with the quadratic p(x)=x2p(x) = x^2 and x0=1x_0 = 1: the tangent y=2x−1y = 2x - 1, slope 22.

Picking a Base Function

DemoPicking a base function
Step 0 of 3
The Base function menu lists eleven functions in three groups: polynomials (identity, 2x2x, x2x^2, x3x^3), others (reciprocal, exponential, logarithm, square root, absolute value) and trigonometric (sine, cosine). Each comes with its exact derivative, which the explanation shows next to it.

Some are chosen for a lesson: a line is its own tangent everywhere, x3x^3 has a level tangent at 00 that crosses the curve, exe^x has slope equal to its height, x\sqrt{x} has a vertical tangent at 00, and ∣x∣|x| has a corner where no tangent exists.

A new function keeps x0x_0 and the slider values.

Transforming the Base Function

DemoParameters a, k, b, h
Step 0 of 3
The tab Transform f: a, k, b, h holds four sliders that turn the base function into f(x)=a⋅p(b(x−h))+kf(x) = a \cdot p(b(x - h)) + k. By the chain rule the slope becomes

f′(x)=a⋅b⋅p′(b(x−h)),f'(x) = a \cdot b \cdot p'\big(b(x - h)\big),


so aa and bb multiply every slope, hh carries the slopes sideways with the curve, and kk lifts the curve without changing any slope. The tangent at the same x0x_0 follows each change, and the explanation recomputes its equation.

Dragging x0x_0 — the Tangent Point

DemoDragging x₀
Step 0 of 2
The tab Tangent point x₀ holds one slider, x0x_0, from −10-10 to 1010. Drag it and the navy dot slides along the curve while the amber tangent turns to follow; press ▶ to let it run by itself.

Watch the slope label: it changes sign at the highest and lowest points, where the tangent is level, and grows where the curve is steep. Where the slope is not a finite number — the corner of ∣x∣|x|, the vertical tangent of x\sqrt{x} at 00, or a point outside the domain of ln⁡x\ln x — the tangent disappears, a dashed red line marks the place, and the explanation says why.

Reading the Tangent Equation

Under For the current setup, the explanation gives the point and the slope, then the tangent in two forms:

• Point-slope — y=y0+m (x−x0)y = y_0 + m\,(x - x_0), with the numbers filled in.
• Slope-intercept — y=mx+by = mx + b, the tidied form.

The signs are folded in, so a negative slope or point reads naturally. When the slope is 00, the tangent is written y=y0y = y_0, a horizontal line, and a note flags a critical point: a candidate for a maximum or minimum.

The Labels and the Switches

DemoThe base function and the Concepts tab
Step 0 of 2
Along the bottom of the graph, labels show x0x_0, aa, kk, bb, hh and the slope f′(x0)f'(x_0); a slider label turns blue once its value has moved from the start.

Under the sliders, Base function p switches on the untransformed base as a dashed gray curve, for comparison, and Tangent line hides or shows the tangent and the point. Speed sets how fast a playing slider moves, and Reset puts back the sliders of the current tab.

The Explanation and the Concepts Tab

The text on the right follows the function and the sliders: the base function and its derivative, the point and slope, the two forms of the tangent, and the notes for critical points and for points with no tangent.

Above it, the Concepts tab holds a page that does not change with the controls: what a tangent line means, how secants turn into tangents, the two forms of the equation, and the three ways a tangent can fail to exist.

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 Δx→0\Delta x \to 0 the second point slides into the first and the secant rotates into the tangent. Its slope becomes

f′(x0)=lim⁡Δx→0f(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 tool marks three failure modes with a dashed red line, and the tangent disappears:

• 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 ln⁡x\ln x has no values at x≤0x \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 tangent vanish and the explanation say why — 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 explanation assembles y=f(x0)+f′(x0)(x−x0)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=2−xy = 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 explanation: every tangent to exe^x crosses the x-axis exactly at x0−1x_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.