Derivative as Slope Simulator — Secant & Tangent Line Interactive

Interactive calculus simulator comparing a secant line through two points with the instantaneous tangent slope at one point, across four selectable functions, with convergence and scanning animations, slope-error charts, a model-verification bench and a knowledge-check quiz.

← Mathematics in 3D Labs
About this tool — how it works & FAQOpen ▾Close ▴

About the Derivative as Slope Simulator

This simulator plots a chosen function and lets you drag a base point P and a nearby point Q, comparing the secant line through P and Q with the tangent line at P. Bring the two points together to watch the secant slope converge to the derivative — and see exactly where that limit fails to exist.

What the simulator shows

• A real-time 3D-staged view of the function curve, the base point P and nearby point Q, the secant line and rise/run triangle, and the tangent line, with home view, focus-selected-part, auto-rotate, expand and toggleable labels, and tappable components with callouts. • Four selectable functions: ½x² − 1 (quadratic), sin x, ¼x³ − x (cubic), and |x| (absolute value, with a non-differentiable corner at zero). • Two live sliders: base point x (−2 to 2) and signed point separation h (−1 to 1, where h = 0 makes the difference quotient undefined). • Play/pause, single-step and larger-step time controls, plus a playback-speed selector from 0.1x to 60x laboratory speed. • Three actions: converge (bring Q toward P), scan (move the base point along the curve), and stop. • Six live metrics: f(x), the derivative f′(x), the secant slope, the horizontal run h, the vertical rise Δf, and the absolute slope error between secant and tangent. • A Curves & measurements tab with a slope-error-versus-separation chart, a derivative-along-the-curve chart, the full model equations, and snapshot measurements. • An Experiments tab with four guided scenarios (approach the tangent, approach from the left, find a horizontal tangent, corner diagnosis), a model-verification bench of independent automated checks, and a timestamped event log with a copyable trial report. • A Learn & assess tab with four guided lessons, a two-question knowledge-check quiz, and a written scope/reference statement linking to OpenStax Calculus.

How the secant approaches the tangent

The secant line through P = (x, f(x)) and Q = (x+h, f(x+h)) has slope msec = [f(x+h) − f(x)] / h, defined whenever h ≠ 0. The derivative f′(x) is the limit of that secant slope as h tends to zero — not the result of substituting h = 0, which produces the undefined form 0/0. Positive h approaches from the right and negative h approaches from the left; at a differentiable point, both one-sided approaches converge on the same slope.

The absolute-value function makes this concrete: at x = 0 its left slope is −1 and its right slope is +1. Averaging those numbers does not manufacture a derivative — a genuine tangent requires the two one-sided limits to already agree. The simulator hides the tangent line whenever the derivative is undefined at the current base point, and the convergence animation stops at |h| = 0.001 rather than dividing by zero.

Reading the charts and running experiments

The Curves & measurements tab plots secant slope against separation h and overlays the constant tangent slope, so you can watch the gap between them close as h shrinks — or fail to close at a corner. A second chart traces f′(x) across the domain. The equations panel states P, Q, the secant-slope formula, the limit definition of f′(x), and the tangent-line equation y = f(x) + f′(x)(X − x).

The four built-in experiments walk through convergence from the right, convergence from the left, locating a horizontal tangent on sin x near π/2, and diagnosing the corner of |x| at zero by comparing its positive and negative one-sided secants. The model-verification bench in the Experiments tab re-runs independent checks — quadratic and cubic derivatives, the corner's undefined derivative, the h = 0 undefined quotient, and convergence behavior — against fresh model instances without disturbing your current trial.

Frequently asked questions

What is the difference between a secant slope and a derivative?

A secant slope is the average rate of change between two points on a curve, calculated as [f(x+h) − f(x)] / h for some nonzero separation h. The derivative f′(x) is the limit of that secant slope as h approaches zero — the instantaneous rate of change at a single point, which exists only when the left- and right-hand limits agree.

Why is the derivative of |x| undefined at zero?

The absolute value function has a corner at x = 0: its slope is −1 for every point to the left and +1 for every point to the right. Because the one-sided secant slopes disagree, there is no single limiting slope as h approaches zero from both directions, so the tangent line — and the derivative — does not exist at that corner.

Why does the simulator stop the convergence animation at h = 0.001 instead of h = 0?

At h = 0 the difference quotient becomes 0/0, which is undefined arithmetic, not a valid slope. The derivative is defined as a limiting value that the secant slope approaches, so the simulator halts just short of zero to avoid dividing by zero while still demonstrating how close the secant slope gets to the true derivative.

What does this derivative model not include?

This is an exact-function teaching model covering four selected functions — quadratic, sine, cubic and absolute value — with their exact derivatives and antiderivatives. The 3D presentation is a sampled planar graph placed in a rotatable viewer; rotating the view does not add real mathematical dimensions, and no other functions or multivariable calculus concepts are modeled.

Related tools & guides