Tutorials › Calculus II › Auditing Quadrature Setups and Results

Quadrature and Error Bounds · Tutorial 374 of 998

Auditing Quadrature Setups and Results

Use a systematic checklist to decide whether a quadrature calculation and its accuracy claim are actually justified.

Intermediate 10 min read

What You'll Learn

  • Check endpoint and interior weights in composite quadrature formulas.
  • Decide whether a panel count is valid for composite Simpson’s rule.
  • Verify that a derivative bound holds across the whole integration interval.
  • Distinguish a guaranteed error bound from an unsupported accuracy claim.
  • Use a stated tolerance to determine an adequate even panel count.

Why Audit a Quadrature Calculation?

Numerical quadrature turns an integral into a finite calculation using function values at selected points. A result can look plausible and still be unjustified: a weight may be assigned to the wrong point, a rule may be used with an invalid panel count, or an error estimate may be based on a derivative bound that holds only at a few sample points.

An audit asks more than whether the arithmetic is correct. It checks whether the formula fits the setup, whether its hypotheses hold, and whether the conclusion follows from the stated evidence. These checks are especially important when a result is reported with a numerical tolerance.

Audit principle: A quadrature value, an error estimate, and a guaranteed error bound are different things. Each requires its own justification.

A Short Checklist for Composite Rules

For \(n\) equal panels on \([a,b]\), the step size is \(h=(b-a)/n\), and the nodes are \(x_i=a+ih\), for \(i=0,1,\ldots,n\). In composite Simpson’s \(1/3\) rule, \(n\) must be a positive even integer. The weights alternate between \(4\) and \(2\) at the interior nodes, with weight \(1\) at each endpoint:

$$ S_n=\frac{h}{3}\left[f(x_0)+f(x_n) +4\sum_{\substack{i=1\\i\ \mathrm{odd}}}^{n-1}f(x_i) +2\sum_{\substack{i=2\\i\ \mathrm{even}}}^{n-2}f(x_i)\right]. $$

The formula uses equally spaced nodes. It is not enough to have the right number of function values: their locations and their weights must match the rule. For comparison, the composite trapezoidal rule gives half weight to each endpoint and full weight to every interior node:

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

These formulas make endpoint checks straightforward. In Simpson’s rule, both endpoints have weight \(1\) inside the brackets; in the trapezoidal rule, each endpoint has weight \(1/2\). Neither rule assigns an endpoint the same weight as every interior value.

Worked Example: Correcting a Simpson Endpoint Weight

Worked Example: Correcting a Simpson Endpoint Weight

Approximate \(\int_0^2 x^2\,dx\) by composite Simpson’s rule with \(n=4\), and audit a calculation that gives the right endpoint weight \(4\) instead of \(1\).

The step size is \(h=(2-0)/4=1/2\). The nodes and function values are:

$$ \begin{array}{c|ccccc} i&0&1&2&3&4\\ x_i&0&\frac12&1&\frac32&2\\ f(x_i)=x_i^2&0&\frac14&1&\frac94&4 \end{array} $$

The correct Simpson weights are \(1,4,2,4,1\). Therefore,

$$ S_4=\frac{1/2}{3} \left[0+4\left(\frac14\right)+2(1)+4\left(\frac94\right)+4\right] =\frac16[1+2+9+4] =\frac{16}{6} =\frac83. $$

If the right endpoint is mistakenly given weight \(4\), the bracket becomes \(1+2+9+16=28\), giving the wrong value \(28/6=14/3\). The issue is not rounding: the formula has assigned the endpoint the wrong coefficient.

Check the corrected answer against the exact integral:

$$ \int_0^2 x^2\,dx =\left[\frac{x^3}{3}\right]_0^2 =\frac83. $$

Thus the corrected Simpson calculation agrees with the exact value. This check is also consistent with Simpson’s exactness for polynomials of degree at most three.

Check the Panel Count Before Calculating

Composite Simpson’s \(1/3\) rule is assembled from panels in pairs. Consequently, its panel count must be even. A calculation that uses an odd number of panels cannot be justified by simply inserting that number into the composite \(1/3\) formula.

An odd panel count does not mean that numerical quadrature is impossible. When there are three panels, Simpson’s \(3/8\) rule is one available rule. It has its own weights and is not the same as applying the \(1/3\) rule to an odd number of panels.

Worked Example: Repairing an Invalid Panel Count

