Skip to content

Trapezoidal Rule Calculator

Enter two comma-separated lists, one of x values and one of y values. The calculator sums the trapezoids between each pair of points. For x = 0, 1, 2, 3, 4 and y = 0, 1, 4, 9, 16, the estimated area is 22.

Updated 2026-11-19 Editorial estimate Calccc Editorial Team Free · No sign-up

Comma- or space-separated, in increasing order.

One y value for each x value, in the same order.

Scenarios A/BSave two input sets and compare the results. Stored only in this browser.
AEmpty
BEmpty

Your inputs stay in this browser. No account, no uploads.

Professional worksheet

Detailed schedule & assumptions

Inputs used, method, sensitivity, and any year-by-year table. The summary above stays compact; the audit lives here.

Professional worksheet

Inputs, scope, and sensitivity

Inputs used

Method and scope

Result audit

MetricValue

What this calculator does

The trapezoidal rule is a numerical integration method: it approximates the area under a curve by joining consecutive data points with straight lines and adding the areas of the resulting trapezoids. It is useful when you have measurements rather than a formula, such as velocity readings over time, power demand over a day, or a set of experimental points. The rule is exact for linear data and becomes more accurate as the intervals get smaller. This calculator accepts unevenly spaced x values as well as even ones, checks that the x values are strictly increasing, and reports the estimated area, the number of intervals, the total width, and the average height. It is a practical estimator, not a symbolic integrator.

How to use it

  1. Enter the x values in increasing order, separated by commas or spaces.
  2. Enter one y value for each x value, in the same order.
  3. Check that both lists have the same number of values.
  4. Read the estimated area and the interval count.
  5. Use smaller intervals or more data points if you need a more accurate estimate.
  6. Compare the result with the average height times the total width as a sanity check.

How it works

Area ≈ Σ (xᵢ₊₁ - xᵢ) × (yᵢ + yᵢ₊₁) / 2, summed over consecutive pairs. For evenly spaced points with step h, this simplifies to h × (y₀/2 + y₁ + y₂ + … + yₙ₋₁ + yₙ/2). Average height = area / total width.

Example calculations

Example 1: y = x² from 0 to 4

The points (0,0), (1,1), (2,4), (3,9), and (4,16) give four trapezoids. The areas are 0.5, 2.5, 6.5, and 12.5, for a total of 22. The exact integral of x² from 0 to 4 is 64/3 ≈ 21.33, so the trapezoidal estimate is a little high because the curve is convex.

Example 2: A straight line

The points (0,0), (2,4), (4,8), (6,12), and (8,16) lie on a straight line. The trapezoids have areas 4, 12, 20, and 28, for a total of 64. The rule is exact for linear data, so this is the true area under the line.

Example 3: Unevenly spaced points

The points (0,2), (1.5,3.5), (3,5), and (4,6) have widths 1.5, 1.5, and 1. The trapezoid areas are 4.125, 6.375, and 5.5, for a total of 16. The average height is 4, which is a useful check: 4 × 4 = 16.

What the result means

The estimate is the sum of straight-line approximations, so it will be exact for data that lie on straight segments and approximate for curved data. For a convex curve, the trapezoids tend to overestimate; for a concave curve, they tend to underestimate. The average height is the constant height that would give the same area over the same width, which is a quick way to sense-check the result. If the x values are unevenly spaced, the formula still works, but each interval is weighted by its own width. More points usually improve accuracy, but noisy data can make a finer grid misleading.

Common mistakes

  • Entering x and y lists of different lengths.
  • Sorting x values incorrectly or leaving duplicates.
  • Using the simple evenly-spaced formula when the intervals are uneven.
  • Forgetting that the result is an approximation for curved data.
  • Mixing units between x and y without thinking about the area units.
  • Adding more points from a noisy measurement without smoothing or checking the data.

Assumptions and limits

  • The x values are strictly increasing.
  • Each y value corresponds to the x value in the same position.
  • The curve between consecutive points is approximated by a straight line.
  • The data are finite and the area is bounded by the first and last x values.
  • No extrapolation beyond the supplied points is performed.
  • The result is a numerical estimate, not an exact symbolic integral.

Frequently asked questions

What is the trapezoidal rule?

It is a numerical integration method that approximates the area under a curve by dividing it into trapezoids between consecutive data points and adding their areas.

Why is the estimate 22 rather than 21.33 in the example?

The exact integral of x² from 0 to 4 is 64/3 ≈ 21.33. The trapezoidal rule joins the points with straight lines, which sit above the convex curve, so the estimate is slightly high.

Can I use unevenly spaced x values?

Yes. The general formula uses each interval's actual width, so uneven spacing is fine as long as the x values are strictly increasing.

How can I improve the accuracy?

Use more points, especially where the curve changes quickly, and reduce measurement noise. For smooth functions with evenly spaced points, Simpson's rule often gives a better estimate for the same number of intervals.

What units does the area have?

The area has the units of y multiplied by the units of x. If x is in seconds and y is in metres per second, the area is in metres.

Does the calculator extrapolate beyond the data?

No. It only integrates between the first and last x values you enter. Extrapolation would require an assumption about the curve beyond the data, which is not part of the trapezoidal rule.

Sources

This calculator is an educational planning tool, not financial, legal, insurance, medical, or professional advice. Results depend on the inputs and on rules that vary by place and provider. Confirm important decisions with a qualified professional and the relevant documents.

2026 update

How to use the professional output

This page is not just a formula box. The result is designed to be checked, compared, and taken away.

  • Professional worksheet. The result includes the inputs used, the method and scope, and a one-variable sensitivity check for finance calculators.
  • A/B scenarios. Save two input sets in the browser and compare the primary, secondary, and breakdown figures side by side.
  • Print / PDF and CSV. Print a branded worksheet, or export the year-by-year table when the calculator produces one.

The formulas and assumptions above still govern the number. The worksheet makes the estimate auditable; it does not make it a lender quote, tax return, or personalized advice.

Calccc Editorial Team · Updated 2026-11-19

Prepared by Calccc Editorial Team as an educational estimate. This page is not a licensed professional review and is not financial, medical, legal, or tax advice.

Editorial estimate prepared by the Calccc Editorial Team; not a licensed professional review.