Trapezoidal Rule Calculator

CalculusFreeNo sign-up

The trapezoidal rule estimates ∫ab f(x) dx by joining points on the curve with straight lines: T = Δx ÷ 2 × [f(x₀) + 2f(x₁) + … + 2f(xn−1) + f(xn)], with Δx = (b − a) ÷ n. For f(x) = x² on [0, 2] with n = 4, T = 2.75, close to the exact 8⁄3 ≈ 2.6667.

FreeNo sign-up

Use x, ^ for powers, and sin, cos, tan, sqrt, ln, log, exp, abs, pi, e. Example: sqrt(1 + x^3)

Trapezoidal estimate
2.75
∫ from 0 to 2 of x^2 dx ≈ 2.75 using 4 trapezoids of width 0.5.
i, xᵢ, f(xᵢ), weight
x0 = 0 f = 0, × 1
x1 = 0.5 f = 0.25, × 2
x2 = 1 f = 1, × 2
x3 = 1.5 f = 2.25, × 2
x4 = 2 f = 4, × 1
Estimates
Trapezoidal rule (n = 4) 2.75
Midpoint rule (n = 4) 2.625
Simpson's rule (n = 4) 2.66666667
High-accuracy value 2.66666667
Trapezoid error 0.08333333 (3.125%)
The high-accuracy value uses Simpson's rule with 20,000 strips. Doubling n cuts the trapezoid error by about 4 for smooth functions.
Show steps
  1. Δx = (b − a) ÷ n = (2 − 0) ÷ 4 = 0.5.
  2. Weighted sum f(x₀) + 2f(x₁) + … + f(xₙ) = 11.
  3. T = Δx ÷ 2 × sum = 0.5 ÷ 2 × 11 = 2.75.

How to use the calculator

  1. Type the function, such as x^2, sin(x) or 1/(1 + x^2). You can write 2x for 2·x.
  2. Enter the limits. They can be numbers or expressions such as pi/2.
  3. Choose the number of trapezoids n and press Calculate. For n up to 20 you see every x value, f(x) and its weight.

Trapezoidal rule formula

∫ab f(x) dx ≈ (Δx ÷ 2) [f(x₀) + 2f(x₁) + 2f(x₂) + … + 2f(xn−1) + f(xn)]

The end points are counted once and every inside point twice, because each inside point is shared by two trapezoids.

Example: ∫02 x² dx with n = 4. Δx = 0.5, x = 0, 0.5, 1, 1.5, 2 and f = 0, 0.25, 1, 2.25, 4. T = 0.25 × (0 + 0.5 + 2 + 4.5 + 4) = 0.25 × 11 = 2.75. The exact answer is 8⁄3 ≈ 2.6667.

Accuracy and other rules

Rule Idea Error shrinks like
Left or right sum Rectangles 1⁄n
Trapezoidal Straight lines 1⁄n²
Midpoint Rectangles at the middle 1⁄n² (about half the trapezoid error)
Simpson Parabolas, n even 1⁄n⁴

When the curve bends upward (concave up) the trapezoidal rule overestimates; when it bends downward it underestimates. The error bound is |E| ≤ (b − a)³ max|f″| ÷ (12n²).

Trapezoidal rule practice questions

Test yourself with 6 multiple-choice questions. Choose an answer and press Submit to see if you are right and why. Your score appears at the end.

Question 1 of 6
1. With a = 0, b = 6 and n = 3, what is Δx?

Found a mistake? Let us know!

2. In the trapezoidal rule, inside points are multiplied by…

Found a mistake? Let us know!

3. Use one trapezoid (n = 1) for ∫02 x² dx.

Found a mistake? Let us know!

4. For a concave-up function, the trapezoidal rule usually…

Found a mistake? Let us know!

5. For which function is the trapezoidal rule exact?

Found a mistake? Let us know!

6. Doubling n makes the trapezoid error about…

Found a mistake? Let us know!

Frequently asked questions

What is the trapezoidal rule?

It is a way to estimate a definite integral by splitting the area under a curve into trapezoids and adding their areas.

How do you use the trapezoidal rule?

Find Δx = (b − a) ÷ n, evaluate f at each x value, add the end values once and the inside values twice, then multiply by Δx ÷ 2.

Is the trapezoidal rule more accurate than Simpson's rule?

Usually not. For smooth functions Simpson's rule is far more accurate for the same n, because it fits parabolas instead of straight lines.

Can n be odd?

Yes. The trapezoidal rule works for any whole number n of 1 or more. Only Simpson's rule needs n to be even.

Sources

Related calculators

Browse all calculators

More calculus calculators

Browse all 544 calculators

Related to This Article

What people say about "Trapezoidal Rule Calculator: Approximate an Integral"?

No one replied yet.

Leave a Reply