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
| Prop | Type | Default | Description |
|---|---|---|---|
| title | string | by mode ("Tracing the slope of the tangent", ...) | Card title. |
| mode | string | from the props | trace (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. |
| f | string | "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] | none | Restrict f to this interval (endpoints included), e.g. [0, 1] for an endpoint example. |
| curve | string | none | Curve 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]} | none | Curve mode: x(t) and y(t) with the parameter range t (default [-3, 3]). |
| polar | string | none | Curve 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. |
| a | number | string | [number, number] | middle of the view | Starting 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". |
| h | number | 60% of the top of hRange | Secant 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. |
| tableH | number[] | none | Secant mode: h values listed in a live table of a + h, f(a + h) and the difference quotient; clicking a row moves Q there. |
| showQuotientFormula | boolean | false | Secant mode: show the difference quotient with the current numbers plugged in. |
| quotient | string | none | Secant 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. |
| showTangent | boolean | true | Secant mode: draw the tangent line at P (dashed) and the f'(a) row. |
| dx | number | 70% of the top of dxRange | Differential mode: starting dx. |
| dxRange | [number, number] | [-1, 1] | Differential mode: range of the dx slider. |
| showRatio | boolean | false | Differential mode: the row (Δy - dy)/dx, which goes to 0 with dx. |
| showRelativeError | boolean | false | Differential mode: the relative change dy/f(a) in percent (error estimation). |
| overlay | string | none | Trace mode: the claimed derivative formula in x, drawn dashed on the slope graph so the traced slopes can land on it. |
| compare | string | string[] | none | Trace mode: further functions drawn dashed with their own tangents and slope curves and slope rows (constant multiple, sum and difference rules). |
| traced | boolean | false | Trace mode: start with the whole slope graph already traced (otherwise it fills in as the point moves). |
| markHorizontal | boolean | number[] | [number, number][] | false | Mark horizontal tangents: true finds them; or list x values (explicit f), t values (parametric, polar) or [x, y] points (implicit). |
| markVertical | boolean | number[] | [number, number][] | false | Mark vertical tangents (and, on curves, points with no tangent direction): true finds them; or list x, t or [x, y] as for markHorizontal. |
| markCritical | boolean | false | Trace mode: mark the critical numbers (f' = 0 or f' does not exist) and list them. |
| markInflection | boolean | false | Trace mode: mark the inflection points (where the slope graph turns) and list them. |
| targetSlope | number | none | Trace 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. |
| showSlopeOverHeight | boolean | false | Trace mode: the row f'(x)/f(x) (constant ln b for b^x). |
| showSlopeFormula | string | none | Curve 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)". |
| showTangentEquation | boolean | false | Show the equation of the tangent line at the point. |
| showGradient | boolean | false | Curve mode, implicit curves: draw the gradient of F at the point (perpendicular to the tangent) with its value. |
| showBranch | boolean | false | Curve 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. |
| editable | boolean | false | Let 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 formulas | Axis 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 ranges | Horizontal view. |
| yRange | [number, number] | auto | Vertical view of the curve. |
| slopeRange | [number, number] | auto | Trace mode: vertical view of the slope graph. |
| equalAspect | boolean | true for implicit and polar curves | Curve 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. |
| presetLabel | string | "Main example" | Dropdown label of the main example when presets are given. |
| controls | string[] | all controls shown | Ids of the hideable controls to show (see the controls registry); core ones always show. Absent = everything. Fitted per page by tooling, not by hand. |
PreviousNext