Trapezoidal Rule
Estimating the area under a curve by adding the areas of trapezia.
On this page
- Integration pathway
- The whole idea
- Area of one trapezium
- Step-by-step method
- The trapezoidal rule formula
- Worked example: function values
- Improving accuracy
- IB-style data example
- Overestimate and underestimate
- Practice
↗Integration pathway
This page belongs to the integration mini-chapter. It is best studied after definite integrals and area under a curve.
1The whole idea
The trapezoidal rule is used when we want to estimate an area but cannot, or do not need to, find an exact antiderivative. Instead of following the curve exactly, we join neighbouring points on the curve with straight line segments. These line segments create trapezia.
The handwritten notes introduce the method by approximating the area enclosed by a curve, the x-axis, and two vertical lines using four trapezia. The clean diagram below follows that same structure.
Key idea: the curved top of the region is replaced by straight-line segments, making the region easier to calculate.
Important: if there are \(n\) trapezia, there are \(n+1\) x-values and therefore \(n+1\) heights. For example, 4 trapezia require 5 heights.
2Reminder: area of one trapezium
A trapezium has two parallel sides. In this context, the parallel sides are the two vertical heights, and the distance between them is the strip width \(h\).
The trapezoidal rule is simply this formula used repeatedly: calculate the area of each trapezium, then add them.
3Step-by-step method
1Choose the width
Either choose the number of trapezia \(n\), or use the interval width \(h\) given in the question.
If \(h\) is already given, use it directly.
2Find the x-values
Start at \(a\), then keep adding \(h\) until you reach \(b\).
3Find the heights
Substitute each x-value into the function, or read each height from a table.
4Use the formula
The first and last heights are used once. All middle heights are used twice.
Reminder: this same pattern appears in every worked example.
4The trapezoidal rule formula
For a function \(y=f(x)\), divided into \(n\) equal-width trapezia from \(x=a\) to \(x=b\), the trapezoidal rule is:
where \(h=\frac{b-a}{n}\), \(x_i=a+ih\), and \(y_i=f(x_i)\).
For four trapezia, \(y_1\), \(y_2\) and \(y_3\) are each shared by two neighbouring trapezia, so they are counted twice.
For \(n=4\), the four trapezia have areas:
Now add them carefully, step by step:
Always remember: the first height \(y_0\) and the last height \(y_n\) appear only once. Every middle height appears twice because each one belongs to two neighbouring trapezia.
5Worked example 1: using function values
Using a step size \(h=0.5\), estimate the area enclosed by \(y=f(x)\) and the x-axis for \(0\leq x\leq 2\), where
The exact area would be \(\int_0^2 f(x)\,dx\), but here we are asked to estimate it using trapezia.
Reminder before using the formula: the first and last heights are used once, while all middle heights are doubled.
Since \(h=0.5\), the x-values are:
There are 5 x-values, so there are 4 trapezia.
| i | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| \(x_i\) | 0 | 0.5 | 1 | 1.5 | 2 |
| \(y_i=f(x_i)\) | 6 | 4.25 | 3 | 2.25 | 2 |
So the trapezoidal rule estimate is \(6.75\) square units.
The four trapezia are built from the five heights \(y_0\) to \(y_4\).
The exact value is \(\int_0^2 (x^2-4x+6)\,dx=\frac{20}{3}\approx 6.67\). The estimate \(6.75\) is close, but not exact.
6How to increase accuracy
The approximation usually improves when the trapezia are narrower. That means using more trapezia, or equivalently using a smaller step size \(h\).
For the previous example, changing from \(h=0.5\) to \(h=0.25\) gives 8 trapezia instead of 4.
The estimate becomes:
This is closer to the exact value \(6.67\) than the earlier estimate \(6.75\).
More, thinner trapezia give a better approximation for this example.
7Worked example 2: IB-style data question
Engineers measure the power output \(P\), in MW, of a wind farm over a period of 3 hours. The total electrical energy produced, in MWh, is represented by the area under the power-time graph.
| \(t\) hours | 0 | 0.5 | 1.0 | 1.5 | 2.0 | 2.5 | 3.0 |
|---|---|---|---|---|---|---|---|
| \(P\) MW | 40 | 55 | 65 | 60 | 50 | 45 | 55 |
Use the trapezoidal rule with interval width \(0.5\) hours to estimate the total energy produced.
Here \(h=0.5\), and there are 6 trapezia.
Reminder: use the first and last values once, and double every middle value from the table.
So the estimated total energy produced is \(161.25\) MWh, or \(161\) MWh to 3 significant figures.
For data questions, the trapezia are built from the table values rather than from an explicit formula.
If the real amount of energy was \(158\) MWh, the percentage error is:
If the estimate is first rounded to \(161\) MWh, then the percentage error is approximately \(1.90\%\). In an exam, use unrounded values unless the question tells you otherwise.
8Overestimate and underestimate
The trapezoidal rule replaces a curve by straight chords. Whether this gives an overestimate or underestimate depends on the shape of the curve.
This is a useful visual check, but in exams you should still follow the requested method carefully.
Common warning: overestimate and underestimate statements are safest when the curve keeps the same concavity on the whole interval.
9Common mistakes checklist
There are \(n\) trapezia but \(n+1\) heights.
Only \(y_0\) and \(y_n\) are used once.
If the interval width is given, use it. Otherwise calculate \(h=\frac{b-a}{n}\).
For example, MW multiplied by hours gives MWh.
10Practice with solutions
- Use the trapezoidal rule with \(h=0.5\) to estimate \(\int_0^2 (x^2+1)\,dx\).
Show solution
The x-values are \(0,0.5,1,1.5,2\). The y-values are \(1,1.25,2,3.25,5\).
\[A\approx\frac{0.5}{2}\left[1+5+2(1.25+2+3.25)\right]=4.75\] - A curve is divided into 6 trapezia from \(x=1\) to \(x=4\). Find \(h\).
Show solution
\[h=\frac{4-1}{6}=0.5\] - For \(h=2\), the heights are \(3,5,8,6\). Estimate the area.
Show solution
There are 4 heights, so there are 3 trapezia.
\[A\approx\frac{2}{2}\left[3+6+2(5+8)\right]=35\] - The velocity of a particle is measured as follows. Estimate the distance travelled from \(t=0\) to \(t=4\).
\(t\) 0 1 2 3 4 \(v\) 2 5 7 6 4 Show solution
Here \(h=1\).
\[D\approx\frac{1}{2}\left[2+4+2(5+7+6)\right]=21\]The estimated distance is 21 units.
- Explain why using more trapezia generally improves the approximation.
Show solution
Using more trapezia makes the width \(h\) smaller. The straight-line segments then follow the curve more closely, so the total trapezium area is usually closer to the true area.