Analysis

The length the derivative never sees

The Cantor function climbs from 0 to 1 with a slope of zero almost everywhere, so the formula ∫√(1 + f′²) dx says its graph has length 1 — the length of a flat line. The inscribed polygons say 2. Mix it half and half with the diagonal and the length becomes exactly the golden ratio, while the formula still reports only the part the slope can see.

Worth reading first: Which curves have a length at all · The length belongs to the journey.

Every calculus course gives the length of a graph as an integral: L=ab1+f(x)2dxL = \int_a^b \sqrt{1 + f'(x)^2}\,dx. The length belongs to the journey showed where the formula comes from — the length of a tiny piece is about dx2+dy2\sqrt{dx^2 + dy^2} — and noted that it needs a hypothesis: for a curve that is merely rectifiable, the speed “need not be defined anywhere”, and the definition by inscribed polygons is the one that always works.

There is a sharper failure, and it is more instructive, because in it nothing is undefined. The derivative exists almost everywhere, the integral exists and is easy to compute, and the answer is simply wrong — by a factor of two. The function is the staircase with no steps, the Cantor function, and the reason the formula fails is the same reason that function is strange.

The Cantor function has length 2. The graph of a singular or partly singular increasing function on the unit interval with an inscribed polygon, beside a table of inscribed lengths by stage and the value the derivative formula gives.
Fig. 1 The graph of the Cantor function c(x)c(x), with the polygon inscribed at the 32 endpoints of its stage-4 intervals; the table gives the inscribed length at every stage to 10, each measured from the function’s own values and checked against a closed form. The lengths climb to 2.0000, while the formula 1+f2dx\int\sqrt{1 + f'^2}\,dx gives 1.0000, because f=0f' = 0 at almost every point; the missing 1.0000 is the rise the derivative never sees.

A staircase whose steps have no width

The Cantor function is built alongside the Cantor set. Remove the middle third of [0,1][0, 1] and let the function be 12\tfrac12 there. Remove the middle thirds of the two pieces left and let it be 14\tfrac14 and 34\tfrac34 on them. Continue for ever. The function is constant on every removed interval, it is continuous, and it climbs from 0 to 1 — all of the climbing done on the Cantor set, which is what is left after every middle third has gone and which has total length zero.

So the derivative is zero at every point of every removed interval, and the removed intervals have total length 13+29+427+=1\tfrac13 + \tfrac29 + \tfrac{4}{27} + \cdots = 1. That total is a geometric series with ratio 23\tfrac23, summed exactly as the sum that fits in one square sums its halves: each stage removes two thirds as much as the stage before, and the removals add up to the whole interval. Nothing of positive length is left for the function to climb on, and yet it climbs by a full unit. At almost every point the slope is zero. Put that into the formula:

011+c(x)2dx=011+0dx=1.\int_0^1 \sqrt{1 + c'(x)^2}\,dx = \int_0^1 \sqrt{1 + 0}\,dx = 1.

The formula says the graph is as long as the flat line from (0,0)(0, 0) to (1,0)(1, 0). But the graph ends at (1,1)(1, 1), a point at distance 2\sqrt 2 from where it began, and no path between two points is shorter than the straight line between them. The formula’s answer is not merely inaccurate; it is impossible.

What the polygons measure

The definition of length is the supremum over inscribed polygons, and which curves have a length at all explained why that supremum is the right thing to take: refining a polygon never makes it shorter, so the lengths climb, and their limit is the length.

The Cantor function has length 2. The graph of a singular or partly singular increasing function on the unit interval with an inscribed polygon, beside a table of inscribed lengths by stage and the value the derivative formula gives.
Fig. 2 The same graph with the polygon inscribed at the four endpoints of its stage-1 intervals: a rise of a half over the first third, the flat middle third, and a rise of a half over the last third. The inscribed length is 1.53521.5352, already more than the 21.4142\sqrt2 \approx 1.4142 of the diagonal and more than the formula’s 1.

At stage one the polygon has four vertices: (0,0)(0, 0), (13,12)(\tfrac13, \tfrac12), (23,12)(\tfrac23, \tfrac12), (1,1)(1, 1). Its length is 219+14+131.5352\sqrt{\tfrac19 + \tfrac14} + \tfrac13 \approx 1.535. At stage kk it has 2k+12^{k+1} vertices, one at each end of the 2k2^k intervals that survive, and it consists of the flat pieces over the removed intervals, of total width 1(2/3)k1 - (2/3)^k, and 2k2^k slanted pieces, each of width 3k3^{-k} and rise 2k2^{-k}. So

Lk=1(23)k+1+(49)k.L_k = 1 - \left(\tfrac23\right)^k + \sqrt{1 + \left(\tfrac49\right)^k}.

The table measures every LkL_k to stage 10 directly from the vertices and matches it against this closed form. The first term climbs to 1 as the flat pieces fill the interval; the second falls to 1 as the slanted pieces become vertical. The limit is 2: all the horizontal distance and all the vertical distance, added as if the curve went across and then up — which, in the limit, is exactly what it does.

The formula saw only the first term. It integrates over the places where the function is differentiable, finds the flat pieces, and adds up their horizontal length. The vertical rise happens on the Cantor set, where the function has no finite derivative, and a set of no width contributes nothing to an integral over width. The rise is real, it is the whole of the function’s change, and it is invisible to the derivative.

Mixing in a straight line

The failure is not all-or-nothing. Blend the Cantor function with the diagonal, f=wx+(1w)c(x)f = w\,x + (1 - w)\,c(x), and the derivative is ww almost everywhere, so the formula returns 1+w2\sqrt{1 + w^2}. The polygons tell a different story.

The length of 0.5x + 0.5c(x) is 1.6180. The graph of a singular or partly singular increasing function on the unit interval with an inscribed polygon, beside a table of inscribed lengths by stage and the value the derivative formula gives.
Fig. 3 The graph of 0.5x+0.5c(x)0.5x + 0.5c(x) with its stage-4 inscribed polygon and the inscribed lengths to stage 10. The lengths climb to 1.61801.6180, the golden ratio, while the formula gives 1.11801.1180, because f=0.5f' = 0.5 at almost every point; the missing 0.50.5 is the rise the derivative never sees.

The same computation as before gives, at stage kk,

Lk=(1(23)k)1+w2+2k32k+(w3k+(1w)2k)2,L_k = \left(1 - \left(\tfrac23\right)^k\right)\sqrt{1 + w^2} + 2^k\sqrt{3^{-2k} + \bigl(w\,3^{-k} + (1 - w)\,2^{-k}\bigr)^2},

and the limit is 1+w2+(1w)\sqrt{1 + w^2} + (1 - w). At w=12w = \tfrac12 that is 52+12=1+52\tfrac{\sqrt5}{2} + \tfrac12 = \tfrac{1 + \sqrt5}{2}: the graph of (x+c(x))/2(x + c(x))/2 has length exactly the golden ratio. The formula finds 521.118\tfrac{\sqrt5}{2} \approx 1.118, the length of a straight line of slope 12\tfrac12 across the unit interval, and misses the half that the Cantor function contributes.

The golden ratio is a coincidence of the numbers, not of the phenomenon — the rectangle that eats itself has nothing to do with Cantor sets — but it makes a point memorably. A graph whose slope is 12\tfrac12 at almost every point, which rises by exactly 1 over a run of 1, has a length that is an irrational number made of two unrelated parts: the length the slope accounts for, 52\tfrac{\sqrt5}{2}, and a singular half that the slope does not.

The length of 0.75x + 0.25c(x) is 1.5000. The graph of a singular or partly singular increasing function on the unit interval with an inscribed polygon, beside a table of inscribed lengths by stage and the value the derivative formula gives.
Fig. 4 The graph of 0.75x+0.25c(x)0.75x + 0.25c(x) with its stage-3 inscribed polygon: the lengths climb to exactly 1.51.5, the formula’s 1.251.25 plus the singular quarter it misses.

At w=34w = \tfrac34 the numbers are rational: the formula gives 1+916=54\sqrt{1 + \tfrac{9}{16}} = \tfrac54, the singular part is 14\tfrac14, and the length is exactly 32\tfrac32. The polygon at stage three is already visibly almost straight, and yet a quarter of the eventual length is hidden in steps that the picture shows as barely perceptible kinks.

The length, split in two

Where the length of a partly singular graph goes. Horizontal bars for five mixtures of the Cantor function and a straight line, each split into the part of the graph's length the derivative formula recovers and the part it misses.
Fig. 5 For f=wx+(1w)c(x)f = w\,x + (1 - w)\,c(x), each bar is the graph’s length split in two: the part the formula 1+f2dx\int\sqrt{1 + f'^2}\,dx sees, 1+w2\sqrt{1 + w^2}, and the part it misses, 1w1 - w, the rise carried by the Cantor function on a set of no length. The ticks are the inscribed lengths at stage 10, measured, within 0.02 of each total. At w=1w = 1 the graph is the diagonal and nothing is missed; at w=0w = 0 it is the Cantor function and half the length is invisible to the derivative.

The bars show the general shape of the answer. Any increasing function splits, by a theorem of Lebesgue, into a part that is the integral of its derivative and a part that is singular — continuous, increasing, with derivative zero almost everywhere, like the Cantor function. The length of the graph is then

L=ab1+f(x)2dx+(the singular part’s total rise),L = \int_a^b \sqrt{1 + f'(x)^2}\,dx + (\text{the singular part's total rise}),

and the formula computes exactly the first term. For wx+(1w)c(x)w\,x + (1 - w)\,c(x) the first term is 1+w2\sqrt{1 + w^2} and the second is 1w1 - w, and the bars are the two stacked.

The singular rise is added straight, not through a square root, because on the set where it happens the graph is vertical. A tiny piece of graph over the Cantor set moves up by some amount and across by nothing, so its length is its rise. That is why the Cantor function’s graph has length 1+11 + 1: across by 1 on the flat parts, up by 1 on the set of no width, and the two never mix.

The split is also a recipe for computing the length of any increasing graph without drawing a single polygon. Find the derivative where it exists, integrate 1+f2\sqrt{1 + f'^2}, and add whatever part of the total rise the integral of ff' failed to account for. For the mixtures that missing rise is 1w1 - w, the Cantor function’s share; for a smooth function it is nothing.

The longest an increasing graph can be

There is a simple bound that makes the number 2 less surprising and more exact. Any increasing function from (0,0)(0, 0) to (1,1)(1, 1) has a graph whose every small piece moves right by some dx0dx \ge 0 and up by some dy0dy \ge 0, and a piece’s length dx2+dy2\sqrt{dx^2 + dy^2} is at least max(dx,dy)\max(dx, dy) and at most dx+dydx + dy. Adding up, the graph’s length lies between 2\sqrt 2 — the straight diagonal, where the ratio of dydy to dxdx never changes — and 1+1=21 + 1 = 2.

The Cantor function attains the maximum. Its graph is as long as any increasing graph between those two corners can be, and it achieves that by never letting dxdx and dydy happen at the same time: on the removed intervals it moves only across, on the Cantor set only up. The upper bound dx+dydx + dy is reached exactly when the two never overlap, which is the definition of a singular function in geometric form. Every singular increasing function from corner to corner has length exactly 2, however it distributes its rise over its set of no width, and every function with an absolutely continuous part has less.

The same bound explains the mixtures. For wx+(1w)c(x)w\,x + (1 - w)\,c(x), the straight part climbs with slope ww while moving across — contributing 1+w2\sqrt{1 + w^2}, less than 1+w1 + w because across and up happen together — and the Cantor part climbs by 1w1 - w while moving across by nothing, contributing its full rise. The golden ratio is what the sum of those two contributions happens to be at w=12w = \tfrac12.

Staircases in the wild

The Cantor function is not only a construction. The staircase that is flat almost everywhere finds one in the dynamics of a periodically kicked rotor: the average rotation per kick, plotted against the driving frequency, is constant on an interval around every fraction and climbs only on a set of parameters of no length. That graph is, like the Cantor function’s, as long as an increasing graph between its endpoints can be, and a formula integrating its slope would report only its horizontal extent.

Such staircases turn up wherever a system locks onto whole-number ratios — coupled pendulum clocks, the voltage steps of a superconducting junction driven by microwaves, the mode-locking of lasers — and in each of them the interesting behaviour happens on a set the derivative cannot see. The set where the climbing happens is always of the kind almost none of it left, and still uncountably many describes for the Cantor set: no length, no interval inside it, and yet enough points to carry a rise of a whole unit. A set of no length cannot be seen by an integral; a set with uncountably many points can still hold everything that matters about a function. The arc-length failure is the simplest possible symptom: a quantity that should be read off the graph is computed by a formula that looks only where the graph has a slope, and the graph does all its work elsewhere.

The hypothesis that was missing

The formula is right exactly when the singular part is zero, and that condition has a name: the function must be absolutely continuous. Informally, a function is absolutely continuous when small total widths can only produce small total rises — no amount of rise can be concentrated on a set of arbitrarily small width. The Cantor function fails as badly as possible: the Cantor set can be covered by intervals of total width as small as anyone likes, and the function rises by 1 across them.

For an absolutely continuous function the fundamental theorem of calculus holds in its strongest form — the function is the integral of its derivative — and the arc-length formula is correct. For a function that is merely continuous and increasing, only the inequality survives: the formula gives at most the length, and equals it exactly when no rise is hidden. Area is the undoing of slope states the fundamental theorem for functions nice enough that the question never arises; the Cantor function is where it arises, and where “the integral of the derivative gives back the function” first stops being true.

The formula is also discontinuous in a precise sense. Each stage’s polygon is a piecewise-linear function, which is absolutely continuous, so for each of them the formula agrees with the polygon’s length — 1.535, 1.650, 1.747 and upwards to 2. The polygons converge uniformly to the Cantor function. The formula’s values converge to 2. The formula applied to the limit gives 1. Uniform convergence of functions does not carry the derivative along, and the arc-length formula, which depends on the derivative, jumps at the limit — the same failure uniform, except on a small set examines for other properties that pointwise and uniform limits refuse to preserve.

What the table and the bars cannot show

The Cantor set is never drawn. Every figure stops at a finite stage, where the function is a staircase of 2k2^k slanted pieces and the “vertical” rise is spread over intervals of width 3k3^{-k}. The limit — a graph that is vertical on a set of no width and horizontal everywhere else — has no finite picture, and the claim that its length is 2 rests on the formula for LkL_k and its limit, not on anything seen.

The values are exact where the construction makes them exact. The vertices were computed from the Cantor function’s self-similar definition, which gives its values at the stage-kk endpoints as fractions j/2kj/2^k, and the polygon lengths agree with the closed form to nine decimal places. The finely drawn grey curve under each polygon comes from the ternary expansion of xx in floating point, and it is a drawing, not a measurement.

And the split is quoted. Lebesgue’s decomposition, and the formula for length as the formula’s integral plus the singular rise, are theorems cited here and checked on one family of functions. Other singular functions — Minkowski’s question-mark function, which is strictly increasing and still has derivative zero almost everywhere — are not drawn.

Still open: which random sums hide their rise

The Cantor function is the distribution function of a random sum: choose each ternary digit of a number to be 0 or 2 with a fair coin, and c(x)c(x) is the chance the result is at most xx. Change the construction to ±λn\sum \pm \lambda^n, with independent fair signs and a fixed ratio λ\lambda, and the distribution function is again increasing and continuous. For λ<12\lambda < \tfrac12 the possible sums form a Cantor-like set of no length, the distribution is singular, and its graph hides all its rise exactly as the Cantor function’s does.

For λ\lambda between 12\tfrac12 and 1 the sums fill an interval, and the obvious guess is that the distribution then has a density, so that the formula would be right. Erdős showed in 1939 that it is not always so: when 1/λ1/\lambda is a Pisot number — the golden ratio is the first example — the distribution is still singular, and its graph still has length equal to the formula’s value plus a hidden rise. Solomyak proved in 1995 that for almost every λ\lambda in the range the distribution does have a density.

Which λ\lambda are the exceptions is open. The reciprocals of Pisot numbers are the only ones known, and whether there are any others has been asked since the 1940s; Varjú settled it in 2019 for λ\lambda that are algebraic with no conjugates of modulus one and satisfy a condition on their height, and the general case remains. The golden ratio, which appeared above as a length, reappears here as the first number known to make a random sum hide part of its climb.

A length that lives on a set of no width

The Cantor function has a graph of length 2 and a derivative that says 1, and both are correct about what they measure. The polygons measure the whole of the curve; the formula measures the part of it that lies over places where the function has a finite slope, and the Cantor function puts all of its rise over a set where it does not.

The two measurements — polygons and formula — agree on every curve a calculus course draws, and that is exactly why the disagreement goes unnoticed. The formula was derived for curves whose pieces all have a slope, and the Cantor function is a curve most of whose change happens in pieces that do not.

When a formula is derived by adding up small pieces, ask where it looked for pieces. The arc-length formula looks at almost every point and sums what the slope says happens there; a function that does all its climbing on a set of no size climbs where the formula is not looking, and the golden-ratio graph is the same lesson with half the climbing hidden and half in plain view.

What links here

Computed from the collection, not written here: the essays that point at this one.

Reads more easily once this is understood

Essays that name this one as worth reading first.

Shares its objects with

Essays that name at least two of the same things, and that neither author linked.

Named objects

A dashed tag is an object no other essay names yet.

Arc lengthCantor setDerivativeGolden ratioIntegralLimitMeasure zero