← MATH 161 MathScape 0 MATH161

The Midpoint Rule

4 min read

Jump to a section
Reference: Stewart §4.2

Textbook Reference

Primary source OpenStax Calculus Volume 2, Section 1.5: “Numerical Integration”
Direct link https://openstax.org/books/calculus-volume-2/pages/1-5-numerical-integration
Textbook used in class Stewart, Calculus, Section 4.2: “The Definite Integral”

Opening Scenario

Left- and right-endpoint Riemann sums give approximations that err in opposite directions for monotone functions. Each rectangle’s height is the function value at one end of the subinterval, which is typically the worst possible choice: the function is at its extreme for that subinterval.

A simple improvement: evaluate the function at the midpoint of each subinterval. The midpoint is neither the maximum nor the minimum on that subinterval, and using it tends to cancel the errors from the two halves of the subinterval. The Midpoint Rule is often twice as accurate as the endpoint rules for the same number of rectangles.


Quick Reference

Midpoint Rule: Divide $[a, b]$ into $n$ equal subintervals of width $\Delta x = \dfrac{b-a}{n}$. Let $\bar{x}_i$ be the midpoint of the $i$-th subinterval: $$\bar{x}_i = \frac{x_{i-1} + x_i}{2} = a + \left(i - \tfrac{1}{2}\right)\Delta x.$$

$$\int_a^b f(x)\,dx \approx M_n = \sum_{i=1}^{n} f(\bar{x}_i)\,\Delta x = \Delta x\bigl[f(\bar{x}_1) + f(\bar{x}_2) + \cdots + f(\bar{x}_n)\bigr].$$


Key Concepts

1. Why Midpoints Are Better

On a small subinterval, a smooth function is nearly linear. For a linear function, the midpoint value equals the average of the left and right endpoint values, so the midpoint rectangle exactly captures the area of the trapezoid under the linear piece. Non-linear functions deviate from a straight line, but on a short subinterval the deviation is tiny. The result is that the midpoint rule error scales with the square of the subinterval width, just like the endpoint rules -- but with a smaller error constant in practice.

The technical statement (proved in more advanced courses) is:

2. Setting Up the Midpoints

The $i$-th subinterval runs from $x_{i-1} = a + (i-1)\Delta x$ to $x_i = a + i\,\Delta x$. Its midpoint is: $$\bar{x}_i = a + \left(i - \frac{1}{2}\right)\Delta x.$$

For $n = 4$ on $[0, 2]$: $\Delta x = \frac{1}{2}$, so the midpoints are $\bar{x}_1 = \frac{1}{4}$, $\bar{x}_2 = \frac{3}{4}$, $\bar{x}_3 = \frac{5}{4}$, $\bar{x}_4 = \frac{7}{4}$.

3. When to Use Numerical Rules

The Midpoint Rule (and its relatives, the Trapezoidal Rule and Simpson’s Rule) are useful when:

The Fundamental Theorem of Calculus, when applicable, gives the exact answer in far fewer steps. The numerical rules are the fallback for integrands that resist antidifferentiation.

Common misconception

“The midpoint rule always overestimates or always underestimates.” Whether the midpoint rule over- or underestimates depends on the concavity of $f$, not monotonicity. For a concave-up function ($f'' > 0$), $M_n$ underestimates; for a concave-down function ($f'' < 0$), $M_n$ overestimates. The reasoning comes from the fact that the tangent line at the midpoint lies below a concave-up curve and above a concave-down curve.


Worked Example

Approximate $\displaystyle\int_1^3 \frac{1}{x}\,dx$ using $M_4$.

Step 1 -- Setup. $a = 1$, $b = 3$, $n = 4$, $\Delta x = \dfrac{2}{4} = \dfrac{1}{2}$.

Step 2 -- Midpoints. $\bar{x}_i = 1 + \left(i - \dfrac{1}{2}\right)\cdot\dfrac{1}{2}$:

$\bar{x}_1 = 1.25$, $\bar{x}_2 = 1.75$, $\bar{x}_3 = 2.25$, $\bar{x}_4 = 2.75$.

Step 3 -- Evaluate and sum.

$$M_4 = \frac{1}{2}\left[\frac{1}{1.25} + \frac{1}{1.75} + \frac{1}{2.25} + \frac{1}{2.75}\right]$$ $$= \frac{1}{2}[0.8000 + 0.5714 + 0.4444 + 0.3636]$$ $$= \frac{1}{2}(2.1794) \approx 1.0897.$$

Exact value: $\displaystyle\int_1^3 \frac{1}{x}\,dx = \ln 3 \approx 1.0986$.

Error: $|1.0986 - 1.0897| \approx 0.009$, less than 1%.

Boxed result: $M_4 \approx 1.090$ (exact: $\ln 3 \approx 1.099$).


Common Errors Summary

Error Example Correction
Using left or right endpoints instead of midpoints Setting $\bar{x}_i = a + i\,\Delta x$ Midpoints are $a + (i - \frac{1}{2})\Delta x$; the $-\frac{1}{2}$ shifts each endpoint to the center
Forgetting to multiply the sum by $\Delta x$ Reporting $f(\bar{x}_1)+\cdots+f(\bar{x}_n)$ as the approximation The width $\Delta x$ must multiply each height; the full formula is $M_n = \Delta x\sum f(\bar{x}_i)$
Assuming midpoint rule is always more accurate than trapezoidal Stating $M_n$ is always better Both have $O(1/n^2)$ error; which is closer depends on the specific function and interval

Leveled Practice

Level 1 -- Setup and Compute

Problem 1. Approximate $\displaystyle\int_0^1 x^2\,dx$ using $M_4$.

Show answer

$\Delta x = \frac{1}{4}$. Midpoints: $\frac{1}{8}, \frac{3}{8}, \frac{5}{8}, \frac{7}{8}$.

$M_4 = \frac{1}{4}\left[\left(\frac{1}{8}\right)^2 + \left(\frac{3}{8}\right)^2 + \left(\frac{5}{8}\right)^2 + \left(\frac{7}{8}\right)^2\right]$ $= \frac{1}{4}\left[\frac{1}{64} + \frac{9}{64} + \frac{25}{64} + \frac{49}{64}\right]$ $= \frac{1}{4}\cdot\frac{84}{64} = \frac{84}{256} = \frac{21}{64} \approx 0.328$.

Exact: $\frac{1}{3} \approx 0.333$. Error $\approx 0.005$.


Level 2 -- Concavity and Error Direction

Problem 2. For $f(x) = e^x$ on $[0, 1]$, is $M_4$ an over- or underestimate? Justify using concavity.

Show answer

$f''(x) = e^x > 0$ on $[0, 1]$, so $f$ is concave up. For a concave-up function, the midpoint rectangle lies below the curve (the tangent line at the midpoint undershoots the curve on both sides). Therefore $M_4$ underestimates $\displaystyle\int_0^1 e^x\,dx$.


Mastery Checklist


Mental Model

Left and right endpoint rectangles are like pricing something at the store’s opening or closing price -- each is systematically high or low depending on the trend. The midpoint is like pricing at noon: it is the center of the day’s range, and for a nearly linear trend the noon price is the best single estimate of the day’s average. Over an entire day of small subintervals, the midpoint estimates accumulate less error than the endpoint estimates.


Connections

Looking back

Looking ahead


Back to Integration Foundations | Next: Properties of the Definite Integral