Tutorials › Calculus II › Nested Grids and Successive Quadrature

Quadrature and Error Bounds · Tutorial 368 of 998

Nested Grids and Successive Quadrature

Refine a grid efficiently, compare successive quadrature estimates, and judge whether the values appear to be stabilizing.

Intermediate 11 min read

What You'll Learn

  • Define nested equally spaced grids and track how the panel width changes under refinement.
  • Reuse old function values when refining composite trapezoidal estimates.
  • Reuse old nodes and add midpoint values when refining composite Simpson estimates.
  • Calculate absolute and relative changes between successive estimates.
  • Distinguish evidence of stabilization from a guaranteed bound on the true error.
  • Recognize how uneven or large successive changes can warn that an estimate is not yet stable.

Why Refine a Quadrature Grid?

When an integral is estimated from function values, a single numerical result does not show how sensitive that result is to the chosen panel width. Repeating the calculation on a finer grid provides a useful diagnostic: if the estimates change very little as the grid is refined, the sequence may be stabilizing. If they change substantially, the current estimates may not yet be dependable.

Refining an equally spaced grid by halving its panel width has a practical advantage. Every point from the coarser grid remains on the finer grid. The grids are nested, so previously calculated function values can be reused; only the newly inserted points need to be evaluated. This tutorial develops that process for composite trapezoidal and composite Simpson estimates.

Key caution: Agreement between successive estimates is evidence about numerical stability, not by itself a proof of accuracy. A numerical error bound requires additional information about the integrand and the quadrature rule.

Nested Equally Spaced Grids

Let the interval be \([a,b]\), and divide it into \(n\) equal panels, where \(n\) is a positive integer. The panel width is \(h=(b-a)/n\), and the grid points are \(x_i=a+ih\), for \(i=0,1,\ldots,n\). Halving the panel width doubles the number of panels: the refined grid has \(2n\) panels and width \(h/2\).

Each old point \(x_i\) is still on the refined grid: it is the point with refined index \(2i\). The new points are the midpoints of the old panels, \(x_i+h/2\), for \(i=0,\ldots,n-1\). Thus refinement does not discard earlier data.

Definition: Two equally spaced grids on the same interval are nested in this refinement when the finer grid contains every point of the coarser grid. Halving the panel width gives a nested grid with twice as many panels.

Reusing Values for the Trapezoidal Rule

For \(n\) equal panels of width \(h\), the composite trapezoidal estimate is

$$ T_n = h\left[ \frac{f(a)}{2} +\sum_{i=1}^{n-1} f(a+ih) +\frac{f(b)}{2} \right]. $$

To refine it, retain all values at old grid points and evaluate \(f\) at the \(n\) new midpoints. The refined trapezoidal estimate satisfies a simple update formula.

Refinement formula: If the coarse grid has \(n\) panels of width \(h\), then $$ T_{2n}=\frac{1}{2}T_n+\frac{h}{2}\sum_{i=0}^{n-1} f\left(a+\left(i+\frac12\right)h\right). $$

The factor \(h/2\) is the refined panel width. The formula can also be obtained by writing out the composite trapezoidal rule on the finer grid and grouping its old-point and new-midpoint contributions.

1
Keep the coarse estimate.
The contribution from old grid points in the refined rule is half of \(T_n\), because the refined panel width is \(h/2\).
2
Add the new midpoint values.
Each newly inserted midpoint has coefficient \(h/2\) in the refined trapezoidal sum.
3
Combine the terms.
The old-point contribution and the new-point contribution give the stated expression for \(T_{2n}\).

For completeness, the old-point contribution is \((h/2)[f(a)/2+\sum_{i=1}^{n-1}f(a+ih)+f(b)/2]=T_n/2\). The new points have coefficient \(h/2\) each, which proves the update formula.

Worked Example: Refining a Trapezoidal Estimate

Estimate \(\int_0^1 x^2\,dx\) with \(n=2\), then refine to \(n=4\). The coarse width is \(h=1/2\). The grid values are \(f(0)=0\), \(f(1/2)=1/4\), and \(f(1)=1\), so

