Learning Outcomes
- Approximate the value of a definite integral by using the midpoint and trapezoidal rules
The Midpoint Rule
Earlier in this text we defined the definite integral of a function over an interval as the limit of Riemann sums. In general, any Riemann sum of a function f(x)f(x) over an interval [a,b][a,b] may be viewed as an estimate of ∫baf(x)dx∫baf(x)dx. Recall that a Riemann sum of a function f(x)f(x) over an interval [a,b][a,b] is obtained by selecting a partition
and a set
The Riemann sum corresponding to the partition PP and the set SS is given by n∑i=1f(x∗i)Δxin∑i=1f(x∗i)Δxi, where Δxi=xi−xi−1Δxi=xi−xi−1, the length of the ith subinterval.
The midpoint rule for estimating a definite integral uses a Riemann sum with subintervals of equal width and the midpoints, mimi, of each subinterval in place of x∗ix∗i. Formally, we state a theorem regarding the convergence of the midpoint rule as follows.
The Midpoint Rule
Assume that f(x)f(x) is continuous on [a,b][a,b]. Let n be a positive integer and Δx=b−anΔx=b−an. If [a,b][a,b] is divided into nn subintervals, each of length ΔxΔx, and mimi is the midpoint of the ith subinterval, set
Then limn→∞Mn=∫baf(x)dxlimn→∞Mn=∫baf(x)dx.
As we can see in Figure 1, if f(x)≥0f(x)≥0 over [a,b][a,b], then n∑i=1f(mi)Δxn∑i=1f(mi)Δx corresponds to the sum of the areas of rectangles approximating the area between the graph of f(x)f(x) and the x-axis over [a,b][a,b]. The graph shows the rectangles corresponding to M4M4 for a nonnegative function over a closed interval [a,b][a,b].

Figure 1. The midpoint rule approximates the area between the graph of f(x)f(x) and the x-axis by summing the areas of rectangles with midpoints that are points on f(x)f(x).
Example: Using the Midpoint Rule with M4M4
Use the midpoint rule to estimate ∫10x2dx∫10x2dx using four subintervals. Compare the result with the actual value of this integral.
Example: Using the Midpoint Rule with M6M6
Use M6M6 to estimate the length of the curve y=12x2y=12x2 on [1,4][1,4].
try it
Use the midpoint rule with n=2n=2 to estimate ∫211xdx∫211xdx.
The Trapezoidal Rule
We can also approximate the value of a definite integral by using trapezoids rather than rectangles. In Figure 2, the area beneath the curve is approximated by trapezoids rather than by rectangles.

Figure 2. Trapezoids may be used to approximate the area under a curve, hence approximating the definite integral.
The trapezoidal rule for estimating definite integrals uses trapezoids rather than rectangles to approximate the area under a curve. To gain insight into the final form of the rule, consider the trapezoids shown in Figure 2. We assume that the length of each subinterval is given by ΔxΔx. First, recall that the area of a trapezoid with a height of h and bases of length b1b1 and b2b2 is given by Area=12h(b1+b2)Area=12h(b1+b2). We see that the first trapezoid has a height ΔxΔx and parallel bases of length f(x0)f(x0) and f(x1)f(x1). Thus, the area of the first trapezoid in Figure 2 is
The areas of the remaining three trapezoids are
Consequently,
After taking out a common factor of 12Δx12Δx and combining like terms, we have
Generalizing, we formally state the following rule.
The Trapezoidal Rule
Assume that f(x)f(x) is continuous over [a,b][a,b]. Let n be a positive integer and Δx=b−anΔx=b−an. Let [a,b][a,b] be divided into nn subintervals, each of length ΔxΔx, with endpoints at P={x0,x1,x2…,xn}P={x0,x1,x2…,xn}. Set
Then, limn→+∞Tn=∫baf(x)dxlimn→+∞Tn=∫baf(x)dx.
Before continuing, let’s make a few observations about the trapezoidal rule. First of all, it is useful to note that
That is, LnLn and RnRn approximate the integral using the left-hand and right-hand endpoints of each subinterval, respectively. In addition, a careful examination of Figure 3 leads us to make the following observations about using the trapezoidal rules and midpoint rules to estimate the definite integral of a nonnegative function. The trapezoidal rule tends to overestimate the value of a definite integral systematically over intervals where the function is concave up and to underestimate the value of a definite integral systematically over intervals where the function is concave down. On the other hand, the midpoint rule tends to average out these errors somewhat by partially overestimating and partially underestimating the value of the definite integral over these same types of intervals. This leads us to hypothesize that, in general, the midpoint rule tends to be more accurate than the trapezoidal rule.

Figure 3. The trapezoidal rule tends to be less accurate than the midpoint rule.
Example: Using the Trapezoidal Rule
Use the trapezoidal rule to estimate ∫10x2dx∫10x2dx using four subintervals.
Watch the following video to see the worked solution to Example: Using the Trapezoidal Rule
For closed captioning, open the video on its original page by clicking the Youtube logo in the lower right-hand corner of the video display. In YouTube, the video will begin at the same starting point as this clip, but will continue playing until the very end.
You can view the transcript for this segmented clip of “3.6.1” here (opens in new window).
try it
Use the trapezoidal rule with n=2n=2 to estimate ∫211xdx∫211xdx.
Candela Citations
- 3.6.1. Authored by: Ryan Melton. License: CC BY: Attribution
- Calculus Volume 2. Authored by: Gilbert Strang, Edwin (Jed) Herman. Provided by: OpenStax. Located at: https://openstax.org/books/calculus-volume-2/pages/1-introduction. License: CC BY-NC-SA: Attribution-NonCommercial-ShareAlike. License Terms: Access for free at https://openstax.org/books/calculus-volume-2/pages/1-introduction