Trapezoidal Rule Calculator
Approximate definite integrals using the composite trapezoidal rule.
Function
Integration Bounds
Number of Intervals (n)
Step size h = 0.250000
Trapezoid Areas
| x | f(x) | Area |
|---|---|---|
| 0.0000 | 0.000000 | 0.007813 |
| 0.2500 | 0.062500 | 0.039063 |
| 0.5000 | 0.250000 | 0.101563 |
| 0.7500 | 0.562500 | 0.195313 |
Integral of x^2 from 0 to 1
0.34375000
Composite Trapezoidal Rule with n=4
Single Trapezoid
0.50000000
Step Size (h)
0.250000
Error Analysis
Exact Value0.33333333
Absolute Error1.0417e-2
Relative Error3.125000%
Trapezoidal Rule Formula
Integral = h * [f(x0)/2 + f(x1) + f(x2) + ... + f(xn)/2]
Error: O(h^2) - Improves as n increases
About Trapezoidal Rule
- Approximates f(x) with straight line segments
- Simple to implement and understand
- Error decreases with more intervals
- Exact for linear functions
- Works for any number of intervals