Tutorials › Calculus II › Bounding Fourth Derivatives for Simpson’s Rule

Quadrature and Error Bounds · Tutorial 362 of 998

Bounding Fourth Derivatives for Simpson’s Rule

Find a reliable upper bound for the absolute fourth derivative, then turn it into a practical error guarantee for a composite Simpson estimate.

Intermediate 9 min read

What You'll Learn

  • State the smoothness and even-panel conditions required for the composite Simpson error bound
  • Distinguish the maximum absolute fourth derivative from a convenient upper bound
  • Bound fourth derivatives using monotonicity and elementary inequalities
  • Convert a derivative bound into a guaranteed Simpson error limit
  • Check a computed Simpson estimate against its error guarantee
  • Recognize why sampling derivative values alone does not establish a bound

Why Bound the Fourth Derivative?

A composite Simpson estimate uses function values to approximate a definite integral. Its accuracy depends not only on the number of panels, but also on how the function bends and changes across the interval. For Simpson’s rule, the relevant measure of that behavior is the fourth derivative.

The error formula gives a guarantee if the absolute fourth derivative is bounded throughout the interval. In applications, the challenge is often finding that bound. A maximum may be difficult to calculate exactly, but a simpler upper bound is enough.

Key idea: Find a number \(M\) such that \(|f^{(4)}(x)|\le M\) at every point of the integration interval. Substituting \(M\) into the composite Simpson error formula gives a guaranteed upper limit on the error.

The Error Bound and Its Conditions

Let \(f\) have a continuous fourth derivative on the closed interval \([a,b]\), where \(a<b\). Divide the interval into \(n\) equal subintervals, with \(n\) a positive even integer. The subinterval width is \(h=(b-a)/n\). Write \(S_n\) for the composite Simpson estimate of \(\int_a^b f(x)\,dx\).

The composite Simpson error bound is

$$ \left|\int_a^b f(x)\,dx-S_n\right| \le \frac{b-a}{180}h^4 \max_{x\in[a,b]}|f^{(4)}(x)| = \frac{(b-a)^5}{180n^4} \max_{x\in[a,b]}|f^{(4)}(x)|. $$

The continuity condition matters: it ensures the fourth derivative is defined throughout the interval and, by the extreme value theorem, that its absolute value has a finite maximum there. The even-panel condition is also essential because the composite Simpson rule groups subintervals in pairs.

Definition: The fourth-derivative maximum on \([a,b]\) is \(M_4=\max_{x\in[a,b]}|f^{(4)}(x)|\). Any number \(M\) satisfying \(|f^{(4)}(x)|\le M\) for all \(x\in[a,b]\) is an upper bound that can be used in place of \(M_4\).

The exact maximum is not required. If it is inconvenient to calculate, a larger valid \(M\) still guarantees an error bound, though the resulting guarantee may be less tight.

How to Find a Valid Bound

Begin by differentiating four times and simplifying \(f^{(4)}(x)\). Then bound its absolute value over the entire interval—not just at the Simpson nodes. If the expression is nonnegative and monotone, its endpoint values may identify its maximum. If it contains several terms, the triangle inequality can provide a bound. Known inequalities, such as \(|\sin x|\le 1\), can also be useful.

A key distinction is between estimating a maximum and proving an upper bound. Evaluating \(|f^{(4)}|\) at a finite set of sample points does not, by itself, show that its values between those points are no larger. A guarantee must cover every point of the interval.

1
Differentiate four times.
Obtain a formula for \(f^{(4)}(x)\), and check that \(f\) has a continuous fourth derivative on the full interval.
2
Bound the absolute value.
Use monotonicity, inequalities, or a direct maximum calculation to find \(M\) with \(|f^{(4)}(x)|\le M\) everywhere on \([a,b]\).
3
Apply the error formula.
For an even number \(n\) of subintervals, calculate \((b-a)^5M/(180n^4)\).
4
State the guarantee.
The absolute difference between the integral and the Simpson estimate is no greater than the calculated bound.

Why Any Valid Upper Bound Works

The error theorem uses the maximum \(M_4\). If a calculation establishes that \(|f^{(4)}(x)|\le M\) everywhere, then the maximum also satisfies \(M_4\le M\). Substituting this inequality into the theorem gives

$$ \left|\int_a^b f(x)\,dx-S_n\right| \le \frac{(b-a)^5}{180n^4}M_4 \le \frac{(b-a)^5}{180n^4}M. $$

The final inequality follows because \((b-a)^5/(180n^4)\) is positive. This is why a convenient upper bound, even if it is not the smallest possible one, still produces a valid guarantee.

Worked Examples

Worked Example: An Exponential Function and a Target Accuracy

Estimate \(\int_0^1 e^x\,dx\) with composite Simpson’s rule, using an even number of subintervals that guarantees an error no greater than \(10^{-4}\). First find a suitable fourth-derivative bound.

The derivatives of \(f(x)=e^x\) are all \(e^x\), so \(f^{(4)}(x)=e^x\). On \([0,1]\), \(e^x\) is increasing and positive. Therefore,

$$ |f^{(4)}(x)|=e^x\le e, \qquad 0\le x\le 1. $$

We may use \(M=e\). With \(b-a=1\), the error guarantee for even \(n\) is

$$ |E_S| \le \frac{e}{180n^4}. $$

To make this no greater than \(10^{-4}\), require

$$ \frac{e}{180n^4}\le 10^{-4} \quad\Longrightarrow\quad n^4\ge \frac{e}{0.018} \approx 151.02. $$

Since \(3^4=81\) and \(4^4=256\), the smallest even integer meeting the condition is \(n=4\). Its guaranteed error is

$$ |E_S| \le \frac{e}{180(4^4)} =\frac{e}{46080} \approx 0.00005899 <0.0001. $$

