2.5 - The trapezium rule

2.5 - The trapezium rule

How can you estimate an integral when you know some curve heights but do not have a convenient antiderivative? The trapezium rule joins those heights by straight lines and adds the resulting strips. You will build its formula, apply it to functions and tables, and use the curve's shape to judge an overestimate or underestimate.

Adding trapezia

Suppose a positive curve has heights y0y_0 and y1y_1 at the ends of an interval of width hh. Replace the curve between those points by a straight chord. The region under that chord is a trapezium whose parallel sides are the two vertical heights:

trapezium area=h2(y0+y1).\text{trapezium area}=\frac h2(y_0+y_1).

This is the average of the endpoint heights multiplied by the width. It is an estimate for the curved strip, not a claim that the curve itself is straight.

Now use nn equally wide intervals. There are n+1n+1 ordinates, or function heights, y0,y1,…,yny_0,y_1,\ldots,y_n. Adding neighbouring trapezia gives

T=h2(y0+y1)+h2(y1+y2)+⋯+h2(yn−1+yn)=h2[y0+2(y1+⋯+yn−1)+yn].\begin{aligned} T&=\frac h2(y_0+y_1)+\frac h2(y_1+y_2)+\cdots+\frac h2(y_{n-1}+y_n)\\ &=\frac h2\left[y_0+2(y_1+\cdots+y_{n-1})+y_n\right]. \end{aligned}

Each interior ordinate belongs to two strips, while each outer endpoint belongs to only one. That is the reason for the different weights.

Trapezium rule

For nn equal intervals from aa to bb, let

h=b−an,xj=a+jh,yj=f(xj).h=\frac{b-a}{n},\qquad x_j=a+jh,\qquad y_j=f(x_j).

Then

∫abf(x) dx ≈ T=h2[y0+2(y1+⋯+yn−1)+yn].\int_a^b f(x)\,dx\ \approx\ T=\frac h2\left[y_0+2(y_1+\cdots+y_{n-1})+y_n\right].

The trapezium rule is not listed in MF19: learn the weights and their reason.

The sketch shows the same region with two different strip widths.

[DIAGRAM: asset_name: Adding neighbouring trapezia; asset_slug: trapezium-strip-weights; caption: Interior ordinates occur in two strips, and halving the strip width follows the curve more closely; description: Two coordinate panels plot y equals 1 plus x squared from 0 to 2. The left replaces the curve by two chords through heights 1, 2 and 5 with width h equals 1. The right uses four chords through heights 1, 1.25, 2, 3.25 and 5 with width h equals one half. The trapezia have alternating pale fills, and the shared interior ordinates are highlighted.]
Interior ordinates occur in two strips, and halving the strip width follows the curve more closely

Worked example 1: two intervals

Question. Use the trapezium rule with two intervals to estimate ∫02(1+x2) dx\int_0^2(1+x^2)\,dx.

Plan. Find the width and three heights, then give the middle height weight 22.

h=2−02=1,y0=1, y1=2, y2=5.h=\frac{2-0}{2}=1,\qquad y_0=1,\ y_1=2,\ y_2=5. T=12[1+2(2)+5]=5.T=\frac12[1+2(2)+5]=5.

Answer. The estimated integral is 55.

Check. Adding the two areas separately gives (1+2)/2+(2+5)/2=1.5+3.5=5(1+2)/2+(2+5)/2=1.5+3.5=5.

Keep the function and interval, but double the number of strips. The width halves, and there are five heights rather than three.

Worked example 2: four intervals

Question. Use the trapezium rule with four intervals to estimate the same integral.

Plan. Use h=1/2h=1/2 and count the two endpoints once, the three interior heights twice.

xx001/21/2113/23/222
1+x21+x^2115/45/42213/413/455
T=14[1+2(54+2+134)+5]=194=4.75.T=\frac14\left[1+2\left(\frac54+2+\frac{13}4\right)+5\right] =\frac{19}{4}=4.75.

Answer. The new estimate is 4.754.75.

Check. The four separate strip contributions are 9/16,13/16,21/16,33/169/16,13/16,21/16,33/16; their sum is 76/16=19/476/16=19/4.

The difference between 55 and 4.754.75 shows that an estimate depends on the strip width. The final part will explain which side of the actual integral these estimates lie on.

Watch out

Four intervals require five ordinates. The width is (b−a)/4(b-a)/4, not (b−a)/5(b-a)/5. Count the spaces between the listed inputs.

Build the weights for a new table.

Estimating a definite integral

When a formula is given, make the ordinate table yourself. Calculate at every endpoint of every strip, keeping extra digits until the final weighted sum. When a table is given, check that the input spacing is constant before using the compact formula.

Worked example 3: heights from a function

Question. Use the trapezium rule with four intervals to estimate

∫0211+x2 dx.\int_0^2\frac1{1+x^2}\,dx.

Give your answer correct to 3 significant figures.

Plan. Use inputs 0,0.5,1,1.5,20,0.5,1,1.5,2, evaluate the function at each one, then apply endpoint/interior weights.

h=2−04=12.h=\frac{2-0}{4}=\frac12.
xx001/21/2113/23/222
1/(1+x2)1/(1+x^2)114/54/51/21/24/134/131/51/5
T=14[1+2(45+12+413)+15]=1.103846…T=\frac14\left[1+2\left(\frac45+\frac12+\frac4{13}\right)+\frac15\right] =1.103846\ldots

Answer. 1.101.10, correct to 3 significant figures.

Check. The separate trapezium areas are 0.45, 0.325, 0.201923…, 0.126923…0.45,\ 0.325,\ 0.201923\ldots,\ 0.126923\ldots, with the same total. The positive estimate is below the area of a width-22, height-11 rectangle, as expected.

Change the source of the heights: now they are supplied in a table rather than generated by a formula. The weights follow the inputs in exactly the same way.

Worked example 4: heights from a table

Question. Use the trapezium rule to estimate ∫02g(x) dx\int_0^2 g(x)\,dx from the following table.

xx000.50.5111.51.522
g(x)g(x)2.02.01.71.71.51.51.41.41.31.3

Plan. Read the common width 0.50.5, then count the outer heights once and the interior heights twice.

T=0.52[2.0+2(1.7+1.5+1.4)+1.3]=0.25(12.5)=3.125.T=\frac{0.5}{2}[2.0+2(1.7+1.5+1.4)+1.3] =0.25(12.5)=3.125.

Answer. The estimate from the supplied values is 3.1253.125.

Check. The individual strip contributions are 0.925, 0.800, 0.725, 0.6750.925,\ 0.800,\ 0.725,\ 0.675, again totalling 3.1253.125.

Continue this lesson.

You’re previewing NovaLearn without an account. Create a free account to read the rest.

Create free account