← All Labs
INTERACTIVE APPLET · CALCULUS & INTEGRATION

Arc Length as a Rolling Odometer

Roll a wheel along a curve and its trip-counter reads the arc length — the exact value of the integral \( \int_a^b \sqrt{1+f'(x)^2}\,dx \). Every tiny turn of the wheel adds a hypotenuse \( ds=\sqrt{dx^2+dy^2} \): flat stretches barely move the dial, steep climbs spin it fast. Drag the curve into hills and valleys and watch the odometer update live.

L = ∫ₐᵇ √(1 + f′(x)²) dx

Integration measures accumulated travel

Drag the orange handles to reshape the road under the wheel
p5.js · live ∫ds

DRIVE IT

the curve y = f(x) rolling wheel distance rolled (paint) straight-line span Δx ds = √(1+f′²) dx strips

THE ODOMETER

ROLLED SO FAR
0.00

CONTROLS

SHOW

PRESETS

Tip: grab any orange handle and drag it up or down. A steeper road is a longer road — the total L climbs even though the start and end never move.

WALKTHROUGH

    AHA
    The wheel can't "see" the whole curve — it only ever adds the little slanted step \( ds=\sqrt{dx^2+dy^2} \) it just rolled through. Sum those infinitely many tiny hypotenuses and you have arc length. That is all an integral is: an odometer quietly accumulating a quantity, step by step, from \(a\) to \(b\). Flatten the road and \(ds\to dx\) — the counter reads plain width. Tilt it and every strip grows by the Pythagorean factor \( \sqrt{1+f'^2} \), so the dial always turns faster than the horizontal distance alone.
    Watch the violet Δx span: it is the flat distance from start to finish. The orange L is always ≥ it, with equality only for a perfectly flat road. The gap is exactly what the steepness \(f'\) buys you.

    EXPLANATION

    Zoom in on any smooth curve until a tiny piece of it looks straight. Over a horizontal step \( dx \) the curve also rises by \( dy=f'(x)\,dx \), so the actual length of that little diagonal piece — the distance the wheel truly rolls — is the hypotenuse of a right triangle:

    \( ds=\sqrt{dx^2+dy^2}=\sqrt{1+\left(\tfrac{dy}{dx}\right)^2}\;dx=\sqrt{1+f'(x)^2}\;dx. \)

    The odometer never measures the curve all at once. It just keeps adding these micro-hypotenuses as it turns. Adding up (integrating) every \( ds \) from \( x=a \) to \( x=b \) gives the total distance travelled — the arc length:

    \( L=\int_a^b ds=\int_a^b \sqrt{1+f'(x)^2}\;dx. \)

    The factor \( \sqrt{1+f'^2} \) is the local stretch: where the road is flat, \( f'=0 \), the factor is 1 and the wheel gains one unit of trip per unit of \( x \) — the dial matches the horizontal span. Where the road is steep, \( f' \) is large and the factor blows up, so a small advance in \( x \) still spins the wheel a long way. This is why the total \( L \) is always at least the straight span \( b-a \), with equality only for a horizontal line. In the applet the green ds strips are a live Riemann sum: each strip's height is \( \sqrt{1+f'^2} \) at its midpoint, its area approximates the arc contributed by that slice, and the strips' total tracks the odometer's reading.

    Two honest subtleties worth noticing while you drag. First, arc length is an integral of a derivative: it needs the slope \( f' \) everywhere, which is why a curve with a sharp corner (try the Spike) still has finite length but its integrand \( \sqrt{1+f'^2} \) spikes where the slope jumps. Second, the number the applet prints is a genuine numerical integral — the curve is sampled into several hundred short segments and their true lengths \( \sqrt{\Delta x^2+\Delta y^2} \) are summed, so the odometer and the printed \( L \) agree to the pixel. This same "sum of little hypotenuses" idea generalizes directly: a parametric curve uses \( ds=\sqrt{\dot x^2+\dot y^2}\,dt \), and a path in space just adds a \( \dot z^2 \) under the root.

    Further reading: any single-variable calculus text on "arc length" (e.g. Stewart, Calculus, §8.1); for the parametric and vector versions see the line-integral chapter. The curve here is a Catmull–Rom spline through the six draggable handles, so it stays a smooth function of \(x\) as you reshape it.