IB Mathematics: Applications and Interpretation SL — Topic 5 Calculus
Trapezoidal Rule for Integration
Approximate areas and definite integrals from a table of data or a function using equal-width intervals.
Learning goal
Approximate an area or definite integral from a table of data or a function, using equal-width intervals and the trapezoidal rule.
Syllabus link
IB Mathematics AI SL: SL 5.8. Approximate areas using the trapezoidal rule from a table of data or a function, with intervals of equal width.
Big idea
Approximate the area under the curve as the sum of the areas of trapezia (trapeziums). For a smooth curve, using more equal-width trapezia generally improves the estimate.
Key relationship
For n equal intervals, \(h=\frac{b-a}{n}\), with the two endpoint ordinates used once and every middle ordinate used twice.
Why do we need an approximation?
A definite integral such as
represents an accumulated quantity. When the graph lies above the horizontal axis, it can represent the area under a curve. However, we may not know an antiderivative, or the information may be available only as measured data in a table.
The trapezoidal rule gives a practical approximation by joining consecutive points with straight-line segments.
Notice. The shaded region is an approximation of the area enclosed by the curve and the x-axis. This approximation is equal to the sum of the areas of the trapezia.
Key idea. Approximate the area under the curve as the sum of the areas of the trapezia. For a smooth curve, using more equal-width trapezia generally improves the estimate.
From one trapezium to the general formula
For one interval of width \(h\), with vertical heights \(y_0\) and \(y_1\), the area of the trapezium is
Notice. The single trapezium on the left is the first trapezium, \(A_1\). If a region is divided into 4 trapezia, there are \(4+1=5\) vertical heights.
If the interval \([a,b]\) is divided into \(n\) equal parts, then
There are \(n\) trapezia but \(n+1\) vertical heights, labelled \(y_0,y_1,\ldots,y_n\).
Adding all the trapezia gives
- \(n\)
- number of equal intervals, and therefore the number of trapezia
- \(h\)
- width of each interval
- \(y_0\) and \(y_n\)
- first and last ordinates; each is used once
- \(y_1,\ldots,y_{n-1}\)
- middle ordinates; each is used twice
AI SL syllabus scope. For SL 5.8, use equal-width intervals. Check that consecutive x-values are equally spaced before using the compact formula. If a table has unequal gaps, do not force the equal-width formula onto it; the AI SL 5.8 syllabus does not require a general unequal-width version.
Worked example 1: a function and a given number of intervals
Worked example 1: estimate an integral using \(n=4\)
Question. Use the trapezoidal rule with four equal intervals to estimate
Solution
Step 1: find the interval width.
Recall that \(h=\frac{b-a}{n}\).
Here:
- \(a=1\) and \(b=5\) are the lower and upper limits of the integral;
- \(n=4\) comes from the instruction to use four equal intervals.
Step 2: build the table of values.
| \(x\) | 1 | 2 | 3 | 4 | 5 |
|---|---|---|---|---|---|
| \(y=-x^2+6x\) | 5 | 8 | 9 | 8 | 5 |
Step 3: substitute into the formula.
Estimate: \(\displaystyle \int_1^5(-x^2+6x)\,dx\approx30\) square units.
Using a GDC to evaluate the integral gives the actual value
The trapezoidal estimate is slightly smaller because on this interval, the straight chords joining consecutive points lie below the curve.
Related tutorial 1: Understanding and deriving the trapezoidal rule
See how the area is built from individual trapezia, why the middle ordinates are doubled, and how the general formula is obtained.
When the interval width \(h\) is given
Sometimes the question gives \(h\) rather than \(n\). In that case,
Start at \(x=a\) and repeatedly add \(h\) until reaching \(x=b\).
The full table must begin at \(a\), finish at \(b\), and contain \(n+1\) ordinates.
Worked example 2: build a table from a function
Question. Use the trapezoidal rule with \(h=0.5\) to estimate
Solution
Step 1: determine the number of intervals.
We start with the formula for the interval width:
Multiply both sides by \(n\):
Then divide both sides by \(h\):
The lower and upper limits give \(a=1\) and \(b=3\), while the question gives \(h=0.5\). Therefore
Hence there are 4 equal intervals and \(4+1=5\) x-values.
Step 2: calculate the ordinates.
| \(x\) | 1 | 1.5 | 2 | 2.5 | 3 |
|---|---|---|---|---|---|
| \(y=x+\sqrt{x}\) | 2.0000 | 2.7247 | 3.4142 | 4.0811 | 4.7321 |
The table displays rounded ordinates; keep the full stored GDC values for the calculation.
Step 3: apply the trapezoidal rule.
Estimate: \(\displaystyle \int_1^3(x+\sqrt{x})\,dx\approx6.79\) square units.
Related tutorial 2: Using the trapezoidal rule when \(h\) is given
Build the complete value table from a function, distinguish the first and last ordinates from the middle ordinates, and evaluate the estimate step by step.
AI SL calculator habit. If a function is given, use a GDC value table: set the first x-value to \(a\), use \(h\) as the increment, check that the last value is \(b\), and keep full calculator precision until the final estimate. A graphing view can help you see the straight chords used by the trapezoidal rule.
Using measured data
The formula is especially useful when the boundary is irregular and is known only from measurements. If \(y\) is the perpendicular distance from a straight baseline to a boundary, then
represents the area between the baseline and the boundary.
The same method also applies to accumulated quantities such as energy, total flow, displacement or total production. In those settings, the units are the product of the axis units rather than “square units”.
| Horizontal variable | Vertical variable | Units of the integral |
|---|---|---|
| metres | metres | \(\mathrm{m}^2\) |
| hours | kilowatts | kilowatt-hours (kWh) |
| minutes | litres per minute | litres |
| hours | euros per hour | euros |
| kilometres | litres per kilometre | litres |
| seconds | metres per second | metres |
When a table of measurements is given. Use the measured ordinates directly. You do not need to invent or fit a function unless the question supplies a model or explicitly asks you to find one. Check equal spacing, the correct value of \(h\), and the correct units.
A common IB-style question pattern: table of measurements → trapezoidal estimate → function model and definite integral → comparison or percentage error. The next example follows this progression.
Worked example 3: measurements, a model and percentage error
Worked example 3: estimate the area of a wetland
Question. A straight path runs alongside a small wetland. The perpendicular distance \(y\) metres from the path to the edge of the wetland is measured every 3 metres.
| \(x\) (m) | 0 | 3 | 6 | 9 | 12 |
|---|---|---|---|---|---|
| \(y\) (m) | 0 | 2.4 | 3.6 | 3.0 | 0 |
- Estimate the area using the trapezoidal rule.
- A model for the edge is \(y=\dfrac{x(12-x)(x+21)}{270}\), for \(0\leq x\leq12\). Write an integral for the modelled area and use a GDC to calculate it.
- Find the percentage error in the trapezoidal estimate, using the modelled area as the reference value.
Solution
(a) Trapezoidal estimate
Here \(h=3\) and there are four equal intervals.
Trapezoidal estimate: \(A_{\mathrm T}\approx27\ \mathrm{m}^2\).
(b) Modelled area
(c) Percentage error
Use the modelled area as the reference (the “actual” value in the formula); this is a comparison with the model, not an independent measurement of the wetland.
Percentage error: \(6.25\%\).
Related tutorial 3: An IB-style context - data, model and percentage error
See the complete sequence from a table of measurements to a trapezoidal estimate, an exact modelled area using a GDC, and a percentage-error calculation.
Accuracy: overestimates, underestimates and interval width
The trapezoidal rule replaces each curved piece by a straight chord joining two neighbouring points. Whether the estimate is above or below the true area depends on where those chords lie relative to the curve.
Curve above the chords: underestimate. The chord lies below the curve.
Curve below the chords: overestimate. The chord lies above the curve.
What improves the approximation? Using more intervals makes \(h\) smaller. The line segments then follow the curve more closely, so the approximation usually improves. If the curve changes shape, compare the numerical estimate with a known modelled or exact value instead.
Important AI SL point. You do not need a second-derivative or concavity test for SL 5.8. If the shape is visually clear, explain an overestimate or underestimate by saying that the chords lie above or below the curve.
A trapezoidal estimate is not automatically an upper or lower bound. Such a conclusion needs support from the geometry of the curve and chords or from comparison with a known value.
A reliable AI SL method
- Identify the information. Record \(a\), \(b\), and either \(n\) or \(h\).
- Check equal spacing. The compact AI SL formula assumes equal-width intervals.
- Calculate the missing quantity. Use \(h=(b-a)/n\) or \(n=(b-a)/h\).
- Create the complete table. There must be \(n+1\) ordinates.
- Separate endpoints and middle values. The endpoints are used once; every middle ordinate is doubled.
- Calculate before rounding. Keep several decimal places in the table and round only the final answer unless instructed otherwise.
- State units and meaning. Interpret the estimated accumulated quantity in context.
Common mistakes
| Mistake | Correction |
|---|---|
| Using \(n\) as the number of ordinates | \(n\) is the number of intervals; there are \(n+1\) ordinates. |
| Doubling \(y_0\) and \(y_n\) | Only the middle ordinates are multiplied by 2. |
| Using \(h=b-a\) | Divide by the number of intervals: \(h=(b-a)/n\). |
| Applying the compact formula to unequal gaps | First check that consecutive x-values differ by the same amount. |
| Rounding every table entry too early | Store full GDC values and round the final estimate. |
| Writing “square units” in every context | Multiply the horizontal and vertical units; for example kW × h gives kWh. |
Vocabulary note. An ordinate is another term for a y-value. So, for example, “\(n+1\) ordinates” means “\(n+1\) y-values.”
Practice
Practice 1: direct use of a table
Use the trapezoidal rule to estimate \(\displaystyle\int_0^4 f(x)\,dx\) from the table.
| \(x\) | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| \(f(x)\) | 2.0 | 3.1 | 4.6 | 6.4 | 8.5 |
Practice 2: generate values from a function
Use four equal intervals to estimate
Give your answer to three decimal places.
Practice 3: count intervals and ordinates
The interval \([1,2]\) is divided using \(h=0.25\).
- Find \(n\).
- List all the x-values needed for the trapezoidal rule.
- State the number of ordinates.
Practice 4: solar-energy context
The power output \(P\) kW of a solar installation is measured over six hours.
| \(t\) (h) | 0 | 1 | 2 | 3 | 4 | 5 | 6 |
|---|---|---|---|---|---|---|---|
| \(P\) (kW) | 0 | 0.8 | 2.1 | 3.0 | 2.4 | 1.1 | 0 |
Estimate the electrical energy generated. Give the correct unit.
Practice 5: irregular boundary
A surveyor measures the perpendicular distance from a straight baseline to the edge of a reservoir.
| \(x\) (m) | 0 | 5 | 10 | 15 | 20 |
|---|---|---|---|---|---|
| \(y\) (m) | 0 | 6.2 | 8.1 | 5.6 | 0 |
Estimate the area between the baseline and the edge of the reservoir.
Practice 6: estimate, actual value and percentage error
For \(f(x)=x^2+1\) on \(0\leq x\leq2\):
- Use four equal intervals to estimate \(\displaystyle\int_0^2 f(x)\,dx\).
- Use a GDC or an antiderivative to find the actual value.
- Find the percentage error in the trapezoidal estimate.
- State whether the estimate is an overestimate or an underestimate, and justify your answer using either the numerical comparison or the position of the chords relative to the curve.
Practice 7: a missing ordinate
The trapezoidal rule with \(h=2\) is used with the ordinates
The resulting estimate is 20.8. Find \(k\).
Practice 8: mixed IB-style application
The cross-section of a landscaped garden is bounded by a straight path and a smooth curve. The perpendicular heights are measured at equal intervals.
| \(x\) (m) | 0 | 2 | 4 | 6 | 8 |
|---|---|---|---|---|---|
| \(y\) (m) | 0 | 1.8 | 2.5 | 1.7 | 0 |
- Use the trapezoidal rule to estimate the cross-sectional area. [2]
- A model for the curve is \(y=0.16x(8-x)\), \(0\leq x\leq8\). Write down an integral for the modelled area. [1]
- Calculate the modelled area. [1]
- Find the percentage error in the trapezoidal estimate. [2]
Answer key
Practice 1
Here \(h=1\).
Answer: 19.35 square units.
Practice 2
The x-values are \(0,1,2,3,4\), and
| \(x\) | 0 | 1 | 2 | 3 | 4 |
|---|---|---|---|---|---|
| \(2+\ln(x+1)\) | 2.0000 | 2.6931 | 3.0986 | 3.3863 | 3.6094 |
Practice 3
The five x-values are \(1,\ 1.25,\ 1.50,\ 1.75,\ 2\). There are \(n+1=5\) ordinates.
Practice 4
Here \(h=1\) hour.
Answer: approximately \(9.4\ \mathrm{kWh}\).
Practice 5
Here \(h=5\) metres.
Answer: approximately \(99.5\ \mathrm{m}^2\).
Practice 6
With \(h=0.5\), the ordinates are \(1,\ 1.25,\ 2,\ 3.25,\ 5\).
The actual value is
Hence
Since \(4.75>14/3\), the estimate is an overestimate. This agrees with the geometry: the chords lie above the curve.
Practice 7
Therefore \(2k=6\), so \(\boxed{k=3}\).
Practice 8
(a) Here \(h=2\):
(b)
(c) Using a GDC, \(A\approx13.6533\ \mathrm{m}^2\).
(d)
Related Radford Mathematics tutorials
The three tutorials are embedded alongside the worked examples above. Use these links to jump directly to them.
Final checklist. Before finishing a trapezoidal-rule question, check:
- the intervals are equal in width;
- \(n\) counts intervals, so there are \(n+1\) ordinates;
- only the middle ordinates are doubled;
- sufficient accuracy is kept until the final line;
- the answer has appropriate units and an interpretation;
- if a function model is known, a GDC check against the definite integral is sensible.