Instead of using rectangles to approximate the area under the curve, trapezoids give a better approximation to the area.
The area of a trapezoid with base and heights and is given by:
To approximate the area under the curve, add up the area of all the trapezoids.
which can be simplified to become the trapezoidal rule: