Tangent Slope Tracer

A point rides a curve with its tangent line. The learner drags it to trace the slope graph point by point until it lands on the claimed derivative, pivots a secant through a + h into the tangent (it never settles at a corner), compares the increment Δy with the differential dy as dx shrinks, or rides an implicit, parametric or polar curve whose slope dy/dx exists even where y is not a function of x.

Used in: Mathematical Analysis, Single Variable Calculus

Props

PropTypeDefaultDescription
titlestringby mode ("Tracing the slope of the tangent", ...)Card title.
modestringfrom the propstrace (slope graph built point by point), secant (P and Q = a + h), differential (Δy against dy) or curve (implicit, parametric or polar curve). Without it: curve when curve/parametric/polar is given, differential when dx/dxRange/showRatio/showRelativeError is, secant when h/hRange/tableH/quotient/showQuotientFormula is, else trace.
fstring"x^2"The function y = f(x) (trace, secant, differential). A leading "y =" is ignored. Supports + - * / ^, implicit multiplication, |u|, comparisons (1 or 0), if(cond, a, b) for piecewise functions, sin cos tan sec csc cot and inverses (asin, arctan, ...), sinh cosh tanh sech csch coth and inverses, sqrt cbrt exp ln log (natural) log10 log2 abs sign floor ceil min max, pi, e, and the parameter names. Odd roots of negatives are real (x^(1/3)).
domain[number | string, number | string]noneRestrict f to this interval (endpoints included), e.g. [0, 1] for an endpoint example.
curvestringnoneCurve mode: an implicit equation in x and y, e.g. "x^2 + y^2 = 25" or "x^3 + y^3 = 6*x*y". Also accepts "param2d:x=..,y=..,tmin=..,tmax=.." for a parametric curve.
parametric{x: string, y: string, t?: [number | string, number | string]}noneCurve mode: x(t) and y(t) with the parameter range t (default [-3, 3]).
polarstringnoneCurve mode: r as a function of theta, e.g. "1 + cos(theta)" ("r =" is ignored).
thetaRange[number | string, number | string][0, 2*pi]Range of theta for a polar curve.
anumber | string | [number, number]middle of the viewStarting position of the point: x (trace, secant, differential), the parameter t or theta (parametric, polar), or [x, y] near the implicit curve (projected onto it). Strings may be expressions such as "pi/6".
hnumber60% of the top of hRangeSecant mode: starting increment; Q sits at a + h.
hRange[number, number][-2, 2] (or ±max |tableH|)Secant mode: range of the signed h slider and of dragging Q.
tableHnumber[]noneSecant mode: h values listed in a live table of a + h, f(a + h) and the difference quotient; clicking a row moves Q there.
showQuotientFormulabooleanfalseSecant mode: show the difference quotient with the current numbers plugged in.
quotientstringnoneSecant mode: the simplified difference quotient as an expression in h (e.g. "12 + 6*h + h^2" for x^3 at a = 2), shown with its value at the current h and at h = 0. P is then fixed at a.
showTangentbooleantrueSecant mode: draw the tangent line at P (dashed) and the f'(a) row.
dxnumber70% of the top of dxRangeDifferential mode: starting dx.
dxRange[number, number][-1, 1]Differential mode: range of the dx slider.
showRatiobooleanfalseDifferential mode: the row (Δy - dy)/dx, which goes to 0 with dx.
showRelativeErrorbooleanfalseDifferential mode: the relative change dy/f(a) in percent (error estimation).
overlaystringnoneTrace mode: the claimed derivative formula in x, drawn dashed on the slope graph so the traced slopes can land on it.
comparestring | string[]noneTrace mode: further functions drawn dashed with their own tangents and slope curves and slope rows (constant multiple, sum and difference rules).
tracedbooleanfalseTrace mode: start with the whole slope graph already traced (otherwise it fills in as the point moves).
markHorizontalboolean | number[] | [number, number][]falseMark horizontal tangents: true finds them; or list x values (explicit f), t values (parametric, polar) or [x, y] points (implicit).
markVerticalboolean | number[] | [number, number][]falseMark vertical tangents (and, on curves, points with no tangent direction): true finds them; or list x, t or [x, y] as for markHorizontal.
markCriticalbooleanfalseTrace mode: mark the critical numbers (f' = 0 or f' does not exist) and list them.
markInflectionbooleanfalseTrace mode: mark the inflection points (where the slope graph turns) and list them.
targetSlopenumbernoneTrace mode: a slider for a slope m; every point where the tangent has slope m is marked with its tangent, and y = m is drawn on the slope graph.
targetSlopeRange[number, number][-10, 10]Range of the target-slope slider.
showSlopeOverHeightbooleanfalseTrace mode: the row f'(x)/f(x) (constant ln b for b^x).
showSlopeFormulastringnoneCurve mode: the closed form of dy/dx, in x and y (implicit) or t (parametric), shown with its value at the point, e.g. "(y - x^2)/(y^2 - x)".
showTangentEquationbooleanfalseShow the equation of the tangent line at the point.
showGradientbooleanfalseCurve mode, implicit curves: draw the gradient of F at the point (perpendicular to the tangent) with its value.
showBranchbooleanfalseCurve mode, implicit curves: highlight the arc through the point that is the graph of a function y = g(x) (up to the vertical tangents) and give its x-interval.
editablebooleanfalseLet the learner type their own f (e.g. a candidate antiderivative to check against the overlay).
parameters{name, min, max, initial?, step?, label?}[][]Named parameters with sliders, usable in f, overlay, compare, curves and ranges. x, y, h, t, theta, e and pi are reserved.
labels{x?, y?, f?, slope?, secant?, tangent?, overlay?, trace?: string}$x$, $y$, from the formulasAxis titles (x, y), the curve's legend name (f), the secant-slope row (slope, e.g. "average velocity"), legend names of the secant and tangent lines, the overlay's legend name and the slope graph's label (trace, e.g. "$f''(x)$"). $...$ is TeX.
xRange[number, number]from a and the rangesHorizontal view.
yRange[number, number]autoVertical view of the curve.
slopeRange[number, number]autoTrace mode: vertical view of the slope graph.
equalAspectbooleantrue for implicit and polar curvesCurve mode: one unit is as long on both axes (circles look round).
presets{label, ...props}[][]Further examples in a dropdown. A preset that sets f, curve, parametric or polar drops the function-specific props of the main example (overlay, compare, quotient, domain, showSlopeFormula, listed marks); other props are inherited.
presetLabelstring"Main example"Dropdown label of the main example when presets are given.
controlsstring[]all controls shownIds of the hideable controls to show (see the controls registry); core ones always show. Absent = everything. Fitted per page by tooling, not by hand.