Tutorials › Calculus II › The Composite Simpson Error Bound

Quadrature and Error Bounds · Tutorial 361 of 998

The Composite Simpson Error Bound

Derive and apply a rigorous error bound for composite Simpson’s rule, including its dependence on interval length, panel width, and the fourth derivative.

Intermediate 10 min read

What You'll Learn

  • State the smoothness and panel-count conditions for the composite Simpson error bound
  • Derive the local Simpson error using a fourth-derivative kernel
  • Combine local errors to obtain the composite bound
  • Explain the dependence on interval length and the inverse fourth power of panel count
  • Use the bound to assess accuracy and choose an even panel count
  • Identify common errors in applying the bound

Why an Error Bound Matters

Composite Simpson’s rule gives a numerical estimate of a definite integral. An estimate by itself does not say how far it may be from the exact value. An error bound supplies a guarantee: if the function is sufficiently smooth and its fourth derivative is bounded, then the difference between the estimate and the integral cannot exceed a stated amount.

The bound also explains how accuracy changes when the grid is refined. With a fixed interval and a fixed bound on the fourth derivative, doubling the number of panels reduces the guaranteed error by a factor of \(16\). The even-panel requirement is essential because Simpson’s rule applies its quadratic approximation over pairs of panels.

Definition: Let \(f\) have a continuous fourth derivative on \([a,b]\), where \(a<b\). Let \(n\) be a positive even integer, and define the panel width \(h=(b-a)/n\) and nodes \(x_i=a+ih\), for \(i=0,\ldots,n\). The composite Simpson approximation is $$ S_n=\frac{h}{3}\left[f(x_0)+f(x_n)+4\sum_{\substack{1\le i\le n-1\\ i\text{ odd}}}f(x_i)+2\sum_{\substack{2\le i\le n-2\\ i\text{ even}}}f(x_i)\right]. $$ If \(M=\max_{a\le x\le b}|f^{(4)}(x)|\), then $$ \left|\int_a^b f(x)\,dx-S_n\right| \le \frac{b-a}{180}h^4M =\frac{(b-a)^5}{180n^4}M. $$

The maximum \(M\) exists because \(f^{(4)}\) is continuous on the closed, bounded interval \([a,b]\). The estimate concerns the absolute error, so it does not assert whether Simpson’s rule overestimates or underestimates the integral.

Deriving the Local Error Bound

The composite rule consists of Simpson approximations on \(n/2\) adjacent pairs of panels. First consider one such pair, from \(u\) to \(u+2h\), with midpoint \(u+h\). Its Simpson approximation is

$$ Q_h(f)=\frac{h}{3}\left[f(u)+4f(u+h)+f(u+2h)\right]. $$

We will bound the error on this pair and then add the bounds. The local bound is \(Mh^5/90\), where \(M\) bounds the absolute fourth derivative on the pair.

A key fact for the derivation is that this local rule integrates every polynomial of degree at most three exactly. To verify the fact, write a cubic in the coordinate \(t=x-(u+h)\) as \(p(t)=A+Bt+Ct^2+Dt^3\). Its integral from \(-h\) to \(h\) is \(2Ah+2Ch^3/3\). The Simpson expression is also

$$ \frac{h}{3}\bigl[p(-h)+4p(0)+p(h)\bigr] =\frac{h}{3}\left[(2A+2Ch^2)+4A\right] =2Ah+\frac{2}{3}Ch^3. $$

Thus the difference between the integral and the Simpson expression vanishes on every cubic. This cancellation lets us express the error using only the fourth derivative.

Local error result: If \(f\) has a continuous fourth derivative on \([u,u+2h]\), and \(|f^{(4)}(x)|\le M\) throughout that interval, then $$ \left|\int_u^{u+2h}f(x)\,dx-Q_h(f)\right|\le \frac{Mh^5}{90}. $$

Here is a derivation of the constant in this bound. Shift the interval to \([0,2h]\), and let \(E(g)\) denote the integral of \(g\) minus its Simpson approximation on that interval. Taylor’s formula with integral remainder writes \(g(x)\) as a cubic polynomial plus

$$ \int_0^{2h}\frac{(x-t)_+^3}{6}\,g^{(4)}(t)\,dt, \qquad (x-t)_+=\max(x-t,0). $$

Since \(E\) vanishes on cubics, applying \(E\) to this formula gives

