This rule comes from determining the area of a right trapezoid with bases of lengthsf⁢(a)faf(a) and f⁢(b)fbf(b) respectively and a height of length hhh. When using a graph to illustrate the trapezoidal rule, the height of the right trapezoid is actually horizontal and the bases are vertical. This may be confusing to someone who is seeing the trapezoidal rule for the first time. An example is shown below.

xxxyyyf⁢(a)faf(a)f⁢(b)fbf(b)hhh.

The figure in red need not be a right trapezoid. If either f⁢(a)=0fa0f(a)=0 or f⁢(b)=0fb0f(b)=0, the figure will be a right triangle. If both f⁢(a)=0fa0f(a)=0 and f⁢(b)=0fb0f(b)=0, the figure will be a line segment. In any case, the same rule for approximating the corresponding definite integral is used.

It is important to note that most calculus books give the wrong definition of the trapezoidal rule. Typically, they define it to be what is actually the composite trapezoidal rule, which uses the trapezoidal rule on a specified number of subintervals. Some examples of calculus books that define the trapezoidal rule to be what is actually the composite trapezoidal rule are: