How do you get distance from a speed graph?

Distance is the area under the speed graph. At a steady speed that area is one rectangle: speed times time. When the speed changes, slice the time into thin strips and add up a rectangle for each. More strips get closer to the exact area. That exact area is the integral, the number the rectangles close in on.

2 right-end rectangles: 240 mExact area (the integral): 320 m. Off by 80 m (25%), under.n = 2: 80 m
Rectangle total
240 m
Exact distance (the integral)
320 m
Error (how far off)
80 m
Error as a share of the distance
25%

Challenge: On the car, sprinter, or bus graph, get within 1% of the exact distance using 8 rectangles or fewer.

Play

Pick a speed graph, then add rectangles and watch the error fall. Switch between left, right, and midpoint.

Challenge: On the car, sprinter, or bus graph, get within 1% of the exact distance using 8 rectangles or fewer. The box under the picture turns green when you get it.

Stuck? Pick one of the examples from the “Try an example” menu, or press “New example.”

Understand

∫0Tv(t) dt=lim⁡n→∞∑k=1nv(tk) Δt\int_0^{T} v(t)\,dt = \lim_{n \to \infty} \sum_{k=1}^{n} v(t_k)\,\Delta t

At a steady speed, distance is speed × time. On a speed graph, that's the area of a rectangle: height times width.

When the speed changes, slice the time into nn strips of width Δt=T/n\Delta t = T/n. In each strip, pretend the speed holds steady, and use the height at the left end, the right end, or the middle. Adding the rectangles gives a Riemann sum:

∑k=1nv(tk) Δt\sum_{k=1}^{n} v(t_k)\,\Delta t

More, thinner rectangles hug the curve more closely, and the total closes in on the exact area under the curve, the integral:

∫0Tv(t) dt=lim⁡n→∞∑k=1nv(tk) Δt\int_0^{T} v(t)\,dt = \lim_{n \to \infty} \sum_{k=1}^{n} v(t_k)\,\Delta t

The small graph on the right shows the error for every number of rectangles from 1 to 50. It drops fast at first, then levels off near zero.

Use

Every input has a unit menu, so you can type values in the units you already have. Results follow your units.

Show the work

  1. Speed graphv(t) = 0.03\,t(40 - t)\ \text{m/s}
  2. Strip width\Delta t = \frac{T}{n} = \frac{40}{2} = 20\ \text{s}
  3. Add up the rectangles (height at the right-end of each strip)\sum v(t_k)\,\Delta t = 12 \times 20 = 240\ \text{m}
  4. Exact area: integrate\int_0^{40} v(t)\,dt = \tfrac{2}{3} \times 12 \times 40 = 320\ \text{m}
  5. Error240 - 320 = -80\ \text{m}\ (25\%)

Export

Export PDF

Pick a speed graph, then set the number of rectangles and where each one takes its height.

  • The exact distance comes from integrating each formula by hand, so it's exact, not another approximation.
  • The error is the rectangle total minus the exact distance, shown as a size.

For learning and estimation. Verify with applicable codes, standards, and a qualified professional before using in design, construction, or safety-critical work.

Cheat card

d=v×t(steady speed)d = v \times t \quad \text{(steady speed)}
Δt=Tn\Delta t = \frac{T}{n}
∑k=1nv(tk) Δt→∫0Tv(t) dt\sum_{k=1}^{n} v(t_k)\,\Delta t \to \int_0^{T} v(t)\,dt
SymbolMeaningUnit
v(t)v(t)speed at time tm/s
TTlength of the time spans
nnnumber of rectangles
Δt\Delta twidth of each rectangles
  • When speed is rising, left ends fall short and right ends overshoot.
  • Midpoints are usually much closer. Double the rectangles and a midpoint error drops to about a quarter.
  • On a straight-line speed graph, midpoints are exact with any number of rectangles.

Print this card

Where it’s used

  • Physics
    Displacement is the area under a velocity–time graph, and change in velocity is the area under an acceleration–time graph.
  • Mechanical
    Engineers add up flow rate × time to find the total fuel burned or water pumped.
  • Driving & Travel
    A car’s trip computer adds up speed × a tiny time step many times a second to count the distance.
  • Sports & Games
    Coaches fit a speed curve to a sprinter’s split times to see where the race is won.

Questions people ask

Which is best, left, right, or midpoint?

Usually midpoint. When the speed keeps rising, left ends fall short and right ends overshoot, and midpoints land in between. On the car graph, 8 midpoint rectangles are off by 0.46%, while 8 left-end rectangles are off by 8.4%.

Why do left and right give the same total for the bus?

The bus graph is symmetric. It starts and ends at 0, so every left-end rectangle has a mirror-image right-end one. With 8 of either, the total is 315 m, against 320 m exact.

How long does the sprinter take for 100 m?

The area under this speed curve reaches 100 m at about 9.7 s, and 103.8 m by 10 s. The curve, 11.8(1 − e^(−t/1.2)) m/s, is a common simple model of a sprint.