$$ E(g)=\int_0^{2h}K_h(t)g^{(4)}(t)\,dt, \qquad K_h(t)=E\left(\frac{(x-t)_+^3}{6}\right). $$

This identity follows by applying the integral and the three point evaluations in \(E\) to the Taylor formula; the resulting integrals can be combined because their integrands are continuous and the interval is finite. A direct evaluation of those integrals and evaluations gives, on writing \(r=t/h\),

$$ K_h(t)=h^4k(r),\qquad k(r)= \begin{cases} \dfrac{r^3(3r-4)}{72},&0\le r\le 1,\\[6pt] \dfrac{(2-r)^3(2-3r)}{72},&1\le r\le 2. \end{cases} $$

Both pieces are nonpositive on their respective intervals. Changing variables from \(t\) to \(r\) and integrating their absolute values gives

$$ \int_0^{2h}|K_h(t)|\,dt =h^5\left[ \frac{1}{72}\int_0^1 r^3(4-3r)\,dr +\frac{1}{72}\int_1^2(2-r)^3(3r-2)\,dr \right] =h^5\left(\frac{1}{180}+\frac{1}{180}\right) =\frac{h^5}{90}. $$

Because \(|g^{(4)}(t)|\le M\), the integral representation now implies

$$ |E(g)| \le \int_0^{2h}|K_h(t)|\,|g^{(4)}(t)|\,dt \le M\int_0^{2h}|K_h(t)|\,dt =\frac{Mh^5}{90}. $$

This proves the local error result, including its constant. In particular, the factor \(h^5\) comes from the scale of the local kernel and its integration over an interval of width \(2h\).

From the Local Bound to the Composite Bound

Partition \([a,b]\) into \(n/2\) pairs of panels. On each pair, the local Simpson expression uses three successive grid values. Adding these local expressions gives \(S_n\): the endpoint values of the full interval occur once, shared pair endpoints occur twice, and the midpoint in each pair occurs with coefficient four. These are exactly the composite Simpson weights.

The total error is the sum of the errors over the pairs. The absolute value of a sum is at most the sum of the absolute values, and each pair has fourth derivative bounded by the same \(M\). Therefore,

$$ \left|\int_a^b f(x)\,dx-S_n\right| \le \frac{n}{2}\cdot\frac{Mh^5}{90} =\frac{nMh^5}{180}. $$

Since \(nh=b-a\), the last expression can be written in two useful forms:

$$ \frac{nMh^5}{180} =\frac{(b-a)Mh^4}{180} =\frac{M(b-a)^5}{180n^4}. $$

The first form highlights panel width: for a fixed interval, the bound is proportional to \(h^4\). The second highlights panel count and interval length. In particular, if \(M\) and \([a,b]\) are fixed and the even panel count is doubled, the bound is multiplied by

$$ \frac{(2n)^{-4}}{n^{-4}}=\frac{1}{16}. $$

This is a guaranteed reduction in the error bound, not a promise that every actual error decreases by exactly that factor. The actual error can be smaller than the bound, including zero.

Worked Example: Checking the Bound on a Quartic

Worked Example: Checking the Bound on a Quartic

Apply composite Simpson’s rule with \(n=2\) to \(\int_0^1x^4\,dx\), and compare the actual error with the bound. Here \(h=(1-0)/2=1/2\), and \(f^{(4)}(x)=24\), so \(M=24\).

The two-panel Simpson approximation is

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

The exact integral is

$$ \int_0^1x^4\,dx=\left[\frac{x^5}{5}\right]_0^1=\frac{1}{5}. $$

Thus the absolute error is

$$ \left|\frac{1}{5}-\frac{5}{24}\right| =\left|\frac{24-25}{120}\right| =\frac{1}{120}. $$

The error bound gives the same value:

$$ \frac{M(b-a)^5}{180n^4} =\frac{24(1-0)^5}{180\cdot 2^4} =\frac{24}{2880} =\frac{1}{120}. $$

The computed error equals the bound, so this example also checks the constant in the estimate. The exact integral and the Simpson value agree with the calculated difference.

Worked Example: Choosing an Even Panel Count

Worked Example: Choosing an Even Panel Count

Find an even panel count that guarantees an error at most \(10^{-5}\) when approximating \(\int_0^1 e^x\,dx\) with composite Simpson’s rule. Since \(f^{(4)}(x)=e^x\), on \([0,1]\) we have \(M=e\). The bound is

