III.13 · Calculus
How fast does accumulated area grow?
Let the upper limit of an integral move. The accumulated quantity becomes a function, and its rate of change at x is the height of the integrand at x — wherever that height is continuous.
Watch accumulated area change at the rate f(x)
f(t) = 0.25x³ − x with the accumulated area from a to x
f(t) = 0.25x³ − x. Green: area above the axis between a = −2 and x = 1; gold: area below (subtracted). The orange strip from x to x + Δx has signed area ΔF = −0.37109375, close to f(x)·Δx = −0.375.
Accumulated quantity F(x) = ∫ₐˣ f(t) dt
F starts at 0 at x = a = −2 and accumulates signed area. At x = 1, F = 0.5625; its slope there is −0.75, equal to f(x).
- Lower limit (F(a) = 0)
- −2
- Upper limit
- 1
- Accumulated signed area
- 0.5625
- Integrand at x
- −0.75
- Change over [x, x + Δx]
- −0.37109375
- Rectangle estimate
- −0.375
- Average of f over the strip
- −0.7421875
- Slope of F (derived from its exact pieces)
- −0.75
Exact values use =; binary64 approximations use ≈. Undefined values state their reason.
The strip from x to x + Δx adds ΔF = −0.37109375, close to f(x)·Δx = −0.375. As Δx → 0 the ratio ΔF/Δx tends to f(x) = −0.75: F′(x) = f(x).
Start the accumulator at a
F(a) = ∫ from a to a = 0 by definition.
from −3 to 3, up to 2 decimal places
from −3 to 3, up to 2 decimal places
from −1 to 1, up to 2 decimal places
Start at with : the accumulated signed area is . The orange strip adds — negative, because is below the axis there — almost exactly . On the right, the slope of at is , the height of . Now choose Jump in f: has a corner, and no single slope exists at the jump.
Intuition: the accumulator’s speedometer
Imagine a tank that fills at rate (negative means draining). The amount in the tank since time is . How fast is the amount changing at time ? Exactly at the current rate, . Integration accumulates a rate; differentiation recovers it.
Definition
For integrable on an interval containing , the accumulation function is
Fundamental theorem (first form). If is continuous at , then is differentiable at and .
Second form. If is any antiderivative of a continuous (), then .
Mechanics: what the explorer computes
The integrands are piecewise polynomials, so is computed exactly as a piecewise polynomial that is continuous by construction. The strip’s area is exact, as is the rectangle estimate . The slope row is not copied over: it is the derivative of ‘s own exact pieces, including one-sided slopes at piece boundaries. Agreement with is what the theorem predicts — and the jump preset shows where that agreement fails.
Derivation: why F′ = f
For ,
the average of over the strip. If is continuous at , every value of on a short enough strip is within any chosen tolerance of , so the average is too. Letting (from either side) gives . If jumps at , the averages from the left and right approach the two different one-sided values of , and has a corner.
Worked example
Take and . Then
so , and . At , changes from negative to positive, and has a local minimum; at it changes from positive to negative and has a local maximum . With at , while .
Replay the worked derivation
Start the accumulator at a
F(a) = ∫ from a to a = 0 by definition.
Sign changes, moving limits and jumps
- Where , increases; where , it decreases; where changes sign, has a local extremum.
- Moving shifts by a constant (). The slope does not depend on .
- With , : the accumulation runs backward.
- For a jump in , is still continuous but has a corner; the first form of the theorem needs continuity at .
Executable reference code
The reference builds exactly with Fraction antiderivatives and checks against for shrinking . The NumPy version accumulates a sampled with the cumulative trapezoid rule and differentiates the result numerically, recovering up to discretisation error.
"""The accumulation function F(x) = integral from a to x of f, built exactly; F'(x) = f(x) (III.13)."""
from fractions import Fraction as F
f = lambda t: t**3 / 4 - t
P = lambda t: t**4 / 16 - t**2 / 2 # an antiderivative of f
a = F(-2)
Fx = lambda x: P(x) - P(a) # F(a) = 0 by construction
assert (Fx(a), Fx(F(1)), Fx(F(2)), Fx(F(0))) == (0, F(9, 16), 0, 1)
# A thin strip adds nearly f(x)*h; the ratio tends to f(x) as h shrinks.
x = F(1)
gaps = [abs((Fx(x + h) - Fx(x)) / h - f(x)) for h in (F(1, 2**k) for k in range(4, 14))] # small h: gap ~ |f'(x)| h/2
assert all(b < a_ for a_, b in zip(gaps, gaps[1:]))
assert Fx(x + F(1, 2)) - Fx(x) == F(-95, 256)
# A jump in f gives a corner in F: one-sided slopes 1 and -1 at t = 1.
step_F = lambda x: x if x < 1 else 2 - x # integral from 0 of (1 for t < 1, -1 for t >= 1)
h = F(1, 1000)
assert (step_F(F(1)) - step_F(1 - h)) / h == 1 and (step_F(1 + h) - step_F(F(1))) / h == -1"""Cumulative trapezoid accumulation of a sampled f, then numerical differentiation recovers f (III.13)."""
import numpy as np
t = np.linspace(-2, 3, 2001)
f = t**3 / 4 - t
F = np.concatenate([[0.0], np.cumsum((f[1:] + f[:-1]) / 2 * np.diff(t))]) # F(-2) = 0
exact = t**4 / 16 - t**2 / 2 + 1
assert np.max(np.abs(F - exact)) < 1e-5
recovered = np.gradient(F, t)
assert np.max(np.abs(recovered[1:-1] - f[1:-1])) < 1e-4Explore
Find the maximum and minimum of by dragging to the zeros of . Move and watch the whole curve shift vertically while its tangent at keeps the same slope. On the jump preset, set negative to see the left slope.
Common mistakes
Confusing (an accumulated amount) with (a rate). Thinking the lower limit affects . Applying at a discontinuity of . Forgetting that areas below the axis make decrease.
Numerical considerations
Cumulative numerical integration followed by numerical differentiation recovers only approximately: discretisation error from the first step and the step-size trade-off of III.14 in the second. Working with exact antiderivatives, when they exist, avoids both.
Engineering and ML connections
Cumulative quantities are everywhere: position from velocity, charge from current, a cumulative distribution function from a density, whose derivative recovers the density (IV.8). Prefix sums in computing are the discrete accumulation function, and their differences recover the original sequence.
Exercises
Summary and checkpoints
The accumulation function grows at the rate : wherever is continuous. Changing shifts by a constant; a jump in makes a corner in . Next, III.14 turns to computing derivatives numerically, where finite precision shapes the answer.