Instant PDF download, name-and-email checkout. Complete Book Bundle: every Economics, Statistics, Mathematics, Econometrics and Research Methods book
Mathematics

The Trapezium Rule and Riemann Sums: Estimating Area Under a Curve from Data

Learn the trapezium rule and Riemann sums to estimate the area under a curve from data, with a car speed case, error checks and exam-style practice.

In 30 seconds
  • The area under a speed–time graph is the distance travelled. When you only have readings, not a formula, you estimate that area numerically.
  • A Riemann sum splits the area into rectangles (using left, right or midpoint heights). The trapezium rule joins the readings with straight lines and adds up the trapezia.
  • The trapezium rule is the average of the left and right Riemann sums, and is usually much more accurate than either.
  • In our case, speed readings every 10 seconds give a distance of about 920 m over one minute; the left and right sums bracket it at 810 m and 1,030 m.
  • Exam point: if the curve is concave up, the trapezium rule overestimates; if concave down, it underestimates. Be ready to say which and why.

The case: how far did the car travel?

A driving instructor fits a simple data logger to a training car. The logger records the car’s speed every 10 seconds but does not record distance. A learner pulls away from a junction and accelerates for one minute. The logger shows these readings:

Time \( t \) (s)0102030405060
Speed \( v \) (m/s)081418202122

The instructor wants to know how far the car went in that minute. If the speed were constant, distance would just be speed × time. But the speed changes all the time. We know that distance is the area under the speed–time graph, which is the definite integral \( \int_0^{60} v(t)\,dt \). The problem is that we have no formula for \( v(t) \), only seven numbers.

So we cannot integrate in the usual way. Instead, we estimate the area from the data. This is exactly what Riemann sums and the trapezium rule are for. The same idea works for any rate measured at intervals: rainfall in mm per hour, water flow in litres per minute, or a firm’s sales per week. (The figures are illustrative.)

The concept: estimating area with strips

The idea is to cut the area into thin vertical strips, estimate the area of each strip with a simple shape, and add them up. The narrower the strips, the better the estimate. As the strip width shrinks to zero, the sum becomes the exact integral. This is how the definite integral is defined in the first place [1].

A Riemann sum uses rectangles. Each rectangle has the strip’s width and a height taken from the function somewhere in the strip. A left Riemann sum uses the height at the left edge, a right Riemann sum the height at the right edge, and a midpoint sum the height in the middle. For a curve that is rising, the left sum underestimates (each rectangle sits below the curve) and the right sum overestimates.

The trapezium rule does better by using both edges. It joins neighbouring data points with a straight line, so each strip becomes a trapezium. The area of a trapezium is the average of its two parallel sides times its width.

Key termTrapezium rule (called the trapezoidal rule or trapezoidal sum in the US): an estimate of \( \int_a^b f(x)\,dx \) made by splitting \( [a, b] \) into \( n \) strips of equal width \( h = \frac{b – a}{n} \) and replacing the curve over each strip with a straight line. It equals the average of the left and right Riemann sums.
\[ \int_a^b f(x)\,dx \approx \frac{h}{2}\Big[\, y_0 + 2\left(y_1 + y_2 + \dots + y_{n-1}\right) + y_n \Big], \qquad h = \frac{b – a}{n} \]

Here \( a \) and \( b \) are the limits of the integral and \( n \) is the number of strips. \( h \) is the width of each strip. \( y_0, y_1, \dots, y_n \) are the function values (the readings) at the \( n + 1 \) equally spaced points \( x_0 = a, x_1 = a + h, \dots, x_n = b \). The first and last values are counted once; every value in the middle is counted twice, because it is the right side of one trapezium and the left side of the next. A good memory line is “half the width times (ends plus twice the middles)”.

Mathematics Made Simple textbook coverMathematics Made Simple explains the trapezium rule and Riemann sums with worked examples and graphs.Get the textbook · $12

The link with Riemann sums is worth seeing once. The left sum is \( h(y_0 + y_1 + \dots + y_{n-1}) \) and the right sum is \( h(y_1 + y_2 + \dots + y_n) \). Add them and halve: the end values appear once each and every middle value appears twice. That is exactly the trapezium formula. So the trapezium rule is not a separate trick; it is the fair average of the two simplest estimates.

Why this method fits the case

