Suppose we take just two terms in the sum from Eq.(2) including just with
and
.
Then we have
What behavior of the function is consistent with taking just these two terms? We claim that if
we include just the functions 1 and x and demand that keeping just two terms in the Taylor
series, we can get and
. Also, since we need just two
weights for this lowest approximation, it makes sense that we would need behavior summarized in
two pieces of information about
the function's variation in the interval [a,b]. Another way of putting this is to say that taking
the functions 1 and x amounts to a restriction to values of x which are close to zero, or
thus necessarily values of a and b which are not too different.
So, let's demand that the integral of 1 and x over the interval be exactly equal to the
sum of two weights times two function values. That is we have
These represent two equations in two unknowns. When solved for and
we find that
The resulting approximation to the integral is called the trapezoid rule. The formula is:
where . Although we shall not show it here, it turns out to be the case that the
error made when using the trapezoid rule is
, so that if h is small, then
the error can become small. However, when h is not small, this approximation is just too
crude to be of general utility. The rule is called the trapezoid rule because the formula amounts
to approximating the integral assuming that the area under a trapezoid formed using the values
of the function at the ends of the interval.