Overview
The Trapezoidal Rule replaces the curve between neighboring sample points with a straight line and adds the resulting trapezoid areas.
Approximates an integral by summing trapezoid areas under sampled function values.
Compact metadata for implementation and discovery.
The Trapezoidal Rule replaces the curve between neighboring sample points with a straight line and adds the resulting trapezoid areas.
Quick facts
Runtime and memory behavior at a glance.
Best
O(n)
Average
O(n)
Worst
O(n)
Space
O(1)
integral_a^b f(x) dx ~= h * (f(a)/2 + sum f(x_i) + f(b)/2)Approximates an integral by summing trapezoid areas.
Show the numeric approximation improving against the target function, matrix, or state.
The trapezoidal rule is exact for linear functions over each interval.
What each reference supports for this entry.
Reference text and implementation-oriented treatment for root finding, interpolation, integration, and ODE methods.
Open sourceGood next jumps from the relationship graph, ranked for useful discovery.
Romberg integration refines trapezoidal estimates through extrapolation.
Both estimate definite integrals with different polynomial assumptions.