Skip to content
LoveToCalc

Definition — what does that mean?

Trapezoidal rule

When an integral cannot be worked out exactly, cut the area into strips, draw a straight line across the top of each and add up the trapezoids.

In Swedish: Trapetsregeln

Trapezoidal rule

The relation

Tn=b−a2n(f(a)+2(n−1Σi=1f(a+i·b−an))+f(b))

Split [a, b] into n equal strips, replace the curve over each strip by a straight line, and add up the trapezoids. The ends count once and every inner point twice.

A function of x, for example x^2, sin(x) or e^(-x)

Tn≈0.3438

T n equals ((1 minus 0) divided by (2 times 4)) times ((0 squared plus (2 times (the sum for i from 1 to (4 minus 1) of (0 plus (i times ((1 minus 0) divided by 4))) squared))) plus 1 squared), equals ((1 minus 0) divided by (2 times 4)) times ((0 squared plus (2 times ((0 plus (1 times ((1 minus 0) divided by 4))) squared plus (0 plus (2 times ((1 minus 0) divided by 4))) squared plus (0 plus (3 times ((1 minus 0) divided by 4))) squared))) plus 1 squared), equals (1 divided by 8) times ((0 plus (2 times ((0 plus (1 times (1 divided by 4))) squared plus (0 plus (2 times (1 divided by 4))) squared plus (0 plus (3 times (1 divided by 4))) squared))) plus 1), equals 0.125 times ((0 plus (2 times ((0 plus (1 times 0.25)) squared plus (0 plus (2 times 0.25)) squared plus (0 plus (3 times 0.25)) squared))) plus 1), equals 0.125 times ((0 plus (2 times ((0 plus 0.25) squared plus (0 plus 0.5) squared plus (0 plus 0.75) squared))) plus 1), equals 0.125 times ((0 plus (2 times (0.25 squared plus 0.5 squared plus 0.75 squared))) plus 1), equals 0.125 times ((0 plus (2 times (0.0625 plus 0.25 plus 0.5625))) plus 1), equals 0.125 times ((0 plus (2 times 0.875)) plus 1), equals 0.125 times ((0 plus 1.75) plus 1), equals 0.125 times (1.75 plus 1), equals 0.125 times 2.75, is approximately 0.3438

Working12 steps

The formula

a and b are the limits of the integral, n the number of strips and Tn the approximation. The strips are all h = (b − a)/n wide. The sum runs over the inner points, where two trapezoids meet: each of them is counted twice, the two ends once.

Type your own function into the card above, change the limits and the number of strips, and the card adds the trapezoids for you.

Where it comes from

A trapezoid of width h with the heights y0 and y1 has the area h · (y0 + y1)/2. Put n of them side by side under the curve and add: every height except the first and last belongs to two trapezoids, which is where the 2 comes from, and the common factor h/2 is the (b − a)/(2n) in front.

Worked example: x² from 0 to 1

The exact answer is 1/3 ≈ 0.333 333. With n = 4 the strips are 0.25 wide and the heights are 0, 0.0625, 0.25, 0.5625 and 1:

The rule overshoots here, because x² curves upwards and every straight line lies above the curve.

n Tn Error
2 0.375 0.041 667
4 0.343 75 0.010 417
8 0.335 938 0.002 604
100 0.333 350 0.000 017

Twice as many strips give a quarter of the error. That is the rule’s signature: the error shrinks with the square of the strip width.

An integral with no formula

e−x² has no antiderivative that can be written with ordinary functions, yet its integral from 0 to 1 is needed often in statistics. With n = 4:

The true value is 0.746 824, so four strips are already within 0.004. Simpson’s rule gets within 0.000 04 with the same points.

How large the error is

For a function with a continuous second derivative the error is at most

A straight line is exact, since f″ = 0. The more the curve bends, the more strips are needed.

Common mistakes

Frequently asked questions

When should I use the trapezoidal rule instead of Simpson’s rule? When the values come from a table of measurements at uneven intervals, or when there is an odd number of strips. For a smooth function given as a formula, Simpson’s rule is almost always more accurate for the same work.

Is it the same as a Riemann sum? Almost. It is the average of the left and the right Riemann sums, and usually more accurate than either of them.

Looking for another letter? The formula solved for each one
Solved for each letter
Solve forRearranged
Tnb−a2n(f(a)+2(n−1Σi=1f(a+i·b−an))+f(b))

Last reviewed October 6, 2026 ·How pages are reviewed

Calculate it in practice

CalculusAll formulas

Put this formula on your site

Copy the code into your page where the formula card should appear. It loads from lovetocalc.com, so it stays current on its own — all we ask is that the credit line comes with it.