Three features of the case point to a numerical method. First, we have data, not a formula, so ordinary integration is impossible. Second, the readings are equally spaced, every 10 seconds, which makes the standard formula easy to apply. Third, we know distance is the integral of speed, so the area under the graph is exactly the quantity we want.

The trapezium rule suits this kind of data especially well. It uses every reading, it treats the speed as changing steadily between readings (a sensible assumption over 10 seconds of normal driving), and it is quick to do by hand or in a spreadsheet. The left and right sums are still useful: when the speed only rises, they give a guaranteed lower and upper bound, so we know the true distance lies between them.

When is it not the right tool?

  • When you have a formula you can integrate. Then integrate exactly. \( \int_0^2 x^2\,dx = \frac{8}{3} \) needs no estimate.
  • When the readings are too far apart. If the car braked hard and sped up again between two readings, no rule can see it. The estimate is only as good as the sampling.
  • When you need high accuracy from few points. Simpson’s rule, which fits parabolas instead of straight lines, is usually far more accurate for smooth data with an even number of strips. It is covered in further numerical methods.

Setting it up

QuantitySymbolValue
Interval\( [a, b] \)\( [0, 60] \) seconds
Number of strips\( n \)6
Strip width\( h = \frac{b – a}{n} \)\( \frac{60}{6} = 10 \) s
End readings\( y_0, y_6 \)0 and 22 m/s
Middle readings\( y_1, \dots, y_5 \)8, 14, 18, 20, 21 m/s (sum 81)
Quantity estimated\( \int_0^{60} v(t)\,dt \)Distance in metres

Check the units before calculating: the width is in seconds and the heights are in metres per second, so each strip’s area is in metres. That confirms the answer is a distance.

Solving it

Worked example

Use the trapezium rule with 6 strips to estimate the distance travelled in the first 60 seconds.

Step 1\( h = 10 \). Ends: \( y_0 + y_6 = 0 + 22 = 22 \).
Step 2Middles: \( y_1 + \dots + y_5 = 8 + 14 + 18 + 20 + 21 = 81 \). Twice the middles: 162.
Step 3Bracket: \( 22 + 162 = 184 \).
Step 4Estimate: \( \frac{h}{2} \times 184 = 5 \times 184 = 920 \) m.

The car travelled about 920 metres in the first minute, an average speed of about 15.3 m/s (55 km/h).

Worked example

Find the left and right Riemann sums for the same data, and explain what they tell us.

Step 1Left sum uses \( y_0 \) to \( y_5 \): \( 10 \times (0 + 8 + 14 + 18 + 20 + 21) = 10 \times 81 = 810 \) m.
Step 2Right sum uses \( y_1 \) to \( y_6 \): \( 10 \times (8 + 14 + 18 + 20 + 21 + 22) = 10 \times 103 = 1030 \) m.
Step 3Average: \( \frac{810 + 1030}{2} = 920 \) m, the same as the trapezium rule. ✓
Step 4Speed rises throughout, so the left sum is too low and the right sum too high (assuming the speed did not dip between readings).

The true distance lies between 810 m and 1,030 m, and the trapezium estimate of 920 m sits in the middle of that range.

Worked example

Test the methods on a known integral. Estimate \( \int_0^2 x^2\,dx \) with 4 strips using left, right, midpoint and trapezium methods, and compare with the exact value.

Step 1\( h = 0.5 \). Values at \( x = 0, 0.5, 1, 1.5, 2 \): \( 0, 0.25, 1, 2.25, 4 \).
Step 2Left: \( 0.5(0 + 0.25 + 1 + 2.25) = 1.75 \). Right: \( 0.5(0.25 + 1 + 2.25 + 4) = 3.75 \).
Step 3Midpoint (at 0.25, 0.75, 1.25, 1.75): \( 0.5(0.0625 + 0.5625 + 1.5625 + 3.0625) = 2.625 \).
Step 4Trapezium: \( 0.25\,[0 + 2(0.25 + 1 + 2.25) + 4] = 0.25 \times 11 = 2.75 \).
Step 5Exact: \( \left[\frac{x^3}{3}\right]_0^2 = \frac{8}{3} \approx 2.667 \). Trapezium error \( = +0.083 \) (about 3%); midpoint error \( = -0.042 \).

For a concave-up curve the trapezium rule overestimates and the midpoint sum underestimates, with the midpoint error about half the size.

Mathematics Made Simple Practice Questions coverMake the trapezium rule and Riemann sums automatic with the Practice Questions book: 1,565 questions, all fully worked.Get 1,565 questions · $9