For \(n=4\), \(h=1/4\). The composite Simpson estimate is

$$ S_4=\frac{h}{3} \left[f(0)+4f(0.25)+2f(0.5)+4f(0.75)+f(1)\right]. $$

Using \(f(0)=1\), \(f(0.25)\approx1.284025\), \(f(0.5)\approx1.648721\), \(f(0.75)\approx2.117000\), and \(f(1)\approx2.718282\), the weighted sum is

$$ 1+4(1.284025)+2(1.648721)+4(2.117000)+2.718282 \approx 20.619826. $$

Thus \(S_4\approx(1/12)(20.619826)=1.718319\). The exact integral is \(e-1\approx1.718282\), so the actual error is about \(0.000037\), less than the guaranteed limit \(0.00005899\). The estimate satisfies the requested \(10^{-4}\) accuracy.

Worked Example: A Rational Function with a Decreasing Fourth Derivative

Bound the composite Simpson error for \(f(x)=1/(1+x)\) on \([0,1]\) using \(n=2\) subintervals.

Write \(f(x)=(1+x)^{-1}\). Differentiating successively gives

$$ f'(x)=-(1+x)^{-2},\qquad f''(x)=2(1+x)^{-3},\qquad f'''(x)=-6(1+x)^{-4},\qquad f^{(4)}(x)=24(1+x)^{-5}. $$

This fourth derivative is positive and decreasing on \([0,1]\), since its denominator increases there. Its maximum is therefore at \(x=0\):

$$ M_4=f^{(4)}(0)=24. $$

Here \(b-a=1\), and \(n=2\), so the error guarantee is

$$ |E_S|\le \frac{1^5(24)}{180(2^4)} =\frac{24}{2880} =\frac{1}{120} \approx 0.008333. $$

To check the estimate, \(h=1/2\), and the Simpson nodes are \(0\), \(1/2\), and \(1\). Their function values are \(1\), \(2/3\), and \(1/2\). Hence

$$ S_2=\frac{h}{3}\left[f(0)+4f(1/2)+f(1)\right] =\frac{1}{6}\left(1+4\cdot\frac{2}{3}+\frac{1}{2}\right) =\frac{25}{36} \approx0.694444. $$

The exact integral is \(\ln 2\approx0.693147\). The actual error is \(25/36-\ln 2\approx0.001297\), which is less than \(1/120\approx0.008333\). The stated bound is valid, though it is not especially tight.

Worked Example: Using a Trigonometric Bound

Find a guaranteed error bound for the composite Simpson estimate of \(\int_0^\pi\sin x\,dx\) with \(n=4\).

The derivatives cycle as \(\cos x\), \(-\sin x\), \(-\cos x\), and \(\sin x\), so \(f^{(4)}(x)=\sin x\). Since \(|\sin x|\le1\) for every real \(x\), we can take \(M=1\) on \([0,\pi]\). The error bound is

$$ |E_S| \le \frac{\pi^5}{180(4^4)} =\frac{\pi^5}{46080} \approx0.00664. $$

The width is \(h=\pi/4\). At the five Simpson nodes, the function values are \(0\), \(\sqrt{2}/2\), \(1\), \(\sqrt{2}/2\), and \(0\). Therefore,

$$ S_4 =\frac{\pi/4}{3} \left[0+4\left(\frac{\sqrt2}{2}\right)+2(1) +4\left(\frac{\sqrt2}{2}\right)+0\right] =\frac{\pi(1+2\sqrt2)}{6} \approx2.004560. $$

The exact integral is \([-\cos x]_0^\pi=2\). The actual error is about \(0.004560\), which is below the guarantee \(0.00664\). The inequality \(|\sin x|\le1\) established the derivative bound over the whole interval, not merely at the quadrature nodes.

Common Pitfall: Bounding Only at the Nodes

Suppose a calculation evaluates \(|f^{(4)}|\) at each Simpson node and calls the largest of those values \(M\). That does not generally prove the required bound. The fourth derivative could be larger between the nodes, so the error theorem’s maximum might exceed the proposed \(M\).

For example, in the trigonometric example, the nodes include \(0\), \(\pi/2\), and \(\pi\). The fourth-derivative values there are \(0\), \(1\), and \(0\), but the value \(1\) is justified as a bound because \(|\sin x|\le1\) throughout the interval. The conclusion does not follow merely from checking those three points.

Practical check: State why your proposed \(M\) bounds \(|f^{(4)}(x)|\) for every \(x\) in the interval. If that justification is missing, the error guarantee is not established.

Using the Guarantee Well

A derivative-based error bound is a worst-case guarantee, not a prediction of the exact error. It may overstate the actual error, as the rational-function example illustrates. Nevertheless, it is useful when an estimate must come with a defensible accuracy limit.

Keep the ingredients distinct: the function supplies the fourth derivative, the interval determines where that derivative must be bounded, and the even panel count determines the factor \(n^4\) in the denominator. A careful bound over the whole interval turns the Simpson estimate into a quantitatively controlled approximation.

Check Your Understanding

Use the derivative bound, not just the Simpson function values, when answering these questions.

  1. What continuity condition on \(f\) is required for the composite Simpson error bound stated here?
  2. If \(|f^{(4)}(x)|\le M\) on \([a,b]\), write the resulting error guarantee in terms of \(a\), \(b\), \(M\), and the even panel count \(n\).
  3. Why does checking the fourth derivative at the quadrature nodes alone fail to prove a bound over the interval?
  4. For \(f(x)=e^x\) on \([0,1]\), what upper bound for \(|f^{(4)}(x)|\) follows from monotonicity?
  5. What role does the even-panel requirement play in applying the composite Simpson rule?