What Is The Trapezoidal Rule?
The Trapezoidal Rule is a numerical method that approximates a definite integral $\int_a^b f(x),dx$ by replacing the curve with straight line segments and adding up the areas of the trapezoids underneath. It is used when an integral is hard or impossible to evaluate exactly, but you can still read off, or compute, the height of the curve at evenly spaced points.
Split the interval $[a,b]$ into $n$ equal subintervals of width
$$h=\frac{b-a}{n},$$
with sample points $x_0=a,;x_1=a+h,;x_2=a+2h,;\ldots,;x_n=b$. The rule then states:
$$\int_a^b f(x),dx ;\approx; T_n=\frac{h}{2}\Big[f(x_0)+2f(x_1)+2f(x_2)+\cdots+2f(x_{n-1})+f(x_n)\Big].$$
Read the bracket carefully: the two endpoints $f(x_0)$ and $f(x_n)$ are counted once, and every interior point is counted twice. That single pattern is the whole rule. Geometrically, each strip is a trapezoid whose two parallel vertical sides are the curve's heights at the strip's edges, and whose width is $h$, so the method is nothing more than "area of a trapezoid, repeated and summed." For the underlying idea of the definite integral as the exact area under a curve, the Trapezoidal Rule is the first honest approximation to it.
How Do You Use The Trapezoidal Rule Step By Step?
The method is a fixed four-step routine. Nothing about it changes from problem to problem.
Compute the strip width $h=\dfrac{b-a}{n}$.
List the sample points $x_0,x_1,\ldots,x_n$ and evaluate $f$ at each one.
Add the two endpoint heights once, and add every interior height twice.
Multiply the whole sum by $\dfrac{h}{2}$.
Example 1: Approximate $\int_0^1 x^2,dx$ with $n=4$.
Step 1, width: $h=\dfrac{1-0}{4}=0.25$.
Step 2, sample points and heights for $f(x)=x^2$:
$\begin{array}{c|ccccc}x&0&0.25&0.5&0.75&1\\\hline f(x)=x^2&0&0.0625&0.25&0.5625&1\end{array}$
Step 3 and 4, endpoints once, interiors twice, then scale by $\frac{h}{2}=0.125$:
$$T_4=\frac{0.25}{2}\Big[0+2(0.0625)+2(0.25)+2(0.5625)+1\Big]$$
$$T_4=0.125\big[0+0.125+0.5+1.125+1\big]=0.125,(2.75)=0.34375.$$
Final answer: $T_4=0.34375$.
The exact value is $\int_0^1 x^2,dx=\left[\frac{x^3}{3}\right]_0^1=\frac{1}{3}=0.3333$ (to 4 dp). Our estimate $0.34375$ is a slight over-estimate, and the gap $0.34375-0.33333=0.0104$ is the approximation error we will bound below.
Example 2: Approximate $\int_1^2 \frac{1}{x},dx$ with $n=4$.
This integral has a known exact value, $\ln 2$, which makes it a good accuracy test. Width $h=\dfrac{2-1}{4}=0.25$, so the points are $1,,1.25,,1.5,,1.75,,2$.
$\begin{array}{c|ccccc} x & 1 & 1.25 & 1.5 & 1.75 & 2 \\ \hline f(x)=\tfrac{1}{x} & 1 & 0.8 & 0.6667 & 0.5714 & 0.5 \end{array}$
$$T_4=\frac{0.25}{2}\Big[1+2(0.8)+2(0.6667)+2(0.5714)+0.5\Big]$$
$$T_4=0.125,(5.5762)=0.6970.$$
Final answer: $T_4=0.6970$.
The exact value is $\int_1^2 \frac{1}{x},dx=\ln 2=0.6931$ (to 4 dp). Again the estimate is a small over-estimate, off by about $0.0039$. Both examples over-shoot for the same geometric reason, explained in the next section.
Where Does The Trapezoidal Rule Formula Come From?
Start with one strip. Over a single subinterval $[x_i,,x_{i+1}]$ of width $h$, the region under the curve is approximated by a trapezoid whose two parallel sides are the heights $f(x_i)$ and $f(x_{i+1})$. The area of a trapezoid is the average of its parallel sides times the distance between them:
$$A_i=\frac{h}{2}\big[f(x_i)+f(x_{i+1})\big].$$
Now add all $n$ strips from $x_0$ to $x_n$:
$$T_n=\frac{h}{2}\big[f(x_0)+f(x_1)\big]+\frac{h}{2}\big[f(x_1)+f(x_2)\big]+\cdots+\frac{h}{2}\big[f(x_{n-1})+f(x_n)\big].$$
Every interior point $x_1,\ldots,x_{n-1}$ is the right edge of one strip and the left edge of the next, so it appears twice; the two ends $x_0$ and $x_n$ appear only once. Collecting the like terms gives the standard formula:
$$T_n=\frac{h}{2}\Big[f(x_0)+2f(x_1)+2f(x_2)+\cdots+2f(x_{n-1})+f(x_n)\Big].$$
That doubling of the interior heights is not a trick to memorize; it is just bookkeeping from shared edges. Understanding it this way makes the formula impossible to write down wrong.
Why Does The Trapezoidal Rule Over- Or Under-Estimate?
The sign of the error is decided entirely by the shape of the curve, and the reason is visual.
Concave up (curve bends upward, $f''>0$): a straight chord between two points lies above the curve, so each trapezoid holds a little too much area and the rule over-estimates. Both worked examples, $x^2$ and $\frac{1}{x}$, are concave up on their intervals, which is why both came out high.
Concave down ($f''<0$): the chord lies below the curve, so the rule under-estimates.
Straight line ($f''=0$): the chord is the curve, so the Trapezoidal Rule is exact, with no error at all.
This is also why accuracy depends on $f''$: the more sharply the curve bends away from a straight line, the more the chords miss, and the second derivative is the precise measure of that bending. That link between curvature and error is exactly what the error bound in the next section makes quantitative. If you want to review what the derivative measures before reading on, the second derivative $f''$ here simply reports how fast the slope is changing.
What Is The Error Bound For The Trapezoidal Rule?
The gap between the true integral and $T_n$ has a clean upper bound. If $f''$ is continuous on $[a,b]$, then the error $E_T=\int_a^b f(x),dx-T_n$ satisfies:
$$|E_T|;\le;\frac{(b-a)^3}{12,n^2},\max_{a\le x\le b}\big|f''(x)\big|.$$
Two features are worth reading off directly:
The bound falls like $\dfrac{1}{n^2}$. Doubling the number of strips cuts the worst-case error to about a quarter. That $n^2$ is what makes the rule practical.
The bound is proportional to $\max|f''|$, confirming the previous section: a flatter curve is easier to approximate, a sharply bending one is harder.
Checking the bound on Example 1. For $f(x)=x^2$ we have $f''(x)=2$, a constant, so $\max|f''|=2$. With $a=0$, $b=1$, $n=4$:
$$|E_T|\le\frac{(1-0)^3}{12,(4)^2},(2)=\frac{2}{192}=0.0104.$$
The actual error we found was $0.34375-0.3333=0.0104$, which meets the bound exactly. That is not a coincidence: when $f''$ is constant, the estimate in the bound is tight. For Example 2, $f(x)=\frac1x$ gives $f''(x)=\frac{2}{x^3}$, largest at $x=1$ where $\max|f''|=2$, so the same bound $0.0104$ applies, and the true error $0.0039$ sits comfortably below it.
How Does The Trapezoidal Rule Compare To Simpson's Rule?
Both rules sample the curve at evenly spaced points; they differ in what they draw between the samples.
Table: Trapezoidal Rule versus Simpson's Rule.
Feature | Trapezoidal Rule | Simpson's Rule |
|---|---|---|
Connects points with | Straight chords (degree 1) | Parabolas (degree 2) |
Exact for | Linear functions | Cubic functions and below |
Error shrinks like | $\dfrac{1}{n^2}$ | $\dfrac{1}{n^4}$ |
Restriction on $n$ | Any $n\ge 1$ | $n$ must be even |
Depends on | $\max\lvert f''\rvert$ | $\max\lvert f^{(4)}\rvert$ |
Because Simpson's parabolas hug a bending curve far better than straight chords do, Simpson's Rule is usually more accurate for smooth functions at the same $n$. The Trapezoidal Rule wins on simplicity, works for any number of strips, and is steadier for rough or jagged data where a parabola would overreact. On our $\int_0^1 x^2,dx$, Simpson's Rule returns the exact $0.3333$, since a parabola matches $x^2$ perfectly, while the Trapezoidal Rule leaves the $0.0104$ error we saw.
Why Does The Trapezoidal Rule Work At All?
The rule works because a smooth curve, looked at closely enough, is nearly straight.
Over a short strip of width $h$, replacing the curve with the chord through its two endpoints is a small lie, and the size of that lie is controlled by how much the curve bends, that is, by $f''$.
Adding more strips makes each strip narrower, so each chord hugs the curve more tightly and every individual error shrinks.
The errors do not simply pile up: the $\frac{1}{n^2}$ in the bound says the total error falls even as the number of strips rises, because each strip's error falls faster than the strip count grows.
This is the same limiting idea that defines the integral itself. As $n\to\infty$ and $h\to 0$, the stacked trapezoids close in on the true area under the curve, so the Trapezoidal Rule is a finite, computable snapshot of the limit that calculus takes all the way.
Who Invented The Trapezoidal Rule?
The instinct to measure a curved region by straight-sided pieces is older than calculus itself, and far older than the name.
Archimedes (c. 287–212 BCE, Syracuse) never wrote the formula, but his exhaustion arguments are its logical root; Roger Cotes (1682–1716, England) gave the family its modern algebraic form.
Where Is The Trapezoidal Rule Used In The Real World?
The rule earns its keep wherever data arrives as a list of measured heights rather than as a formula you can integrate.
Engineering and physics: finding distance from a table of recorded speeds, or work from a force-versus-position graph, when only sampled readings exist.
Medicine and pharmacology: computing the "area under the curve" of a drug-concentration graph over time, a standard measure of total drug exposure.
Economics and finance: estimating accumulated cost, revenue, or consumer surplus from discrete data points on a curve.
Environmental and civil work: approximating the cross-sectional area of a river or the volume of earth to be moved from surveyed elevation readings.
Computing and signal processing: the default integrator behind many software routines that sum sensor data streams in real time.
The common thread is honest measurement: whenever the real world hands over numbers instead of a neat function, the Trapezoidal Rule turns that table of readings into an area.
What Are The Most Common Mistakes With The Trapezoidal Rule?
These four errors are the ones that recur on real student threads and error guides, from Physics Forums error-bound questions to Statistics How To and worked-example collections.
Doubling the endpoints too.
Where it slips in:
A student multiplies every height by 2, including the first and last, forgetting that the endpoints are counted only once.
Don't do this:
Do not write $\frac{h}{2}[2f(x_0)+2f(x_1)+\cdots+2f(x_n)]$. The two ends stand alone.
The correct way:
Count $f(x_0)$ and $f(x_n)$ once each; double only the interior heights $f(x_1)$ through $f(x_{n-1})$.
Confusing $n$ with the number of points.
Where it slips in:
A student sets $n$ to the count of sample points instead of the count of strips, so a table of 5 points is treated as $n=5$ when it is really $n=4$.
Don't do this:
Do not read $n$ off the number of $x$-values. With $5$ points there are only $4$ gaps.
The correct way:
Remember that $n$ is the number of subintervals, always one less than the number of sample points, and $h=\frac{b-a}{n}$ uses that $n$.
Not recomputing $h$ after changing $n$.
Where it slips in:
A student increases the number of strips to improve accuracy but reuses the old strip width, so the scaling factor $\frac{h}{2}$ no longer matches the points.
Don't do this:
Do not keep an old $h$. Every change in $n$ changes $h$.
The correct way:
Recompute $h=\frac{b-a}{n}$ each time $n$ changes, and re-list the sample points $x_0,\ldots,x_n$ to match.
Ignoring or misusing the error bound.
Where it slips in:
A student plugs $f''$ evaluated at a single convenient point into the bound instead of its maximum over $[a,b]$, or forgets the bound is a worst case, not the actual error.
Don't do this:
Do not use $f''(a)$ or $f''(b)$ automatically. The bound needs $\max|f''|$ over the whole interval.
The correct way:
Find where $|f''|$ is largest on $[a,b]$, checking the endpoints and any interior critical points, and use that maximum as $K$ in $|E_T|\le\frac{(b-a)^3}{12n^2}K$.
Practice Problems On The Trapezoidal Rule
Work each with the Trapezoidal Rule. Answers follow, rounded to 4 dp where needed.
Estimate $\int_0^2 x^2,dx$ with $n=4$.
(Answer: $h=0.5$; heights $0,0.25,1,2.25,4$; $T_4=0.25[0+2(0.25)+2(1)+2(2.25)+4]=2.75$. Exact $=\frac{8}{3}=2.6667$.)Estimate $\int_0^1 x^3,dx$ with $n=4$.
(Answer: $h=0.25$; heights $0,0.0156,0.125,0.4219,1$; $T_4=0.125[0+2(0.0156)+2(0.125)+2(0.4219)+1]=0.2656$. Exact $=0.25$.)A car's speed (m/s) is recorded every second: $0,,6,,10,,12,,11$. Estimate the distance travelled over these 4 seconds.
(Answer: $h=1$; $T_4=\frac{1}{2}[0+2(6)+2(10)+2(12)+11]=\frac{1}{2}(93)=46.5$ m.)Estimate $\int_1^3 \frac{1}{x},dx$ with $n=4$.
(Answer: $h=0.5$; heights $1,0.6667,0.5,0.4,0.3333$; $T_4=0.25[1+2(0.6667)+2(0.5)+2(0.4)+0.3333]=1.1167$. Exact $=\ln 3=1.0986$.)For $\int_0^1 x^2,dx$ with $n=4$, state the error bound and compare it to the true error.
(Answer: $f''=2$, bound $=\frac{1^3}{12(16)}(2)=0.0104$; true error $=0.34375-0.3333=0.0104$; the bound is met exactly.)
Where Should You Go Next After The Trapezoidal Rule?
The Trapezoidal Rule is your entry into numerical integration, and each door below goes one step deeper.
Simpson's Rule. The natural upgrade: parabolas instead of chords, exact for cubics, and much faster convergence for smooth curves.
Integration. Go back to the exact definite integral the Trapezoidal Rule approximates, and see when a clean antiderivative exists.
AP Calculus AB vs BC. Where the Trapezoidal Rule sits in the exam syllabus, and what each course expects. In the United States it follows the Common Core calculus pathway into AP Calculus, and in the United Kingdom it appears in the A-Level maths syllabus as the trapezium rule.
If your child is meeting numerical methods for the first time, a live Bhanzu trainer teaches the Trapezoidal Rule from the picture up (strips, chords, and error) in the Bhanzu math classes.
Was this article helpful?
Your feedback helps us write better content