Worked Example: Repairing an Invalid Panel Count

Approximate \(\int_0^3 x^3\,dx\) using three equal panels. First, check whether composite Simpson’s \(1/3\) rule applies.

Here \(n=3\), which is odd, so the \(1/3\) rule is not valid for this setup. Use Simpson’s \(3/8\) rule for three equal panels instead. The step size is \(h=(3-0)/3=1\), and the nodes are \(0,1,2,3\). The rule is

$$ S_{3/8}=\frac{3h}{8}\left[f(x_0)+3f(x_1)+3f(x_2)+f(x_3)\right]. $$

For \(f(x)=x^3\), the node values are \(0^3=0\), \(1^3=1\), \(2^3=8\), and \(3^3=27\). Substituting them gives

$$ S_{3/8} =\frac{3(1)}{8}[0+3(1)+3(8)+27] =\frac38[0+3+24+27] =\frac38(54) =\frac{162}{8} =\frac{81}{4}. $$

Check by integration:

$$ \int_0^3 x^3\,dx =\left[\frac{x^4}{4}\right]_0^3 =\frac{3^4}{4}-0 =\frac{81}{4}. $$

The value is exact, as expected for a cubic polynomial. The important audit conclusion is that the calculation is justified by the three-panel \(3/8\) rule, not by composite Simpson’s \(1/3\) rule.

Derivative Bounds Must Cover the Whole Interval

The composite Simpson error bound for a function with a continuous fourth derivative on \([a,b]\) is

$$ |E_S|=\left|\int_a^b f(x)\,dx-S_n\right| \leq \frac{b-a}{180}h^4M, \qquad M\geq \max_{a\leq x\leq b}|f^{(4)}(x)|. $$

The essential condition is not merely that \(f^{(4)}\) has been evaluated somewhere. The number \(M\) must bound its absolute value at every point of the integration interval. Values at the endpoints or quadrature nodes alone do not establish a maximum on the whole interval. Once a valid \(M\) is known, the theorem directly supplies the stated bound by substituting \(b-a\), \(h\), and \(M\) into its right-hand side.

This explains why a derivative-bound audit comes before reporting an error bound. If the chosen \(M\) is too small, the arithmetic in the error formula may be flawless, but the theorem’s hypothesis has not been met.

Worked Example: Finding a Valid Fourth-Derivative Bound

Worked Example: Finding a Valid Fourth-Derivative Bound

Apply Simpson’s rule with \(n=2\) to \(\int_0^1 e^x\,dx\). Check a proposed error bound based on \(M=1\), then replace it with a justified bound.

The fourth derivative is \(f^{(4)}(x)=e^x\). On \([0,1]\), \(e^x\) is increasing, so \(\max_{0\leq x\leq1}|f^{(4)}(x)|=e\), not \(1\). The choice \(M=1\) is invalid: for example, \(f^{(4)}(1)=e>1\).

The step size is \(h=(1-0)/2=1/2\). The Simpson approximation is

$$ S_2=\frac{1/2}{3}\left[f(0)+4f\left(\frac12\right)+f(1)\right] =\frac16\left[1+4e^{1/2}+e\right] \approx 1.718861. $$

Using the valid value \(M=e\), the error bound is

$$ |E_S| \leq \frac{1}{180}\left(\frac12\right)^4e =\frac{e}{2880} \approx 0.000944. $$

For a check, the exact integral is \(\int_0^1e^x\,dx=e-1\approx1.718282\). The actual absolute error is approximately \(|1.718861-1.718282|=0.000579\), which is less than the valid bound \(0.000944\). A calculation using \(M=1\) would produce the smaller number \(1/2880\), but that number is not a guaranteed bound because \(M=1\) fails the required condition.

Accuracy Claims Need Evidence

A decimal answer is not itself a statement of accuracy. “The approximation is \(1.718861\)” reports a computed value. “The error is less than \(0.0001\)” is a stronger claim, and it requires a valid bound or another explicitly justified error estimate. A theorem-based bound may be conservative: it can guarantee more error than actually occurs. That does not make it invalid, but it must not be described as the actual error.

To use the composite Simpson bound, the function must have a continuous fourth derivative on the interval, the panel count must be even, and \(M\) must bound the absolute fourth derivative throughout the interval. If any one of these conditions is missing, the bound has not been established. A numerical estimate from refinement may still be useful, but it should be identified as an estimate rather than presented as a guaranteed bound.

