Why Check Simpson’s Rule on Cubics?
Simpson’s one-third rule estimates a definite integral using function values at the two endpoints of an interval and its midpoint. Its particular weights, \(1,4,1\), are not arbitrary: they make the rule integrate every polynomial of degree at most three exactly. That exactness is a useful way to understand and check the formula.
Here, exact means that the value produced by the quadrature formula equals the definite integral, not merely that it is a close approximation. We will state the one-panel rule, prove its exactness for cubic polynomials, and verify the result with concrete calculations. We will also see how the same fact gives exactness of the composite rule when the number of panels is even.
The One-Panel Rule and Its Weights
Let \(a<b\), let \(m=(a+b)/2\) be the midpoint, and let \(h=(b-a)/2\) be the half-width. Simpson’s one-third rule uses the three values \(f(a)\), \(f(m)\), and \(f(b)\):
The factor in front is \((b-a)/6\), since \(h=(b-a)/2\). The endpoint weights are each \(1\), and the midpoint weight is \(4\). The rule is a quadrature formula: it uses finitely many values of a function to estimate an integral. For a polynomial of degree at most three, however, the estimate is exact.
The statement concerns one application of Simpson’s rule across the whole interval \([a,b]\), using its midpoint. The degree condition is important: this theorem asserts exactness for polynomials through degree three, not for every function or for polynomials of arbitrary degree.
Why the Weights Produce Exactness
A direct proof is easiest after changing the interval to the symmetric interval \([-1,1]\). Set \(x=m+ht\), so \(dx=h\,dt\), and \(t=-1,0,1\) correspond respectively to \(x=a,m,b\). If \(p\) is a polynomial of degree at most three, then \(g(t)=p(m+ht)\) is also a polynomial of degree at most three. Write it in the form \(g(t)=At^3+Bt^2+Ct+D\), where \(A,B,C,D\) are constants.
Using \(x=m+ht\) gives \(\int_a^b p(x)\,dx=h\int_{-1}^{1}g(t)\,dt\).
The terms \(At^3\) and \(Ct\) are odd, so their integrals over \([-1,1]\) are zero. Thus \(\int_{-1}^{1}g(t)\,dt=2B/3+2D\).
Since \(g(-1)=-A+B-C+D\), \(g(0)=D\), and \(g(1)=A+B+C+D\), their weighted sum is \(g(-1)+4g(0)+g(1)=2B+6D\).
Multiplying the weighted sum by \(h/3\) gives \(h(2B/3+2D)\), equal to the transformed integral in Step 1.
This proves that the one-panel rule is exact for every polynomial of degree at most three. The proof also explains the role of symmetry: the odd terms cancel in both the integral and the weighted sum, while the constant and quadratic terms are matched by the weights.
Worked Example: A Cubic on a Single Panel
Worked Example: Integrating \(x^3\) on \([0,2]\)
Apply Simpson’s rule to \(f(x)=x^3\) on \([0,2]\). The midpoint is \(m=(0+2)/2=1\), and the factor is \((b-a)/6=(2-0)/6=1/3\). The function values are \(f(0)=0^3=0\), \(f(1)=1^3=1\), and \(f(2)=2^3=8\). Therefore, the Simpson value is
Check against the exact integral using the antiderivative \(x^4/4\):
The rule and the exact integral both give \(4\), as the theorem predicts for a cubic.
Worked Example: An Arbitrary Cubic
Worked Example: Checking a Cubic with Several Terms
Let \(f(x)=x^3-2x^2+x+1\) on \([1,3]\). The midpoint is \(m=(1+3)/2=2\), and the Simpson factor is \((3-1)/6=1/3\). Evaluate the function at all three nodes:
The Simpson value is therefore
To check, an antiderivative is \(F(x)=x^4/4-2x^3/3+x^2/2+x\). Its endpoint values are
Hence
This independently confirms the Simpson calculation.
Composite Simpson Exactness
The composite Simpson rule applies the one-panel rule to successive pairs of equal-width subintervals. If there are \(n\) panels, then \(n\) must be even: the panels are grouped into \(n/2\) pairs, and each pair forms one Simpson panel. For an even \(n\), let \(h=(b-a)/n\) and \(x_i=a+ih\) for \(i=0,\ldots,n\). The composite formula is
When \(f\) is a polynomial of degree at most three, its restriction to each pair of panels is still such a polynomial. The one-panel theorem therefore gives the exact integral on every pair. Adding those exact pair integrals gives the exact integral over \([a,b]\). This argument requires an even number of equal-width panels, as in the composite rule above.
Worked Example: Composite Simpson Rule for \(x^3\)
Use four equal panels to integrate \(f(x)=x^3\) on \([0,4]\). Here \(n=4\), \(h=(4-0)/4=1\), and the nodes are \(x_0=0,x_1=1,x_2=2,x_3=3,x_4=4\). The corresponding function values are \(0,1,8,27,64\). Substituting into the composite formula gives
The exact integral is
The composite calculation agrees with the exact value. Its exactness follows both from this check and, for every cubic, from applying the one-panel result to the two pairs of panels.
A Weight Check and a Common Mistake
A quick check on the weights is to use the constant function \(f(x)=1\). The weighted sum inside Simpson’s rule is \(1+4(1)+1=6\), so the result is \((b-a)6/6=b-a\), which is exactly \(\int_a^b 1\,dx\). The weights must therefore add up, after multiplication by the factor, to the interval length. This simple test can reveal a scaling error before a more involved calculation begins.
Worked Example: Correcting a Factor-of-Two Error
On \([0,2]\), the constant function \(f(x)=1\) has values \(1,1,1\) at the endpoints and midpoint. If the factor \((b-a)/3\) is used by mistake, the calculation becomes
But \(\int_0^2 1\,dx=2\), so this result is incorrect. The correct factor is \((b-a)/6=2/6=1/3\), giving
The error came from confusing the interval width \(b-a\) with the half-width \(h=(b-a)/2\). The one-panel factor is \(h/3=(b-a)/6\), not \((b-a)/3\).
What Exactness Does—and Does Not—Tell Us
Exactness on cubics is a precise property of Simpson’s rule, not a claim that every application gives the exact integral. For a general function, the rule uses only three values on a single panel, so exact agreement is not guaranteed. The cubic theorem tells us exactly which polynomial tests the one-panel formula must pass, and the composite argument tells us that the same exactness persists for cubics on an even, equally spaced grid.
These tests are useful when checking a formula or a hand calculation. In particular, verify the midpoint, the three function values, the weights \(1,4,1\), and the factor \((b-a)/6\). For composite Simpson calculations, also check that the panel count is even and that the interior odd-indexed and even-indexed values receive weights \(4\) and \(2\), respectively. These checks do not replace a proof, but they help catch arithmetic and setup errors.
Check Your Understanding
Use the formula and proof above to answer these questions.
- For a single Simpson panel on \([a,b]\), what is the midpoint, and what is the correct factor multiplying the weighted function values?
- Why do the cubic and linear terms contribute zero to the integral after the interval is mapped to \([-1,1]\)?
- Apply the one-panel rule to \(f(x)=x^2\) on \([0,2]\), then compare its value with the exact integral.
- Why must the panel count be even in the composite Simpson formula described here?
- What result does using \((b-a)/3\) instead of \((b-a)/6\) give for \(f(x)=1\) on \([0,2]\), and why is it wrong?