Skip to main content

Limited time: save up to 25% on spreadsheet models and templates.

Explore templates
10XSheets

Free calculator

Trapezoidal rule calculator (pasted x and y for ∫y dx)

Paste paired x and y values from Google Sheets, Excel, or plain text to approximate ∫ y dx with the composite trapezoidal rule. Uneven x spacing is fine—we sort by x, then sum (xᵢ₊₁ − xᵢ)(yᵢ + yᵢ₊₁)/2 across each segment. The Google Sheets & Excel section shows SUMPRODUCT patterns—not a symbolic f(x) solver or step-by-step CAS.

Educational and illustrative only. This is not a computer algebra system, improper-integral engine, or substitute for your course’s required “show work” format—verify assumptions when grades or decisions depend on the result.

When to use this calculator

Quick numerical integration checks on tabular data before you mirror the same logic in a workbook.

  • Homework or labs: verify a composite trapezoidal sum from (x, y) samples against textbook steps.
  • Match a SUMPRODUCT column in Sheets or Excel against this page for the same pasted pairs.
  • Rough area under a curve from measured or simulated samples when you already have y at known x.
  • Need a least squares line instead of an integral? Use the linear regression tool linked below.
How does the trapezoidal rule work on pasted data?

You start from n + 1 points (xᵢ, yᵢ) with yᵢ ≈ f(xᵢ) on a sampled curve. The composite trapezoidal rule replaces the graph between each consecutive pair by a straight segment, adds the trapezoid areas, and returns an approximation to ∫ y dx over the span from the smallest x to the largest x you supplied.

Sort and validate x

Rows are sorted by x ascending so pasted columns need not be pre-ordered. After sorting, x must be strictly increasing—duplicate x values stop the calculation because Δx would be 0.

Add trapezoid areas

For each consecutive pair, add (xᵢ₊₁ − xᵢ)(yᵢ + yᵢ₊₁)/2. With uniform spacing h, that collapses to the familiar h/2 · (y₀ + 2y₁ + … + 2yₙ₋₁ + yₙ) pattern.

Total and optional table

The approximate integral is the sum of all partial areas. Expand the interval table to audit each Δx, segment area, and running cumulative total.

We do not evaluate arbitrary f(x) expressions, Simpson’s or midpoint rules as separate engines here, or adaptive quadrature—use a CAS or graphing tool when you need those features.

For paired (x, y) regression (slope and intercept), open the linear regression calculator.

FAQs cover uneven spacing, Sheets/Excel parity, Simpson’s rule in words, and why your total might differ from a graphing calculator that samples f(x) internally.

Google Sheets & Excel

Put x in one column (say A) and y in the next (B), same row for each sample. The trapezoidal sum is Σ (Aᵢ₊₁ − Aᵢ)(Bᵢ₊₁ + Bᵢ)/2, which you can write with SUMPRODUCT on shifted ranges. Replace A2:A99 / B2:B99 with your ranges; keep one more row than intervals so each Δx is defined. If your Excel is not in English, use FormulasInsert function to find SUMPRODUCT under your language pack’s own name.

SUMPRODUCT trapezoidal sum
=SUMPRODUCT((A3:A99-A2:A98),(B3:B99+B2:B98)/2)

x in A, y in B; one fewer row in the shifted block so each Δx pairs two consecutive x values.

Spot-check one trapezoid
=(A3-A2)*(B3+B2)/2

First interval only—sum these cells down the sheet to reconcile with the full SUMPRODUCT line.

More tools in Spreadsheet math

Browse all tools

Frequently asked questions

What is the trapezoidal rule?

The trapezoidal rule approximates ∫ y dx by connecting consecutive (x, y) points with straight segments and summing the trapezoid areas between them. With n equal subintervals of width h, textbooks often write h/2 · (y₀ + 2y₁ + … + 2yₙ₋₁ + yₙ)—this page uses the same geometry, generalized to unequal Δx when your samples are not evenly spaced.

Do I need evenly spaced x values?

No. After sorting by x, each term uses the actual (xᵢ₊₁ − xᵢ) width. Even spacing is a convenient special case where every Δx is the same h.

Can I type a formula like f(x) = x^2 instead of y values?

Not on this page. Enter y at each x you care about (paste from a workbook or a graphing tool’s table). Symbolic integrators and CAS step-by-step pages are a different product shape than our spreadsheet-first table workflow.

How do I paste from Google Sheets or Excel?

Select two adjacent columns (x left, y right is easiest), copy, and paste into the box—tabs usually survive. If order looks wrong, rely on auto-sort by x; fix duplicate x at the same abscissa before integrating.

How does SUMPRODUCT match this calculator?

Align x in A2:A and y in B2:B so row k is one sample. With n intervals and n+1 rows, =SUMPRODUCT((A3:A{n+2}-A2:A{n+1}),(B3:B{n+2}+B2:B{n+1})/2) reproduces the same sum as this page when ranges match.

How does this compare to Simpson’s rule or the midpoint rule?

Simpson’s rule fits parabolas across triples of points (even n subintervals on uniform grids) and is often more accurate for smooth functions at the same cost. The midpoint rule uses rectangle heights at interval midpoints. This tool is trapezoidal-only; compare methods in your text or CAS when an assignment specifies one rule.

Why is my answer slightly different from Desmos or my textbook?

Different tools may use different samples of the same underlying function, round intermediate values differently, or apply another rule (Simpson, adaptive quadrature). Match exactly the same (x, y) pairs and formula to reconcile with this page.

Does the tool change my data order?

We sort internally by x to build consecutive trapezoids. Your textarea text is not rewritten; the sorted order is what drives the sum shown on the results card.

What is the German Excel name for SUMPRODUCT?

Many German installs use SUMMENPRODUKT for the same elementwise multiply-and-sum pattern. Confirm with FormelnFunktion einfügen on your build.

What is the French Excel name for SUMPRODUCT?

You will often see SOMMEPROD (or legacy labels depending on version). Use FormulesInsérer une fonction to match your language pack.

Is this a computer algebra system?

No. There is no symbolic derivative or antiderivative engine—only finite arithmetic on the numbers you paste.

Is this suitable for exams or graded submissions by itself?

No. It is a transparent homework and spreadsheet companion. When an instructor requires intermediate steps, typeset work, or a specific technology, follow those instructions—use this page to check numeric totals when allowed.