Radford Mathematics IB Mathematics resources • AI SL

Radford Mathematics

Contact / enquiry

Send a question about tutoring, revision courses, website resources or anything else. Your message will be sent to info@radfordmathematics.com.

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.

AI SL · SL 5.8

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.

1

Why do we need an approxi­mation?

A definite integral such as

\[ \int_a^b f(x)\,dx \]

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.

A smooth curve with four equal-width trapezia underneath it, illustrating a trapezoidal approximation
The curved boundary is replaced by straight-line chords. The shaded trapezia approximate the region under the curve.

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.

2

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

\[ A_1=\frac12 h(y_0+y_1). \]
One trapezium with area one half h times y zero plus y one, beside four trapezia with five vertical ordinates
Four trapezia require five vertical heights: \(y_0,y_1,y_2,y_3,y_4\).

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

\[ h=\frac{b-a}{n}. \]

There are \(n\) trapezia but \(n+1\) vertical heights, labelled \(y_0,y_1,\ldots,y_n\).

Adding all the trapezia gives

\[ \begin{aligned} \int_a^b y\,dx &\approx \frac12h(y_0+y_1)+\frac12h(y_1+y_2)+\cdots+\frac12h(y_{n-1}+y_n)\\[2mm] &=\frac12h\Big[(y_0+y_1)+(y_1+y_2)+\cdots+(y_{n-1}+y_n)\Big]\\[2mm] &=\frac12h\Big[y_0+y_1+y_1+y_2+\cdots+y_{n-1}+y_{n-1}+y_n\Big]\\[2mm] &=\frac12h\Big[y_0+2y_1+2y_2+\cdots+2y_{n-1}+y_n\Big]\\[2mm] &=\frac12h\Big[(y_0+y_n)+2(y_1+y_2+\cdots+y_{n-1})\Big]. \end{aligned} \]
\[ \boxed{\int_a^b y\,dx\approx \frac12h\Big[(y_0+y_n)+2(y_1+y_2+\cdots+y_{n-1})\Big]}, \qquad h=\frac{b-a}{n} \]
\(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.

3

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

\[ \int_1^5(-x^2+6x)\,dx. \]

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.
\[ h=\frac{b-a}{n}=\frac{5-1}{4}=1. \]

Step 2: build the table of values.

\(x\)12345
\(y=-x^2+6x\)58985

Step 3: substitute into the formula.

\[ \begin{aligned} \int_1^5(-x^2+6x)\,dx &\approx \frac12(1)\Big[(5+5)+2(8+9+8)\Big]\\ &=\frac12(10+50)\\ &=30. \end{aligned} \]

Estimate: \(\displaystyle \int_1^5(-x^2+6x)\,dx\approx30\) square units.

Using a GDC to evaluate the integral gives the actual value

\[ \frac{92}{3}\approx30.7. \]

The trapezoidal estimate is slightly smaller because on this interval, the straight chords joining consecutive points lie below the curve.

Graph of y equals negative x squared plus six x with four trapezia between x equals one and x equals five
The chords lie below the curve, giving an underestimate.

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.

Watch this tutorial on YouTube

4

When the interval width \(h\) is given

Sometimes the question gives \(h\) rather than \(n\). In that case,

\[ n=\frac{b-a}{h}. \]

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

\[ \int_1^3\left(x+\sqrt{x}\right)\,dx. \]

Solution

Step 1: determine the number of intervals.

We start with the formula for the interval width:

\[ h=\frac{b-a}{n}. \]

Multiply both sides by \(n\):

\[ nh=b-a. \]

Then divide both sides by \(h\):

\[ n=\frac{b-a}{h}. \]

The lower and upper limits give \(a=1\) and \(b=3\), while the question gives \(h=0.5\). Therefore

\[ n=\frac{b-a}{h}=\frac{3-1}{0.5}=4. \]

Hence there are 4 equal intervals and \(4+1=5\) x-values.

Step 2: calculate the ordinates.

\(x\)11.522.53
\(y=x+\sqrt{x}\)2.00002.72473.41424.08114.7321

The table displays rounded ordinates; keep the full stored GDC values for the calculation.

Step 3: apply the trapezoidal rule.

\[ \begin{aligned} \int_1^3(x+\sqrt{x})\,dx &\approx \frac12(0.5)\Big[(2.0000+4.7321)\\ &\qquad\qquad +2(2.7247+3.4142+4.0811)\Big]\\ &\approx 6.7931. \end{aligned} \]

Estimate: \(\displaystyle \int_1^3(x+\sqrt{x})\,dx\approx6.79\) square units.

Graph of y equals x plus square root x with trapezia of width 0.5 from x equals one to x equals three
Five ordinates create four equal-width trapezia.

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.

Watch this tutorial on YouTube

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.

5

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

\[ \int_a^b y\,dx \]

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 variableVertical variableUnits of the integral
metresmetres\(\mathrm{m}^2\)
hourskilowattskilowatt-hours (kWh)
minuteslitres per minutelitres
hourseuros per houreuros
kilometreslitres per kilometrelitres
secondsmetres per secondmetres

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.

6

Worked example 3: measure­ments, 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.

Wetland boundary measured at x equals zero, three, six, nine and twelve metres from a straight path
The irregular boundary is sampled at equal 3 m intervals along the straight path.
\(x\) (m)036912
\(y\) (m)02.43.63.00
  1. Estimate the area using the trapezoidal rule.
  2. 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.
  3. 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.

\[ \begin{aligned} A_{\mathrm T} &\approx \frac12(3)\Big[(0+0)+2(2.4+3.6+3.0)\Big]\\ &=27. \end{aligned} \]

Trapezoidal estimate: \(A_{\mathrm T}\approx27\ \mathrm{m}^2\).

Wetland model curve and straight-line trapezoidal chords through the measured points
The smooth model can be compared with the trapezoidal chords through the measured points.

(b) Modelled area

\[ A=\int_0^{12}\frac{x(12-x)(x+21)}{270}\,dx=28.8\ \mathrm{m}^2. \]

(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.

\[ \begin{aligned} \text{percentage error} &=\left|\frac{\text{estimate}-\text{actual}}{\text{actual}}\right|\times100\%\\ &=\left|\frac{27-28.8}{28.8}\right|\times100\%\\ &=6.25\%. \end{aligned} \]

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.

Watch this tutorial on YouTube

7

Accuracy: over­estimates, under­estimates 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.

Concave-down curve where the trapezoidal chord lies below the curve and concave-up curve where the chord lies above the curve
Left: the curve lies above the chord. Right: the curve lies below the chord.

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.

8

A reliable AI SL method

  1. Identify the information. Record \(a\), \(b\), and either \(n\) or \(h\).
  2. Check equal spacing. The compact AI SL formula assumes equal-width intervals.
  3. Calculate the missing quantity. Use \(h=(b-a)/n\) or \(n=(b-a)/h\).
  4. Create the complete table. There must be \(n+1\) ordinates.
  5. Separate endpoints and middle values. The endpoints are used once; every middle ordinate is doubled.
  6. Calculate before rounding. Keep several decimal places in the table and round only the final answer unless instructed otherwise.
  7. State units and meaning. Interpret the estimated accumulated quantity in context.

Common mistakes

MistakeCorrection
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 gapsFirst check that consecutive x-values differ by the same amount.
Rounding every table entry too earlyStore full GDC values and round the final estimate.
Writing “square units” in every contextMultiply 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.”

9

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\)01234
\(f(x)\)2.03.14.66.48.5

Practice 2: generate values from a function

Use four equal intervals to estimate

\[ \int_0^4\bigl(2+\ln(x+1)\bigr)\,dx. \]

Give your answer to three decimal places.

Practice 3: count intervals and ordinates

The interval \([1,2]\) is divided using \(h=0.25\).

  1. Find \(n\).
  2. List all the x-values needed for the trapezoidal rule.
  3. 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)0123456
