Why Compare Two Simpson Approximations?
Simpson’s rule can be accurate without requiring an exact antiderivative, but a numerical approximation is more useful when accompanied by information about its likely error. A common strategy is to calculate Simpson’s approximation on an interval, then calculate a second approximation using two half-intervals. The difference between these values provides a practical estimate of the error in the more refined approximation.
This comparison is the basis of adaptive Simpson quadrature. “Adaptive” means that subdivision is guided by the behaviour of the integrand: intervals where the estimated error is large are divided further, while intervals with small estimated error may be accepted at the current resolution.
The Two Approximations on One Interval
Let \(f\) be a function on \([a,b]\), let \(H=b-a\), and write \(m=(a+b)/2\). The one-panel Simpson approximation uses the endpoints and midpoint:
To obtain the two-panel approximation, apply Simpson’s rule separately to \([a,m]\) and \([m,b]\). This requires the additional quarter points \(a+H/4\) and \(a+3H/4\). Adding the two results gives
Here, “two-panel” means two applications of Simpson’s rule, each on half of the original interval. The refined result uses four equal subintervals across \([a,b]\). Define the signed difference by \(D=S_2-S_1\). The usual estimate of the absolute error in \(S_2\) is \(|D|/15\).
Why the Denominator Is Fifteen
The factor comes from how Simpson error changes under refinement. Suppose \(E_H\) denotes the signed error of a Simpson approximation at a given scale, using the convention “exact integral minus approximation.” For a sufficiently smooth function, the leading Simpson error is fourth order in the step size. If the step size is halved, that leading error is therefore approximately divided by \(2^4=16\).
In the comparison above, \(S_1\) uses a coarser step size than \(S_2\). In the regime where the leading error term dominates, the errors approximately satisfy
Since \(E_{\mathrm{coarse}}=I-S_1\) and \(E_{\mathrm{fine}}=I-S_2\), where \(I=\int_a^b f(x)\,dx\), their difference is
Thus, \((S_2-S_1)/15\) estimates the signed error \(I-S_2\), and its absolute value estimates the absolute error in \(S_2\). This also gives a corrected approximation:
This reasoning depends on the leading fourth-order error being a useful description at the scales being compared. In the standard asymptotic setting, for example when the integrand has six continuous derivatives, the composite Simpson error has a leading term proportional to the fourth power of the step size, followed by higher-order terms. If the interval is too wide for the leading term to dominate, or if error terms cancel, the difference may not reliably reflect the true error. The factor fifteen is therefore an asymptotic error-estimation rule, not an error-bound theorem.
Evaluate \(S_1\) on the full interval.
Evaluate \(S_2\) using the two half-intervals.
Calculate \(|S_2-S_1|/15\), and use the signed difference if forming a corrected value.
If the estimate is too large for the task, split the interval and repeat the comparison on the smaller pieces.
Worked Example: An Exact Difference-Over-Fifteen Estimate
Worked Example: An Exact Difference-Over-Fifteen Estimate
Estimate the error in the two-panel Simpson approximation to \(\int_0^1 x^4\,dx\), and check the result against the exact integral.
Here \(H=1\), and the midpoint is \(1/2\). The one-panel approximation is
The quarter-point values are \(f(1/4)=1/256\) and \(f(3/4)=81/256\). Therefore
Since \(5/24=80/384\), the signed difference and estimated absolute error are
The exact integral is \(\int_0^1x^4\,dx=1/5\). Checking the error in \(S_2\) gives
In this example the estimate equals the actual absolute error. The signed correction also recovers the exact value:
Exact agreement is especially convenient here; it should not be expected for every integrand.
Worked Example: Estimating Error for a Rational Function
Worked Example: Estimating Error for a Rational Function
Use one-panel and two-panel Simpson approximations on \([0,1]\) for \(f(x)=1/(1+x)\). Find the estimated error in the refined value.
The sampled values are \(f(0)=1\), \(f(1/2)=2/3\), \(f(1)=1/2\), \(f(1/4)=4/5\), and \(f(3/4)=4/7\). Thus
For the refined value, substitute the same samples into the two-panel formula:
Writing \(S_1\) with denominator \(2520\) gives \(S_1=1750/2520\). Therefore
The estimate for the absolute error in \(S_2\) is \(1/12600\), or approximately \(0.00007937\). The negative sign of \(D\) indicates that the coarse approximation is larger than the refined one. It also suggests the corrected value
The correction is a further estimate, not a substitute for the error check: without knowing the exact integral or an independent bound, this comparison alone cannot certify the true error.
Using the Estimate to Guide Subdivision
On an interval being tested, compare the estimated error with the accuracy needed for the calculation. If the estimate is acceptable, retain \(S_2\) as the approximation on that interval. If it is too large, divide the interval in half and repeat the one-panel-versus-two-panel comparison on each half. The refined approximations from accepted pieces are then added.
Subdivision is useful because a single wide interval may not capture changes in the function well. Smaller intervals can reveal where the approximation changes substantially under refinement. However, a small difference does not prove that the error is small: both approximations may miss a feature, or their errors may cancel. Smoothness of the integrand and sensible interval boundaries remain important.
Worked Example: Subdivide When the Local Estimate Is Too Large
Worked Example: Subdivide When the Local Estimate Is Too Large
Use the local estimates for \(f(x)=x^4\) on \([0,1]\) to decide whether to bisect the interval when the desired local error is \(0.0001\). Then find the sum of the refined approximations on the two halves.
The first comparison, computed above, gives an estimated error of \(1/1920\), approximately \(0.00052083\). Since this is greater than \(0.0001\), bisect the interval.
On \([0,1/2]\), the one-panel value is
The two-panel value uses \(x=0,1/8,1/4,3/8,1/2\). Its spacing is \(1/8\), so the Simpson factor is \((1/8)/3=1/24\):
Since \(5/768=80/12288\), the left-half estimate is
For the right half, put \(u=x-1/2\). The integrand becomes \((u+1/2)^4\), whose fourth-degree term is \(u^4\); its lower-degree terms are integrated exactly by Simpson’s rule. Thus the Simpson error on a width-\(1/2\) interval is the same as for \(u^4\) on \([0,1/2]\), and the right-half estimate is also \(1/61440\). The sum of the two local estimates is
which is less than \(0.0001\). The sum of the two refined approximations can also be checked from the exact integral. For \(x^4\), Simpson’s error on a width-\(w\) interval is \(w^5/1920\); for \(w=1/2\), this is \(1/61440\) on each half. Hence
The exact integral is \(1/5=6144/30720\), so the actual error of this sum is \(1/30720\), matching the summed estimate in this particular case. The tolerance comparison has guided subdivision, but the estimate still should not be treated as a guaranteed bound in general.
A Common Mistake: Treating the Difference as the Error
A frequent mistake is to use \(|S_2-S_1|\) itself as the estimated error of \(S_2\). In the quartic example, the difference is \(1/128\), while the actual error in \(S_2\) is \(1/1920\). In fact, \(1/128=15/1920\). Under the fourth-order refinement assumption, the difference is approximately fifteen times the refined error, so the estimate requires division by fifteen.
A second, related mistake is to describe the difference-over-fifteen value as a rigorous upper bound. It is an estimate based on the expected scaling of Simpson error; it can be misleading when the function is insufficiently smooth, when the interval is too large, or when error terms cancel. A rigorous guarantee requires an applicable error bound with its stated smoothness conditions, rather than this comparison alone.
Check Your Understanding
Use the definitions and reasoning above to answer these questions.
- What function values are needed for \(S_1\), and what additional values are needed for \(S_2\)?
- Why does halving the step size lead to the factor \(2^4=16\) for the leading Simpson error?
- If \(S_2-S_1<0\), what does the signed correction \(S_2+(S_2-S_1)/15\) do to \(S_2\)?
- Why is \(|S_2-S_1|/15\) an estimate rather than a guaranteed error bound?
- If the local estimate exceeds the required accuracy, what subdivision step should be taken?