$$ \left|\int_0^1e^x\,dx-S_n\right| \le\frac{e}{180n^4}. $$

Test the even counts in order. For \(n=2\), the bound is \(e/2880\), which is approximately \(9.44\times10^{-4}\), larger than the target. For \(n=4\), it is \(e/46080\), approximately \(5.90\times10^{-5}\), also larger than the target. For \(n=6\), it is \(e/233280\), approximately \(1.16\times10^{-5}\), still larger than the target.

For \(n=8\), the bound is

$$ \frac{e}{180\cdot8^4} =\frac{e}{737280} \approx 3.69\times10^{-6} <10^{-5}. $$

Therefore \(n=8\) is the smallest even count among those tested that the bound certifies to meet the requested tolerance. This conclusion concerns what the bound guarantees; a larger bound at a smaller \(n\) does not prove that its actual error exceeds the tolerance.

Worked Example: Seeing the Inverse Fourth Power

Worked Example: Seeing the Inverse Fourth Power

For \(f(x)=x^4\) on \([0,2]\), compare the error bounds for \(n=4\) and \(n=8\). We have \(M=24\) and \(b-a=2\). With \(n=4\),

$$ \frac{M(b-a)^5}{180n^4} =\frac{24\cdot 2^5}{180\cdot4^4} =\frac{768}{46080} =\frac{1}{60}. $$

With \(n=8\), the bound becomes

$$ \frac{24\cdot 2^5}{180\cdot8^4} =\frac{768}{737280} =\frac{1}{960}. $$

The ratio is \((1/960)/(1/60)=1/16\), as predicted when the panel count doubles. In this example the bounds are also the actual errors: the local kernel has one sign throughout, and \(f^{(4)}=24\) is constant, so there is no cancellation between positive and negative contributions to the error. The calculations are consistent with the derived bound and its \(n^{-4}\) dependence.

Common Pitfall: Losing a Power or Ignoring the Panel Condition

A common error is to replace the panel width \(h=(b-a)/n\) with the total interval length \(b-a\), or to use \(n\) as the number of Simpson pairs rather than the number of panels. Either change produces an incorrect factor. The bound uses \(n/2\) local pairs, each with error at most \(Mh^5/90\).

Incorrect calculation: “There are \(n\) pairs, so the composite bound is \(nMh^5/90\).” Correction: \(n\) counts panels, and each pair contains two panels. There are \(n/2\) pairs, so the bound is $$ \frac{n}{2}\cdot\frac{Mh^5}{90} =\frac{nMh^5}{180} =\frac{M(b-a)^5}{180n^4}. $$

Also check that \(n\) is even before applying this formula. The composite Simpson rule groups panels in pairs; an odd panel count does not meet the setup of this error bound. The smoothness condition matters too: the stated result requires a continuous fourth derivative on the entire interval, not merely a fourth derivative at the sampled nodes.

Using the Bound Responsibly

To apply the result, identify the interval, choose an even number of panels, and establish an upper bound \(M\) for \(|f^{(4)}(x)|\) throughout the interval. Then substitute these quantities into \(M(b-a)^5/(180n^4)\). A small bound certifies that the absolute error is small; a large bound may simply be too conservative to settle whether the approximation is accurate.

The dependence on interval length is especially important when comparing problems on different intervals: holding \(M\) and \(n\) fixed, the bound scales as \((b-a)^5\). The panel-count dependence is equally useful: for a fixed interval and derivative bound, increasing \(n\) reduces the guaranteed error at a fourth-power rate. Neither relationship removes the need to verify the hypotheses or to use an even panel count.

Check Your Understanding

Use the assumptions and bound carefully when answering these questions.

  1. What smoothness condition on \(f\) is required for the composite Simpson error bound stated here?
  2. Why does the local error estimate involve \(h^5\), while the composite estimate involves \((b-a)h^4\)?
  3. For a fixed interval and fourth-derivative bound, by what factor does the bound change when the even panel count doubles?
  4. For \(f(x)=x^4\) on \([0,1]\) with \(n=4\), calculate \(M\) and the composite Simpson error bound.
  5. Does a bound larger than a requested tolerance prove that the actual Simpson error exceeds that tolerance? Explain.