Single Trapezoid (n = 1)
(b − a)(f(a) + f(b)) / 2. For eˣ on [0, 2]: 8.3891, an error of 2.0.
Trapezoidal rule for f(x) on [a, b] with the f″ error bound and the n you need.
Enter your values below to get started.
Write powers with ^: x^3, e^(-x^2).
Limits accept pi, e and fractions like 1/2.
Fill in Target error to get the n that the error bound guarantees.
Double n and the trapezoidal error drops about 4×.
A trapezoidal sum calculator estimates a definite integral ∫ab f(x) dx by joining the points of f(x) with straight lines and adding the areas of the n trapezoids underneath. Enter the function, the limits and n to get Tn, the weighted node table, the error against the exact integral, the error bound (b − a)³K / 12n² and the smallest n that meets a target error.
A trapezoidal sum is an estimate of the area under a curve made by adding the areas of n trapezoids whose top edges are straight lines between neighboring points of f(x). The method is called the trapezoidal rule, and the result is written Tn.
A trapezoid follows a sloping curve more closely than a flat rectangle. For f(x) = x² on [0, 2], 4 trapezoids give T4 = 2.75 against the exact area 8/3 ≈ 2.6667, an error of 0.0833. The left Riemann sum with the same 4 strips is 1.75, an error 11 times larger.
The trapezoidal sum calculator splits [a, b] into n equal strips, evaluates f(x) at the n + 1 nodes, weights the 2 end values by 1 and the n − 1 interior values by 2, and multiplies the weighted sum by Δx / 2. The calculator then measures the error against a reference integral (Simpson's rule with 2,000 subintervals) and estimates K = max |f″(x)| from 1,000 sample points to produce the error bound.
Δx = (b − a) / n. For [0, 2] and n = 4, Δx = 0.5.
xi = a + iΔx for i = 0 … n. With n = 4 there are 5 nodes: 0, 0.5, 1, 1.5, 2.
End nodes count once, interior nodes count twice: 1, 2, 2, 2, 1.
T4 = 0.25 × (0 + 0.5 + 2 + 4.5 + 4) = 0.25 × 11 = 2.75.
The trapezoidal sum formula is Tn = (Δx / 2)[f(x0) + 2f(x1) + ⋯ + 2f(xn−1) + f(xn)], with Δx = (b − a) / n. The same value comes from 3 equivalent forms.
A strip of width Δx with parallel sides f(xi−1) and f(xi) has area equal to the width times the average height.
Adding the n strip areas makes every interior value appear twice, which gives the weights 1, 2, …, 2, 1.
For equal strips, Tn is exactly the mean of the left sum Ln and the right sum Rn. For x² on [0, 2] with n = 4: (1.75 + 3.75) / 2 = 2.75.
There are 4 common types of trapezoidal rules: the single trapezoid, the composite rule with equal spacing, the rule with uneven spacing, and the end-corrected rule. On ∫02 eˣ dx = e² − 1 ≈ 6.3891, the 4 types give errors from 2.0 down to 0.0006.
(b − a)(f(a) + f(b)) / 2. For eˣ on [0, 2]: 8.3891, an error of 2.0.
The standard Tn with weights 1, 2, …, 2, 1. For n = 4: 6.5216, an error of 0.1325.
Each strip has its own width Δxi. Used for measured data; see the trapezoidal sum table calculator.
Subtracts (Δx² / 12)(f′(b) − f′(a)). For n = 4: 6.3885, an error of only −0.0006.
Werner Romberg (1955) combined Tn and T2n as (4T2n − Tn) / 3, which equals Simpson's rule.
To calculate a trapezoidal sum by hand, find Δx, list the n + 1 nodes, evaluate f at each node, apply the weights 1, 2, …, 2, 1, add, and multiply by Δx / 2. Here is T4 for f(x) = 1/x on [1, 3].
The error of a trapezoidal sum is at most (b − a)³K / (12n²), where K is the largest value of |f″(x)| on [a, b]. The bound shrinks with 1/n², so doubling n cuts the guaranteed error by 4.
Solving the bound for n gives the number of trapezoids that guarantees a target error ε: n ≥ √((b − a)³K / 12ε). For x² on [0, 2], K = 2 and ε = 0.001 give n ≥ 36.5, so n = 37. For f(x) = x², the bound and the actual error are equal (0.0833 at n = 4), since f″ is constant.
A trapezoidal sum overestimates when f is concave up (f″ > 0) and underestimates when f is concave down (f″ < 0). On a concave-up curve, every chord lies above the graph; on a concave-down curve, every chord lies below it.
Type f(x), enter a, b and n, optionally add a target error, and press Calculate. The result card shows Tn, the actual error, the error bound and the n that meets your target; the tabs hold the steps, the trapezoid graph and the weighted node table.
Use x as the variable, for example x^3 + 1 or ln(x).
a and b are the limits; n is the number of trapezoids (1 to 10,000).
Optional. Type 0.001 to get the smallest n with |error| ≤ 0.001.
The Table tab lists every node, its weight and its weighted value.
Trapezoidal sums turn readings taken at intervals into a total area or amount. 5 common uses:
Common trapezoidal rule problems with their exact integrals and error bounds.
| Integral | n | Tₙ | Exact | Error bound | Calculator |
|---|---|---|---|---|---|
| 4 | 2.75 | 2.6667 | 0.0833 | ||
| 4 | 4.25 | 4 | 0.5 | ||
| 4 | 1.8961 | 2 | 0.1615 | ||
| 4 | 1.1167 | 1.0986 | 0.0833 | ||
| 10 | 1.7197 | 1.7183 | 0.00227 | ||
| 10 | 0.74621 | 0.74682 | 0.00167 |
Work each one by hand, then reveal the answer or solve it in the calculator.
Trapezoidal sum of f(x) = x³ on [0, 2] with n = 4.
Trapezoidal sum of f(x) = 1/x on [1, 2] with n = 2.
Estimate π as 4·T₄ of f(x) = 1/(1 + x²) on [0, 1].
Trapezoidal sum of f(x) = x³ on [−1, 2] with n = 3. Is it an over- or underestimate?
Smallest n that guarantees an error of at most 0.0001 for ∫₀¹ eˣ dx.
Trapezoidal sum of f(x) = sin x on [0, π] with n = 6.
Discover 67 free sum calculators across different categories. Find the right calculator for your needs.
Try a different name or choose another category.
A trapezoidal sum calculator is an online tool that estimates ∫ f(x) dx on [a, b] with the trapezoidal rule. It returns Tₙ, the steps, a table of weighted nodes, the error bound and a graph of the trapezoids.
Tₙ = (Δx / 2)[f(x₀) + 2f(x₁) + ⋯ + 2f(xₙ₋₁) + f(xₙ)], where Δx = (b − a) / n and xᵢ = a + iΔx.
Yes, when all subintervals have the same width, Tₙ = (Lₙ + Rₙ) / 2. For x² on [0, 2] with n = 4, (1.75 + 3.75) / 2 = 2.75.
The trapezoidal rule overestimates when f is concave up on [a, b], since every chord lies above the curve. The rule underestimates when f is concave down.
The error is at most (b − a)³K / (12n²), where K = max |f″(x)| on [a, b]. For x² on [0, 2] with n = 4, the bound is 8 × 2 / 192 ≈ 0.0833.
Use n ≥ √((b − a)³K / 12ε), where ε is the target error. For eˣ on [0, 1] with ε = 0.0001, K = e and n ≥ 47.6, so n = 48.
No, for most smooth functions the midpoint rule error is about half the trapezoidal error, and the 2 errors have opposite signs.
Yes, the trapezoidal rule is exact for every linear function f(x) = mx + c, since f″ = 0 and each chord lies on the line.
Babylonian astronomers used a trapezoid area rule to track the motion of Jupiter between 350 and 50 BCE, as shown by Mathieu Ossendrijver in 2016. The modern composite form was developed alongside calculus in the 17th century.
A trapezoidal sum replaces the curve with straight chords and adds n trapezoids, and the trapezoidal sum calculator returns Tn, its error and its error bound for any f(x), [a, b] and n. Use the weights 1, 2, …, 2, 1, check concavity to know the sign of the error, and use the (b − a)³K / 12n² bound to pick n before you start.
Not sure the trapezoidal rule is the right method? Answer 3 questions below.