$$ T_2=\frac12\left[\frac{0}{2}+\frac14+\frac{1}{2}\right] =\frac12\left(\frac34\right) =\frac38. $$

The new points are \(1/4\) and \(3/4\). Their function values are \(f(1/4)=1/16\) and \(f(3/4)=9/16\). Apply the refinement formula:

$$ \begin{aligned} T_4 &=\frac12\left(\frac38\right) +\frac{1/2}{2}\left(\frac{1}{16}+\frac{9}{16}\right)\\ &=\frac{3}{16}+\frac14\left(\frac{10}{16}\right)\\ &=\frac{3}{16}+\frac{5}{32} =\frac{11}{32}. \end{aligned} $$

Checking directly with the four-panel formula gives \(T_4=(1/4)[0+1/16+1/4+9/16+1/2]=11/32\), agreeing with the update. The exact integral is \(1/3\), so both estimates are below it, and the refined estimate is closer: \(|1/3-3/8|=1/24\), whereas \(|1/3-11/32|=1/96\).

Nested Refinement for Simpson’s Rule

The composite Simpson rule applies when the number of panels is even. If \(n\) is even and \(h=(b-a)/n\), its estimate is

$$ S_n=\frac{h}{3}\left[ f(a)+f(b) +4\sum_{\substack{1\leq i\leq n-1\\ i\ \mathrm{odd}}}f(a+ih) +2\sum_{\substack{2\leq i\leq n-2\\ i\ \mathrm{even}}}f(a+ih) \right]. $$

Halving \(h\) takes an even panel count \(n\) to the even panel count \(2n\), so the refined grid can also be used for Simpson’s rule. Every old point is retained, and the newly inserted midpoints are added. The weights change when the rule is recomputed: in the refined rule, old interior points have weight \(2\), while new midpoint points have weight \(4\), within the bracketed sum.

In particular, write \(x_i=a+ih\) for the old nodes. The refined estimate is

$$ S_{2n}=\frac{h}{6}\left[ f(a)+f(b) +2\sum_{i=1}^{n-1}f(x_i) +4\sum_{i=0}^{n-1}f\left(x_i+\frac{h}{2}\right) \right]. $$

This expression is the composite Simpson rule with refined width \(h/2\), written to make the reused old values and new midpoint values visible. Unlike the trapezoidal rule, there is no need to treat a Simpson update as a fixed fraction of the earlier Simpson estimate: recompute the weights using the refined grid.

Worked Example: Comparing Two Simpson Estimates

Estimate \(\int_0^1 x^4\,dx\) with \(n=2\) and \(n=4\). For \(n=2\), \(h=1/2\), and the values at \(0,1/2,1\) are \(0,1/16,1\). Therefore

$$ S_2=\frac{1/2}{3}\left[0+1+4\left(\frac{1}{16}\right)\right] =\frac16\left(\frac54\right) =\frac{5}{24}. $$

For \(n=4\), \(h=1/4\). The endpoint values are \(0\) and \(1\); the odd-indexed values are \(f(1/4)=1/256\) and \(f(3/4)=81/256\); and the even interior value is \(f(1/2)=1/16\). Thus

$$ \begin{aligned} S_4 &=\frac{1}{12}\left[ 0+1+4\left(\frac{1}{256}+\frac{81}{256}\right) +2\left(\frac{1}{16}\right) \right]\\ &=\frac{1}{12}\left[1+\frac{82}{64}+\frac18\right] =\frac{1}{12}\left(\frac{77}{32}\right) =\frac{77}{384}. \end{aligned} $$

The successive change is \(S_4-S_2=77/384-5/24=77/384-80/384=-1/128\), so its magnitude is \(1/128\). As a check, the exact integral is \(1/5\); the errors are \(1/120\) for \(S_2\) and \(1/1920\) for \(S_4\), since \(77/384-1/5=1/1920\). Here the finer estimate is closer, but the size of the change alone does not establish that conclusion in a different problem.

Measuring Successive Change