What the answer tells us

The car covered roughly 920 metres in a minute, at an average of about 15.3 m/s, or 55 km/h. That fits the story: a car pulling away from a junction and settling near 80 km/h (22 m/s) by the end of the minute. Figure 1 shows the readings, the straight-line segments the trapezium rule uses, and the six trapezia whose areas add up to 920 m.

Speed readings and the six trapezia m/s
Speed readings joined by straight linesTrapezia (total area 920 m)
05101520250102030405060Time, t (seconds)Speed (m/s)Area ≈ 920 m
Figure 1. Speed readings from the data logger. The trapezium rule joins the readings with straight lines; the six shaded trapezia have total area \( 5[0 + 2(81) + 22] = 920 \) m. Because the speed curve is concave down, the chords lie slightly below it and the rule slightly underestimates. (Illustrative figures.)

Is the estimate too high or too low? Look at the shape. The speed rises quickly at first and then levels off, so the graph is concave down: it bends like a cap. For a concave-down curve, each straight chord lies below the curve, so each trapezium misses a thin sliver of area. The trapezium rule therefore underestimates, and the true distance is probably a little more than 920 m. As a cross-check, Simpson’s rule on the same data gives about 927 m, slightly higher, as expected. The left and right sums give hard bounds of 810 m and 1,030 m if the speed never dips between readings.

How sensitive is the answer? Two things matter: the spacing of the readings and their accuracy. With readings every 10 seconds, the error from the straight-line assumption is small here, because the speed changes smoothly. If the logger read every 30 seconds instead (only \( t = 0, 30, 60 \)), the trapezium rule would give \( 15(0 + 36 + 22) = 870 \) m, noticeably lower. Halving the strip width roughly quarters the trapezium error for smooth data, which is why more frequent readings help so much [1]. As for reading accuracy, if every speed reading were 0.5 m/s too high, the estimate would rise by \( 0.5 \times 60 = 30 \) m, because the weights in the formula always add up to the total time.

Common mistakeCounting the strips and the readings as the same number. Seven readings make six strips, so \( n = 6 \) and \( h = \frac{60}{6} = 10 \). Using \( h = \frac{60}{7} \) gives the wrong width and a wrong answer. Count the gaps, not the points.
Common mistakeForgetting to double the middle values, or doubling the end values too. Only \( y_1 \) to \( y_{n-1} \) are doubled. A quick check: in the bracket, the multipliers should add up to \( 2n \). Here \( 1 + 2 \times 5 + 1 = 12 = 2 \times 6 \). ✓
Exam tipAP Calculus often gives a table with unequal intervals and asks for a left, right, midpoint or trapezoidal sum [2]. Then the shortcut formula does not apply: work out each trapezium separately as \( \frac{(y_{i} + y_{i+1})}{2} \times \text{width}_i \). Cambridge 9709 asks you to state, using a sketch, whether the trapezium rule over- or underestimates [3]. Link your answer to the curve’s shape (concave up: over; concave down: under), and include units in context.

To see how Riemann sums lead to the definite integral and the fundamental theorem, read the Mathematics Made Simple textbook. For table-based integration questions with full solutions, use the Mathematics Made Simple Practice Questions book.

Mathematics Made Simple bundle coverMaster integration and numerical methods with both Mathematics Made Simple books for $16.Both books · $16

Practice questions

Give answers to 3 significant figures unless told otherwise, and include units where there is a context.