Worked Example: Auditing a Requested Tolerance

Worked Example: Auditing a Requested Tolerance

For \(\int_0^1e^x\,dx\), determine an even panel count that makes the composite Simpson error bound at most \(0.0001\).

For \(n\) equal panels, \(h=1/n\). The valid fourth-derivative bound is \(M=e\), so the error bound becomes

$$ |E_S|\leq \frac{1}{180}\left(\frac1n\right)^4e =\frac{e}{180n^4}. $$

To guarantee the requested tolerance, require

$$ \frac{e}{180n^4}\leq 0.0001 \quad\Longleftrightarrow\quad n^4\geq\frac{e}{0.018} \approx151.016. $$

The fourth root of \(151.016\) is approximately \(3.51\), so an integer \(n\) must be at least \(4\). Simpson’s \(1/3\) rule also requires \(n\) to be even; the smallest eligible choice is therefore \(n=4\), not \(n=3\).

For \(n=4\), \(h=1/4\), and the bound is

$$ |E_S|\leq\frac{e}{180(4^4)} =\frac{e}{46080} \approx0.00005898 <0.0001. $$

Thus four panels justify the requested tolerance under the stated theorem and derivative bound. The conclusion is a guarantee about the absolute error, not a claim that the actual error equals \(0.00005898\).

A Practical Audit Sequence

When reviewing a quadrature result, proceed in an order that catches structural errors before arithmetic details:

1
Identify the rule and interval.
Record the integration limits, number of panels, and whether the nodes have the spacing required by the formula.
2
Check the rule’s restrictions.
For composite Simpson’s \(1/3\) rule, confirm that the panel count is even. If it is not, do not use that rule as though it applied.
3
Check coefficients and data.
Confirm that endpoints and interior nodes have the correct weights, and that each function value is paired with its intended node.
4
Check the error-bound hypotheses.
Confirm the required derivative exists and is continuous, and that the proposed maximum bound holds throughout the entire interval.
5
Match the conclusion to the evidence.
Call a value an approximation, an estimate, or a guaranteed error bound as appropriate. Compare a valid bound with the stated tolerance before claiming the tolerance is met.

Common Pitfall: Treating a Plausible Number as a Proof

A frequent mistake is to calculate an error bound with a derivative value taken at an endpoint, then report the resulting number as guaranteed. For \(e^x\) on \([0,1]\), using \(f^{(4)}(0)=1\) as \(M\) gives \(1/2880\) for the two-panel Simpson bound. But \(f^{(4)}(1)=e>1\), so \(M=1\) does not bound the fourth derivative on the interval. The correction is to use \(M=e\), which gives the valid bound \(e/2880\).

Likewise, a result that happens to agree with an exact value does not make an invalid setup valid. Check the rule’s conditions and the calculation’s assumptions independently of whether the final decimal looks reasonable.

Check Your Understanding

For each question, identify the relevant condition before deciding whether the claim is justified.

  1. In composite Simpson’s \(1/3\) rule, what weights belong to the two endpoints?
  2. Can the composite Simpson’s \(1/3\) rule be applied with five equal panels? What feature of the panel count determines your answer?
  3. Why is checking \(|f^{(4)}(x)|\) only at the quadrature nodes insufficient to establish \(M\geq\max_{a\leq x\leq b}|f^{(4)}(x)|\)?
  4. For \(f(x)=e^x\) on \([0,1]\), why is \(M=1\) not a valid fourth-derivative bound?
  5. What is the difference between reporting a quadrature approximation and claiming that its error is guaranteed to be below a tolerance?

Test yourself: Calculus II final exam practice

Ready to check what you know? Work a full-length practice final, then open the complete worked solutions.

Want all 1,114 practice problems?

This tutorial covers one topic. Calc Pass covers the full Calculus AB & BC curriculum (the core of Calculus I and II): full review, every practice question, and step-by-step solutions to each one.

QR code to download the Calc Pass app

Get the Calc Pass App

Scan to download and practice on the go, with instant scoring.

Calc Pass Volume 1: 1,114 Practice Questions book cover

Vol. 1: 1,114 Questions

The complete practice question bank, organized by AB & BC topic.

View on Amazon
Calc Pass Volume 2: Solutions Manual book cover

Vol. 2: Solutions Manual

Fully worked solutions to every question in Volume 1.

View on Amazon