Why an Odd Panel Count Needs a Different Simpson Rule
Composite Simpson’s one-third rule works by grouping panels in pairs, so it requires an even number of equal panels. Sometimes the available interval is divided into an odd number of panels, and changing that division is not practical. In that case, a block of three panels can be handled with Simpson’s three-eighths rule; any remaining panels can still be grouped in pairs using Simpson’s one-third rule.
The key is to use the rules on separate subintervals that share a boundary point. The shared function value is used once in each rule’s calculation because it is an endpoint of both subintervals. The estimates are then added to approximate the integral over the entire interval.
The Three-Eighths Rule on Three Panels
Consider four equally spaced points \(x_0,x_1,x_2,x_3\), with spacing \(h\), so \(x_i=x_0+ih\). Simpson’s three-eighths rule approximates the integral over these three panels by
The endpoint values have weight \(1\), while the two interior values have weight \(3\). The interval covered by this rule has length \(3h\), not \(h\).
Suppose the whole interval \([a,b]\) has \(n\) equal panels, where \(n\) is odd and \(n\geq 3\). The common panel width is \(h=(b-a)/n\). If the first three panels are assigned to the three-eighths rule, the remaining \(n-3\) panels can be handled by the composite one-third rule. Since \(n\) is odd, \(n-3\) is even, as required.
Why the Three-Eighths Weights Work
The weights can be derived by approximating \(f\) on the three panels with the cubic polynomial that passes through its four equally spaced values, then integrating that polynomial. To see the weights, first shift and scale the points to \(u=0,1,2,3\), where \(x=x_0+hu\). The cubic interpolation polynomial is a sum of four basis polynomials, each multiplied by one of the values \(f(x_i)\).
For example, the basis polynomial corresponding to \(f(x_0)\) is \(- (u-1)(u-2)(u-3)/6\). Integrating it from \(0\) to \(3\) gives \(3/8\). The basis polynomials for \(f(x_1)\) and \(f(x_2)\) each integrate to \(9/8\), and the basis polynomial for \(f(x_3)\) integrates to \(3/8\). Since \(dx=h\,du\), the integral of the interpolating polynomial is therefore
This also shows why the rule is exact for every polynomial of degree at most three: for such a function, the cubic interpolant agrees with the function throughout the interval, so integrating the interpolant gives the exact integral.
Putting the Rules Together
Let \(x_i=a+ih\), where \(h=(b-a)/n\), and write \(f_i=f(x_i)\). If the three-eighths block is placed first, and there are at least two panels remaining, the full mixed estimate is
The second term is the composite one-third rule on \([x_3,b]\). Its endpoints are \(x_3\) and \(x_n\); its interior odd-indexed points have weight \(4\), and its interior even-indexed points have weight \(2\). If the three-eighths block is placed last instead, apply the composite one-third rule on \([a,x_{n-3}]\) and the three-eighths rule on \([x_{n-3},b]\).
For \(n=3\), there are no panels left for the one-third rule, so use only the three-eighths rule. For \(n=5\), there are two remaining panels and one one-third block. For \(n=7\), there are four remaining panels and two one-third blocks. The same pattern continues for larger odd counts.
For \(n\) equal panels on \([a,b]\), calculate \(h=(b-a)/n\).
Choose a consecutive block of three panels for the three-eighths rule.
The remaining \(n-3\) panels must be grouped in pairs for the one-third rule.
Apply each rule on its own subinterval, using the function values at that subinterval’s endpoints, and add the two estimates.
Worked Examples
Worked Example: Three Panels on a Cubic
Approximate \(\int_0^3 x^3\,dx\) using three equal panels. Here \(h=(3-0)/3=1\), and the four function values are \(f_0=0^3=0\), \(f_1=1^3=1\), \(f_2=2^3=8\), and \(f_3=3^3=27\). Apply the three-eighths rule:
Check against the exact integral: \(\int_0^3 x^3\,dx=[x^4/4]_0^3=81/4-0=20.25\). The estimate agrees exactly, as expected for a cubic.
Worked Example: Five Panels with the Three-Eighths Block First
Estimate \(\int_0^5 \frac{1}{1+x}\,dx\) using five equal panels. The spacing is \(h=(5-0)/5=1\). The tabulated values are \(f_0=1\), \(f_1=1/2\), \(f_2=1/3\), \(f_3=1/4\), \(f_4=1/5\), and \(f_5=1/6\).
Use the three-eighths rule on \([0,3]\):
The two remaining panels lie on \([3,5]\). Apply the one-third rule using \(f_3,f_4,f_5\):
Add the two subinterval estimates. With common denominator \(1440\), the result is
Check the arithmetic by evaluating the two rules separately: \(45/32=1.40625\) and \(73/180\approx0.40556\), whose sum is approximately \(1.81181\). The exact integral is \(\ln(6)\approx1.79176\), so the estimate is about \(0.02005\) greater than the exact value.
Worked Example: Seven Panels with the Three-Eighths Block Last
Estimate \(\int_0^7 x^3\,dx\) using seven equal panels, placing the three-eighths block last. The width is \(h=(7-0)/7=1\). Use the one-third rule over \([0,4]\), with values \(f_0=0\), \(f_1=1\), \(f_2=8\), \(f_3=27\), and \(f_4=64\):
Now use the three-eighths rule on \([4,7]\), where \(f_4=64\), \(f_5=125\), \(f_6=216\), and \(f_7=343\):
The mixed estimate is \(64+536.25=600.25\). To check, evaluate the exact integral: \(\int_0^7 x^3\,dx=[x^4/4]_0^7=2401/4=600.25\). The result is exact because both rules integrate cubic polynomials exactly.
Conditions and an Error Bound
The rules above require equally spaced panels within each Simpson block. In the mixed method, the spacing is the same throughout the original interval, so each block uses the same \(h\). The method is suitable when \(f\) is sufficiently smooth on the interval; in particular, a standard error bound applies if the fourth derivative \(f^{(4)}\) exists and is continuous there.
For a three-eighths block of width \(3h\), the error has the form \(-3h^5 f^{(4)}(\xi)/80\) for some point \(\xi\) in that block. For a composite one-third block covering a length \(L\) with panel width \(h\), the absolute error is at most \(Lh^4M/180\), where \(M\) is an upper bound for \(|f^{(4)}(x)|\) on that block. If \(|f^{(4)}(x)|\leq M\) over all of \([a,b]\), adding the two error bounds gives
When \(n=3\), the second term is zero because there is no one-third portion. This bound describes the mixed method; it should not be confused with the error bound for a single rule applied over the whole interval.
A Common Mistake: Using One-Third Weights on an Odd Count
The composite one-third rule has a repeating pattern of endpoint weights \(1\), odd-indexed interior weights \(4\), and even-indexed interior weights \(2\). That pattern requires an even number of panels. Extending it mechanically to an odd count can give incorrect weights and even fail a basic check on constant functions.
For example, on \([0,5]\) with five panels of width \(1\), suppose \(f(x)=1\). Using the invalid weights \(1,4,2,4,2,1\) gives
but the exact integral of \(1\) from \(0\) to \(5\) is \(5\). The weights have not even produced the correct interval length. Instead, apply the three-eighths rule on \([0,3]\), which gives \(3\), and the one-third rule on \([3,5]\), which gives \(2\). Their sum is \(3+2=5\), as required. This constant-function check is a useful way to catch mistakes before using a mixed rule on more complicated data.
Choosing the Block and Checking the Estimate
Either end of the interval can be used for the three-eighths block. If function values are available at every equally spaced point, both choices are valid applications of the method, though they need not give exactly the same estimate for a general function. In practice, select the arrangement that fits the data or that is convenient to calculate, and keep the grid spacing consistent.
Before accepting a result, check that the panel count is odd and at least three, that the three-eighths block covers exactly three panels, and that the remaining count is even. Then confirm that the one-third calculation begins and ends at the correct shared grid points. Finally, adding the estimates should cover the interval once, with no gaps or overlaps in the subintervals themselves.
Check Your Understanding
Work through these questions to check your understanding of mixed Simpson estimates.
- Why does a total of seven panels leave a valid number of panels for the composite one-third rule after setting aside three?
- For five equal panels, which four function values are used by the three-eighths rule if its block is placed first?
- On five panels, how many one-third-rule blocks remain after using the three-eighths rule once?
- What basic check can reveal that a proposed set of Simpson weights is incorrect?
- State a condition on \(f^{(4)}\) that allows the mixed error bound to be used.