EasyQ1. Use the trapezium rule with 2 strips to estimate \( \int_1^2 \frac{1}{x}\,dx \). Compare with the exact value \( \ln 2 \). Show worked answer
\( h = 0.5 \); values at 1, 1.5, 2: \( 1, \frac{2}{3}, 0.5 \).
\( \frac{0.5}{2}\left[1 + 2\left(\tfrac{2}{3}\right) + 0.5\right] = 0.25 \times 2.8333 = 0.708 \).
\( \ln 2 \approx 0.693 \), so the rule overestimates (\( \frac{1}{x} \) is concave up).
EasyQ2. Find the left Riemann sum for \( f(x) = 3x + 1 \) on \( [0, 4] \) with 4 strips, and compare it with the exact integral. Show worked answer
\( h = 1 \); left heights \( f(0), f(1), f(2), f(3) = 1, 4, 7, 10 \).
Left sum \( = 1 \times 22 = 22 \).
Exact: \( \left[1.5x^2 + x\right]_0^4 = 24 + 4 = 28 \). The left sum underestimates because \( f \) is increasing. (The trapezium rule gives exactly 28 for a straight line.)
MediumQ3. A rain gauge records the rainfall rate every 2 hours: 0, 2, 5, 9, 6, 3, 1 mm/h at \( t = 0, 2, \dots, 12 \). Estimate the total rainfall over the 12 hours with the trapezium rule. Show worked answer
\( h = 2 \), \( n = 6 \). Ends: \( 0 + 1 = 1 \). Middles: \( 2 + 5 + 9 + 6 + 3 = 25 \).
\( \frac{2}{2}\left[1 + 2(25)\right] = 51 \) mm.
(Left sum 50 mm, right sum 52 mm.)
MediumQ4. Use the trapezium rule with 4 strips to estimate \( \int_0^1 e^{-x^2}\,dx \). The true value is about 0.7468. Find the percentage error. Show worked answer
\( h = 0.25 \); values: \( 1, 0.9394, 0.7788, 0.5698, 0.3679 \).
\( 0.125\left[1 + 2(0.9394 + 0.7788 + 0.5698) + 0.3679\right] = 0.125 \times 5.9439 \approx 0.743 \).
Error \( \approx 0.7468 – 0.7430 = 0.0038 \), about 0.5% (an underestimate).
ExamQ5. Water flows into a tank at rate \( R(t) \) litres per minute. Readings: \( t = 0, 2, 5, 9, 10 \) min; \( R = 10, 14, 18, 15, 12 \). (a) Use a trapezoidal sum with the four sub-intervals in the table to estimate \( \int_0^{10} R(t)\,dt \), and interpret it. (b) Estimate the average rate of flow over the 10 minutes. (c) If \( R \) is concave down on \( [0, 10] \), is your estimate in (a) an over- or underestimate? Explain. [6] Show worked answer
(a) \( 2\cdot\frac{10 + 14}{2} + 3\cdot\frac{14 + 18}{2} + 4\cdot\frac{18 + 15}{2} + 1\cdot\frac{15 + 12}{2} \) [1] \( = 24 + 48 + 66 + 13.5 = 151.5 \) [1]. About 151.5 litres flow in during the 10 minutes. [1]
(b) \( \frac{151.5}{10} = 15.15 \) litres per minute. [1]
(c) Underestimate [1]: on a concave-down graph each chord lies below the curve, so each trapezium misses area. [1]

Frequently asked questions

Is the trapezium rule the same as the trapezoidal rule?

Yes. “Trapezium rule” is the British name used by Cambridge; “trapezoidal rule” or “trapezoidal sum” is the American name used by AP. The formula is the same.

Which is more accurate: the trapezium rule or the midpoint sum?

For smooth curves, the midpoint sum is usually more accurate, with an error about half the size and of opposite sign. But the midpoint sum needs values in the middle of each strip, which a table of readings often does not give you.

How do I make the trapezium estimate more accurate?

Use more, narrower strips. For smooth functions, doubling the number of strips cuts the error to roughly a quarter. With data, that means taking readings more often.

Can the trapezium rule give the exact answer?

Yes, when the function is a straight line on each strip, because then each trapezium fits the area exactly. For curves it is an approximation, although the error can be made as small as you like by using enough strips.

References

  1. Strang, G. and Herman, E. (2016) Calculus Volume 1. Houston, TX: OpenStax. Available at: https://openstax.org/details/books/calculus-volume-1.
  2. College Board (2020) AP Calculus AB and AP Calculus BC Course and Exam Description. New York: College Board.
  3. Cambridge International (2024) Cambridge International AS & A Level Mathematics 9709: Syllabus for examination in 2026 and 2027. Cambridge: Cambridge University Press & Assessment. Available at: cambridgeinternational.org.
  4. International Baccalaureate Organization (2019) Mathematics: analysis and approaches guide (first assessment 2021). Cardiff: IBO.
Mathematics Made Simple complete bundle cover
This topic has a full chapter in Mathematics Made Simple, with 1,565 fully worked practice questions in the bundle.Mathematics Made Simple Complete Bundle — Textbook + 1,565 Practice Questions
Get it for $16
E

The EconTutorials team writes clear, exam-focused lessons in economics and statistics for A-Level, IB, AP and university students, with more than 13 years of classroom teaching behind every guide and book in the Made Simple series.