On the tab Tangent point x₀, drag x0 to slide the point along the curve; the amber tangent follows. Learn more about dragging x₀
On the tab Transform f, the sliders a, k, b, h change the curve; the tangent at the same x0 follows by the chain rule. Learn more about transforming
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
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))+k
x0=1a=1k=0b=1h=0f′(x0)=2
Tangent line · Quadratic
y=f(x0)+f′(x0)(x−x0)
General
The tangent at x0 passes through (x0,f(x0)) with slope f′(x0), the instantaneous rate of change of f there. Slide x0 and watch the slope change sign at the highest and lowest points.
For the current setup
Base function · p(x)=x2, p′(x)=2x
At this point · x0=1, so y0=f(x0)=1, and the slope is m=f′(x0)=2.
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))+k in blue, a navy dot at the tangent point (x0,f(x0)), and the tangent line through it in amber. Along the bottom, labels give x0 and the slope f′(x0).
The tool opens with the quadratic p(x)=x2 and x0=1: the tangent y=2x−1, slope 2.
Picking a Base Function
DemoPicking a base function
Step 0 of 3
The Base function menu lists eleven functions in three groups: polynomials (identity, 2x, x2, x3), 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, x3 has a level tangent at 0 that crosses the curve, ex has slope equal to its height, x has a vertical tangent at 0, and ∣x∣ has a corner where no tangent exists.
A new function keeps x0 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))+k. By the chain rule the slope becomes
f′(x)=a⋅b⋅p′(b(x−h)),
so a and b multiply every slope, h carries the slopes sideways with the curve, and k lifts the curve without changing any slope. The tangent at the same x0 follows each change, and the explanation recomputes its equation.
Dragging x0 — the Tangent Point
DemoDragging x₀
Step 0 of 2
The tab Tangent point x₀ holds one slider, x0, from −10 to 10. 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∣, the vertical tangent of x at 0, or a point outside the domain of lnx — 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), with the numbers filled in. • Slope-intercept — y=mx+b, the tidied form.
The signs are folded in, so a negative slope or point reads naturally. When the slope is 0, the tangent is written y=y0, 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 x0, a, k, b, h and the slope f′(x0); 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 derivativef′(x0).
The tangent emerges as the limit of secant lines. Pick two points on the curve, (x0,f(x0)) and (x0+Δx,f(x0+Δx)). The line through them has slope
Δxf(x0+Δx)−f(x0)
As Δx→0 the second point slides into the first and the secant rotates into the tangent. Its slope becomes
f′(x0)=Δx→0limΔxf(x0+Δx)−f(x0)
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 x0.
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∣ at x=0 has a sharp V; the slope jumps from −1 to +1 with no single line that fits both sides. The left and right derivatives exist but disagree. • Vertical tangents — the square root function x at x=0 has a tangent whose slope is infinite. A vertical line cannot be written in the form y=mx+b, so the equation forms break down even though the geometric line exists. • Outside the domain — the logarithm lnx has no values at x≤0, so there is no curve there to be tangent to. The reciprocal 1/x similarly has no value at x=0.
In all three cases the derivative does not exist at the affected point. Sliding x0 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=x is its own tangent everywhere: slope 1 at every point, so the tangent construction returns the function itself.
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 x0 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 line f(x)=2x has derivative 2 everywhere — a constant slope read directly off the function, no limit needed.
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 x0 and nothing about the line changes — only the marked point slides.
The pair of line families anchors the derivative scale: slope 1 and slope 2, 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)=2x, so the slope at the frozen x0=1.5 is exactly 3.
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 x0 crosses the x-axis exactly at x0/2, halfway to the origin — a fact worth verifying with the draggable point.
The explanation assembles y=f(x0)+f′(x0)(x−x0) live; the quadratic is the cleanest place to watch each ingredient move.
Tangent to the Cubic
The cubic's derivative 3x2 is never negative — every tangent points weakly uphill, even through the flat moment at the origin.
x³, tangent at x₀ = 1
Slope 3x₀² = 3 — and never negative anywhere: every cubic tangent points weakly uphill.
The frozen x0=1 gives slope 3. 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), the derivative of an odd function being even.
Tangent to the Reciprocal
Every tangent to 1/x points downhill: f′(x)=−1/x2 is negative on both branches, steepening without bound near the wall at x=0.
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=1 the slope is exactly −1, and the tangent y=2−x encloses a triangle with the axes of area 2 — remarkably, the same area for every choice of x0, 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 atx=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), so the tangent's slope always equals the curve's height.
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=1: height e, slope e. 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 ex crosses the x-axis exactly at x0−1, one unit to the left of the tangent point, at every position. The subtangent has constant length 1.
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/x, steep against the wall, nearly horizontal far out.
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=2 the slope is 21. Drag toward zero and the tangent rears toward vertical as 1/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) crosses the y-axis at ln(x0)−1, one unit below the tangent point's height.
Only positive x0 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)=2x1 — but the interesting drama is at the start of the curve.
√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=4: height 2, slope 41. Drag the point toward zero and the tangent tilts up and up, approaching vertical — infinite slope at the endpoint. The tangent at x=0 exists geometrically (the y-axis itself) but not as a y=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∣ is just a line in disguise: slope +1 on the right arm, −1 on the left, the tangent coinciding with whichever arm holds the point.
|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=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 to −1 with nothing in between.
At x=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), the slope at every point read off the other wave.
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=0 shows the most celebrated tangent in trigonometry: slope cos(0)=1, giving the line y=x — the small-angle approximation sin(x)≈x drawn as geometry.
Drag to the crest at π/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] 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) — downhill through the first half period, uphill through the second.
cos(x), tangent at x₀ = π/2
Caught at its steepest descent: slope −sin(π/2) = −1 as the wave crosses zero.
The frozen x0=π/2 catches cosine at its descent through zero: slope −sin(π/2)=−1, the steepest the wave ever gets. At the crests (x=0, 2π) 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.
Related Concepts and Tools
Derivative — the function f′(x) whose value at any x equals the slope of the tangent at that point. The tangent line at x0 is the geometric realization of f′(x0).
Secant Line — the line through two distinct points on the curve; the tangent emerges as the secant's limit as the two points merge.
Critical Points — points where the derivative is zero or undefined; candidates for local maxima, minima, and saddle points.
Differentiability — the property of having a well-defined derivative at a point. The visualizer's three "tangent undefined" cases are the three standard failures.
Linear Approximation — using the tangent line as a substitute for the function near x0, the basis of Newton's method and Taylor series.
Tangent Line Calculator — the tangent line's equation for any function you type, not only the base functions here.
Function Transformations — the companion visualizer for a, k, b, h alone, without the tangent overlay.
Functions Families Gallery — companion gallery of the same base functions seen here, useful as a prerequisite for understanding what each family looks like before studying its tangents.