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.
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:
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:
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:
The correct Simpson weights are \(1,4,2,4,1\). Therefore,
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:
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
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
Check by integration:
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
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
Using the valid value \(M=e\), the error bound is
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
To guarantee the requested tolerance, require
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
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:
Record the integration limits, number of panels, and whether the nodes have the spacing required by the formula.
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.
Confirm that endpoints and interior nodes have the correct weights, and that each function value is paired with its intended node.
Confirm the required derivative exists and is continuous, and that the proposed maximum bound holds throughout the entire interval.
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.
- In composite Simpson’s \(1/3\) rule, what weights belong to the two endpoints?
- Can the composite Simpson’s \(1/3\) rule be applied with five equal panels? What feature of the panel count determines your answer?
- 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)|\)?
- For \(f(x)=e^x\) on \([0,1]\), why is \(M=1\) not a valid fourth-derivative bound?
- What is the difference between reporting a quadrature approximation and claiming that its error is guaranteed to be below a tolerance?