Pick a curve f(x) in the top panel. Slide the cursor across it and two other curves draw themselves: the middle panel plots the slope at each point — the derivative f′ — and the bottom panel plots the signed area collected so far — the integral F. Now the punchline you can watch: the slope of the area curve, at the cursor, is exactly the height of the original curve. Differentiate the accumulator and you get f back. That round trip is the Fundamental Theorem of Calculus.
The accumulator. Define the area‑so‑far function — the signed area under f from a fixed start a out to x. This is the teal curve.
Part 1 — differentiate it and f returns. Nudge x by a tiny h. The extra area is a thin sliver of width h and height ≈ f(x), so . Divide by h and let h→0: . The slope of the area curve at x is the height of the original curve at x. That is exactly the slope→height link you toggled on.
Part 2 — evaluate an integral without adding rectangles. If is any antiderivative (F′ = f), then the definite integral is just a subtraction at the endpoints: . Changing the lower limit a only adds a constant — which is why dragging a slides the whole teal curve vertically without changing its shape.
The secant slider. The middle panel really computes a symmetric secant slope . At h=1.5 you see a crude chord; at h=0.001 it is the derivative to five digits. The "check" readout F′(x) − f(x) stays within a whisker of zero — the theorem, measured live.
Nothing here is a pre‑baked plot. Each frame, for a dense grid of x, the applet evaluates f directly, the derivative as a centred secant , and the integral as a cumulative trapezoidal sum of f from the lower limit a. The three curves are therefore genuinely the same underlying array read three ways: values, finite‑difference slopes, and running sums.
The invariant F′(x) ≈ f(x) is measured on screen (the "check" readout) and was also verified offline across all presets and many x: with h=1e‑3 the maximum of |F′(x) − f(x)| stays below 1e‑2 for smooth presets, shrinking with h as expected for a centred difference. Trapezoidal F reproduces the closed‑form antiderivatives (e.g. ∫sin = 1−cos from 0, ∫x² = x³/3) to grid accuracy. Endpoints of F are pinned so F(a)=0. "Draw your own f" feeds hand‑drawn samples through the same three pipelines, so the theorem holds for arbitrary curves, not just the presets.
Part of the repo's visual‑maths lab. Siblings: Taylor series (#3, local polynomial approximation), Arc length as a rolling odometer (#6, integration as accumulated travel), Vector fields & ODE flow (#5), and Monte Carlo estimating π (#17, integration by randomness). Single file, no build step, Canvas 2D + KaTeX.