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.
Use x, ^ for powers, and sin, cos, tan, sqrt, ln, log, exp, abs, pi, e. Example: sqrt(1 + x^3)
| 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%) |
Show steps
- Δx = (b − a) ÷ n = (2 − 0) ÷ 4 = 0.5.
- Weighted sum f(x₀) + 2f(x₁) + … + f(xₙ) = 11.
- T = Δx ÷ 2 × sum = 0.5 ÷ 2 × 11 = 2.75.
How to use the calculator
- Type the function, such as x^2, sin(x) or 1/(1 + x^2). You can write 2x for 2·x.
- Enter the limits. They can be numbers or expressions such as pi/2.
- 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.
Quiz complete
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
- OpenStax Calculus Volume 2: Numerical integration
- Paul's Online Math Notes: Approximating definite integrals
Related calculators
More calculus calculators
Related to This Article
More math articles
- Opportunity Cost and Marginal Analysis: Make the Next Choice
- Electromagnetic Waves and Communication
- Algebra Puzzle – Challenge 48
- Calculus Simplified: Essential Integral Formulas for Mathematical Success
- Full-Length SSAT Upper Level Practice Test-Answers and Explanations
- FREE 5th Grade Common Core Math Practice Test
- How to Add and Subtract Functions? (+FREE Worksheet!)
- Algebra Puzzle – Challenge 46
- Mean, Median, Mode & Range Practice — Free Drills
- Clinton, NAFTA and the Third Way: Policy and Globalization


What people say about "Trapezoidal Rule Calculator: Approximate an Integral"?
No one replied yet.