Suppose a sequence of estimates \(Q_0,Q_1,\ldots\) comes from successive refinements, where each grid halves the previous panel width. A basic comparison is the absolute change

$$ D_k=|Q_k-Q_{k-1}|. $$

A smaller \(D_k\) means the latest refinement changed the estimate by less than the preceding difference only when \(D_k<D_{k-1}\). Several small, decreasing differences are more informative than one small difference in isolation. If the estimated integral is not near zero, one can also report the relative change \(D_k/|Q_k|\). When \(Q_k=0\), that relative measure is undefined; when \(Q_k\) is close to zero, it can be misleadingly large. In those cases, report the absolute change and give the scale or units of the integral.

Worked Example: Interpreting a Successive Change

Suppose two nested trapezoidal calculations give \(T_2=17/24\) and \(T_4=1171/1680\). Their absolute change is

$$ \begin{aligned} D_2 &=\left|\frac{1171}{1680}-\frac{17}{24}\right|\\ &=\left|\frac{1171}{1680}-\frac{1190}{1680}\right| =\frac{19}{1680} \approx 0.01131. \end{aligned} $$

The relative change using the finer estimate is \((19/1680)/(1171/1680)=19/1171\approx0.01623\), or about \(1.62\%\). To check the arithmetic, \(17/24=1190/1680\), so the difference is exactly \(19/1680\); dividing that by \(1171/1680\) cancels the common denominator. This comparison describes how much the estimate changed. Without more information, it does not certify that the true integral differs from \(T_4\) by at most \(19/1680\).

What Stabilization Can and Cannot Tell You

A practical refinement study records the panel count, panel width, estimate, and change from the preceding estimate. If a chosen stopping criterion is used—for instance, an absolute change below a specified tolerance—state the criterion explicitly and check it at successive refinements. The tolerance describes an acceptance rule for observed changes; it should not be presented as a guaranteed bound on the quadrature error unless a separate error analysis justifies that claim.

Successive estimates can appear stable for reasons that do not guarantee accuracy. The integrand may vary sharply between sampled points; a sequence of few estimates may not yet reflect that variation; or different errors may partly cancel. A small change is useful evidence, especially when it persists under further refinement and the integrand is understood, but no finite comparison alone rules out these possibilities.

For a reliable comparison, keep the interval, integrand, and rule fixed while refining the grid. Changing several things at once makes the differences harder to interpret. Also ensure that a Simpson calculation uses an even panel count at every level. A nested grid makes the calculation more efficient, but the quadrature rule’s panel requirements still apply.

A Common Mistake: Using the Wrong Refinement Factor

When using the trapezoidal update formula, it is easy to multiply the sum of new midpoint values by \(h\) instead of by the refined width \(h/2\). In the \(x^2\) example, that mistake would give

$$ \frac12 T_2+h\left[f\left(\frac14\right)+f\left(\frac34\right)\right] =\frac{3}{16}+\frac12\left(\frac{10}{16}\right) =\frac12, $$

which is not the four-panel estimate. Each new point has the refined trapezoidal coefficient \(h/2=1/4\), not \(h=1/2\). Using the correct coefficient gives \(3/16+(1/4)(10/16)=11/32\), matching the direct composite-rule calculation. Checking against the definition of the refined rule catches the error.

Takeaway: Halving the panel width creates a nested grid. Reuse old function values, evaluate at the new midpoints, and compare successive estimates. Treat small changes as diagnostic evidence—not as a certified error bound.

Check Your Understanding

Answer these questions using the definitions and procedures in this tutorial.

  1. A grid on \([a,b]\) has \(n\) panels and width \(h\). After halving its panel width, how many panels does it have, and which grid points are new?
  2. Write the trapezoidal refinement formula for \(T_{2n}\) in terms of \(T_n\) and the newly inserted midpoint values.
  3. Why must Simpson’s rule be recomputed with its refined-grid weights rather than treated as a fixed fraction of the earlier estimate?
  4. What does a sequence of decreasing successive changes suggest, and what does it fail to prove on its own?
  5. For the trapezoidal update, what is the coefficient on each new midpoint value, and why?