Trapezium rule and the definite integral as a limiting sum
Theory
The trapezium rule estimates the area under a curve by slicing it into strips of equal width \(h\) and treating each strip as a trapezium, giving \(\displaystyle\int_a^b f(x)\,dx\approx\dfrac{h}{2}\big[y_0+2y_1+\cdots+2y_{n-1}+y_n\big]\). Using more, narrower strips sharpens the estimate, and in the limit as the strip width \(\to 0\) the sum of areas becomes the exact definite integral \(\displaystyle\int_a^b f(x)\,dx\).
The area under a curve \(y=f(x)\) between \(x=a\) and \(x=b\) can be estimated by dividing \([a,b]\) into \(n\) strips of equal width \(h=\dfrac{b-a}{n}\). The heights of the curve at the strip edges are the ordinates \(y_0,y_1,\dots,y_n\), where \(y_i=f(a+ih)\).
The trapezium rule replaces each strip by a trapezium whose parallel sides are the two ordinates at its edges. A single trapezium of width \(h\) and parallel sides \(y_{\text{L}}\) and \(y_{\text{R}}\) has area \(\dfrac{h}{2}\big(y_{\text{L}}+y_{\text{R}}\big)\); adding the trapezia across the interval gives the trapezium-rule estimate. A rougher lead-in is a rectangle sum, where each strip is a rectangle whose height is the ordinate at the left edge (a left sum) or the right edge (a right sum).
Making the strips narrower (more of them) makes the straight tops hug the curve more closely, so the estimate improves. In the limit as the strip width \(\to 0\), the sum of the strip areas approaches a single exact value: the definite integral \(\displaystyle\int_a^b f(x)\,dx\), defined as \(\displaystyle\lim_{n\to\infty}\sum_{i=1}^{n} f(x_i)\,\Delta x\). The notation \(\displaystyle\int_a^b f(x)\,dx\) is exactly this limiting area.
The trapezium rule with \(n\) strips of equal width \(h=\dfrac{b-a}{n}\) and ordinates \(y_i=f(a+ih)\):
A single trapezium of width \(h\) with parallel sides \(y_{\text{L}}\) and \(y_{\text{R}}\):
The definite integral as the limit of a sum, with \(\Delta x=\dfrac{b-a}{n}\) and sample points \(x_i\):
For a function increasing on \([a,b]\), the left and right rectangle sums bound the true area:
Applying the trapezium rule
- Find the strip width. With \(n\) strips on \([a,b]\), compute \(h=\dfrac{b-a}{n}\); the strip edges are \(x=a,\;a+h,\;a+2h,\;\dots,\;b\).
- Tabulate the ordinates. Evaluate \(y_i=f(x_i)\) at every edge, from \(y_0\) at \(x=a\) to \(y_n\) at \(x=b\) — that is \(n+1\) values.
- Weight them. Take the two end ordinates once and double every interior ordinate: \(y_0+2y_1+2y_2+\cdots+2y_{n-1}+y_n\).
- Multiply by \(\dfrac{h}{2}\). The estimate is \(\dfrac{h}{2}\) times that weighted sum.
- Refine if needed. To improve accuracy, double the number of strips (halve \(h\)); the limit of these estimates as the strip width \(\to 0\) is the exact integral.
| \(y_0=f(0)\) | \(=\) | \(0^2+1=1\) |
| \(y_1=f(1)\) | \(=\) | \(1^2+1=2\) |
| \(y_2=f(2)\) | \(=\) | \(2^2+1=5\) |
| \(A\) | \(\approx\) | \(\dfrac{1}{2}\big[1+2(2)+5\big]\) |
| \(=\) | \(\dfrac{1}{2}(10)=5\) |
| \(L\) | \(=\) | \(1\,(0+1+4)=5\) |
| \(R\) | \(=\) | \(1\,(1+4+9)=14\) |
| \(y_0,\dots,y_4\) | \(=\) | \(1,\;0.6667,\;0.5,\;0.4,\;0.3333\) |
| \(S\) | \(=\) | \(y_0+2(y_1+y_2+y_3)+y_4\) |
| \(=\) | \(1+2(1.5667)+0.3333\) | |
| \(=\) | \(4.4667\) |
| \(A\) | \(\approx\) | \(0.25\times 4.4667\) |
| \(=\) | \(1.117\) |
| \(R_n\) | \(=\) | \(\displaystyle\sum_{i=1}^{n}\left(\dfrac{i}{n}\right)^{2}\cdot\dfrac{1}{n}\) |
| \(=\) | \(\dfrac{1}{n^{3}}\displaystyle\sum_{i=1}^{n} i^{2}\) |
| \(R_n\) | \(=\) | \(\dfrac{1}{n^{3}}\cdot\dfrac{n(n+1)(2n+1)}{6}\) |
| \(=\) | \(\dfrac{(n+1)(2n+1)}{6n^{2}}\) |
| \(\displaystyle\int_0^1 x^2\,dx\) | \(=\) | \(\displaystyle\lim_{n\to\infty}\dfrac{(n+1)(2n+1)}{6n^{2}}\) |
| \(=\) | \(\dfrac{2}{6}=\dfrac{1}{3}\) |
Common pitfalls
Frequently asked questions
What is the trapezium rule?
It estimates the area under a curve by dividing the interval into strips of equal width \(h\) and treating each strip as a trapezium whose parallel sides are the two ordinates. Adding the trapezia gives \(A\approx\dfrac{h}{2}\big[y_0+2y_1+\cdots+2y_{n-1}+y_n\big]\).
What is the formula for the trapezium rule?
With \(h=\dfrac{b-a}{n}\), \(\displaystyle\int_a^b f(x)\,dx\approx\dfrac{h}{2}\big[y_0+2y_1+2y_2+\cdots+2y_{n-1}+y_n\big]\). The two end ordinates are counted once and every interior ordinate twice.
How do you make the trapezium-rule estimate more accurate?
Use more strips, which makes each strip narrower and reduces \(h\). As the strips get thinner the straight tops follow the curve more closely, so the total area of the trapezia approaches the true area.
What is the definite integral as a limiting sum?
It is the limit of a sum of rectangle areas as the strip width \(\to 0\): \(\displaystyle\int_a^b f(x)\,dx=\lim_{n\to\infty}\sum_{i=1}^{n} f(x_i)\,\Delta x\) with \(\Delta x=\dfrac{b-a}{n}\). This limiting area is exactly the notation \(\displaystyle\int_a^b f(x)\,dx\).
How do left and right rectangle sums bound the area?
For an increasing function, left-edge heights give rectangles below the curve (an underestimate) and right-edge heights give rectangles above it (an overestimate), so the true area lies between the left and right sums.
Does the trapezium rule over- or under-estimate the area?
It depends on concavity: where the curve is concave up the chord lies above it and the rule overestimates; where it is concave down the rule underestimates. The error shrinks as more strips are used.