\(P\) (kW)00.82.13.02.41.10

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)05101520
\(y\) (m)06.28.15.60

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\):

  1. Use four equal intervals to estimate \(\displaystyle\int_0^2 f(x)\,dx\).
  2. Use a GDC or an antiderivative to find the actual value.
  3. Find the percentage error in the trapezoidal estimate.
  4. 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

\[ y_0=1.2,\quad y_1=2.0,\quad y_2=k,\quad y_3=3.1,\quad y_4=3.4. \]

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)02468
\(y\) (m)01.82.51.70
  1. Use the trapezoidal rule to estimate the cross-sectional area. [2]
  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]
  3. Calculate the modelled area. [1]
  4. Find the percentage error in the trapezoidal estimate. [2]
10

Answer key

Practice 1

Here \(h=1\).

\[ \begin{aligned} \int_0^4f(x)\,dx &\approx \frac12(1)\Big[(2.0+8.5)+2(3.1+4.6+6.4)\Big]\\ &=19.35. \end{aligned} \]

Answer: 19.35 square units.

Practice 2

The x-values are \(0,1,2,3,4\), and

\(x\)01234
\(2+\ln(x+1)\)2.00002.69313.09863.38633.6094
\[ \begin{aligned} \int_0^4(2+\ln(x+1))\,dx &\approx \frac12\Big[(2.0000+3.6094)\\ &\qquad +2(2.6931+3.0986+3.3863)\Big]\\ &\approx11.983. \end{aligned} \]

Practice 3

\[n=\frac{2-1}{0.25}=4.\]

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.

\[ \begin{aligned} E&\approx\frac12(1)\Big[(0+0)+2(0.8+2.1+3.0+2.4+1.1)\Big]\\ &=9.4. \end{aligned} \]

Answer: approximately \(9.4\ \mathrm{kWh}\).

Practice 5

Here \(h=5\) metres.

\[ \begin{aligned} A&\approx\frac12(5)\Big[(0+0)+2(6.2+8.1+5.6)\Big]\\ &=99.5. \end{aligned} \]

Answer: approximately \(99.5\ \mathrm{m}^2\).

Practice 6

With \(h=0.5\), the ordinates are \(1,\ 1.25,\ 2,\ 3.25,\ 5\).

\[ A_{\mathrm T}\approx\frac12(0.5)\Big[(1+5)+2(1.25+2+3.25)\Big]=4.75. \]

The actual value is

\[ \int_0^2(x^2+1)\,dx=\frac{14}{3}\approx4.6667. \]

Hence

\[ \text{percentage error}=\left|\frac{4.75-14/3}{14/3}\right|\times100\%\approx1.79\%. \]

Since \(4.75>14/3\), the estimate is an overestimate. This agrees with the geometry: the chords lie above the curve.

Practice 7

\[ \begin{aligned} 20.8 &=\frac12(2)\Big[(1.2+3.4)+2(2.0+k+3.1)\Big]\\ &=14.8+2k. \end{aligned} \]

Therefore \(2k=6\), so \(\boxed{k=3}\).

Practice 8

(a) Here \(h=2\):

\[ A_{\mathrm T}\approx\frac12(2)\Big[(0+0)+2(1.8+2.5+1.7)\Big]=12\ \mathrm{m}^2. \]

(b)

\[ A=\int_0^8 0.16x(8-x)\,dx. \]

(c) Using a GDC, \(A\approx13.6533\ \mathrm{m}^2\).

(d)

\[ \text{percentage error}=\left|\frac{12-13.6533}{13.6533}\right|\times100\%\approx12.1\%. \]
11

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.