SIMPSON’S RULE IS EXACT FOR CUBICS: A SIMPLE PROOF
Rohan J. Dalpatadu and Elizabeth E. Freeman
Abstract. Simpson’s Rule is an accurate numerically stable method of ap-
proximating a definite integral using a quadrature with three points, obtained by
integrating the unique quadratic that passes through these points. The error term
in the method is a function of the fourth derivative of the integrand. Therefore, it
is easy to see that the method is exact for cubics, since the fourth derivative of a
cubic is zero, and there is no error. The error analysis uses Taylor series. In our
simple proof, we will use ordinary integration techniques.
1. Introduction. Simpson’s Rule is used to approximate the integral
b
a f (x) dx, using the points (a, f (a)), (a+ h, f (a+ h)), and (a+ 2h, f (a+ 2h)). This
method is obtained by evaluating the integral of the quadratic, passing through the
three points, over the interval [a, b], where b = a + 2h.
Simpson’s Rule. Let f : [a, b] → R be continuous. Then its integral may be
evaluated by the quadrature
b
h
f (x) dx ≈ [f (a) + 4f (a + h) + f (b)],
a 3
where h = (b − a)/2. If f has a continuous fourth derivative on [a, b], then the error
5
in this approximation is −h
90 f
(4)
(ξ(x)), for some point ξ(x) ∈ [a, b] [1].
The error term is a linear function of the fourth derivative of the function f
that would vanish if it were a cubic. Therefore, the method is exact for cubics. The
purpose of this paper is to show that Simpson’s Rule is exact for cubics by using
elementary calculus with a simple translation of the axes and a fairly straightfor-
ward approach. This proof can be presented to students with a minimal knowledge
of elementary calculus.
2. Simpson’s Rule is Exact for Cubics. To make the computations easier,
we shall use a translation of the axes.
1
Lemma. Let f : [a, b] → R be continuous. Then the translated function
g: [a, b] → R defined by g(x) = f (x + a + h) − f (a + h), x ∈ [−h, h] is obtained by
translating the axes, so that the origin is moved to (a + h, f (a + h)). Furthermore,
b h
f (x) dx = g(t) dt + 2hf (a + h).
a −h
Proof. It is easily seen that g is the translated function because the argument
in f indicates a translation of the x–axis by a + h, and the term −f (a + h) indicates
an upward shift of the y–axis by f (a + h). Furthermore,
b a+2h
f (x) dx = f (x) dx
a a
a+2h
= g(x − a − h) + f (a + h) dx
a
h a+2h
= g(t)dt + f (a + h) dx, (t = x − a − h)
−h a
h
= g(t)dt + 2hf (a + h).
−h
Theorem. Simpson’s Rule is exact for cubics; i.e., if f is a cubic polynomial
defined on [a, b], then
b
h
f (x) dx = f (a) + 4f (a + h) + f (b) .
a 3
This is the exact value of the integral of f over the interval [a, b].
Proof. Let f be a cubic polynomial whose graph passes through the points
(a, f (a)), (a + h, f (a + h)), (a + 2h, f (a + 2h)), and (a + 3h, f (a + 3h)), and let g
2
be the translated cubic obtained by shifting the x–axis by a + h, and the y–axis by
f (a + h). Then
g(−h) = f (a) − f (a + h), g(0) = 0, and g(h) = f (b) − f (a + h).
Furthermore, since g is a cubic polynomial it can be written, using [1], as
(t − 0)(t − h)(t − 2h) (t + h)(t − h)(t − 2h)
g(t) = g(−h) + 0
(−h − 0)(−h − h)(−h − 2h) (0 + h)(0 − h)(0 − 2h)
(t + h)(t − 0)(t − 2h) (t + h)(t − 0)(t − h)
+ g(h) + g(2h).
(h + h)(h − 0)(h − 2h) (2h + h)(2h − 0)(2h − h)
This reduces to
−t3 + 3ht2 − 2h2 t −t3 + ht2 + 2h2 t t3 − h 2 t
g(t) = g(−h) + g(h) + g(2h).
6h3 2h3 6h3
Since the interval of integration is [−h, h], the computations are a lot simpler:
h h h h h
h
t2 2 t3 2h3 3 t4
t dt = = 0, t dt = = , and t dt = = 0.
−h 2 −h 3 3 −h 4
−h −h −h
Thus,
h
3h 2h3 h 2h3
g(t) dt = g(−h) + g(h) + 0
−h 6h3 3 2h3 3
h
= g(−h) + g(h)
3
h
= f (a) − f (a + h) + f (b) − f (a + h)
3
h
= f (a) − 2f (a + h) + f (b) .
3
3
Using the above lemma, we obtain
b h
f (x) dx = g(t) dt + 2hf (a + h)
a −h
h
= f (a) − 2f (a + h) + f (b) + 2hf (a + h)
3
h
= f (a) + 4f (a + h) + f (b) .
3
This is Simpson’s Rule and is the exact value of the integral of the cubic polynomial
f over the interval [a, b].
3. Examples and Graphs. In this section, we provide two examples to
verify the validity of our result and to illustrate the accuracy of the method. A
graph of the unique quadratic and an arbitrary cubic is provided to explain the
result graphically.
Examples.
(1) Let f (x) = 2x3 − 4x2 + 3x − 1, x ∈ [−1, 3]. Then
3 3 3
f (x) dx = 2x − 4x2 + 3x − 1 dx
−1 −1
x4 4x3 3x2 3
= − + −x
2 3 2 −1
32
= .
3
In this example, a = −1, b = 3, and h = 2. Simpson’s Rule gives us
h
f (a) + 4f (a + h) + f (b)
3
2
32
= −2 − 4 − 3 − 1 + 4(2 − 4 + 3 − 1) + (54 − 36 + 9 − 1) = .
3 3
4
This is the exact value of the integral.
(2) Let f (x) = sin x, x ∈ [0, π3 ].
π
3 π
sin x dx = − cos x03 = 0.5.
0
π π
In this example, a = 0, b = 3, and h = 6. Simpson’s Rule gives us:
π
h π π
f (a) + 4f (a + h) + f (b) = 6 sin 0 + 4 sin + sin
3 3 6 3
√
(2 + 23 )π
= ≈ 0.500216.
18
The error in this approximation is 0.000216. The approximate value is fairly
accurate.
Graphs. The graph of the unique quadratic p2 (x) through the points (−1, 0),
(0, 1), and (1, 0) along with the graph of the cubic p3 (x) through the above three
points and the point (2, 2), appear in the following figure. It is quite evident from
the graph that
0 0 1 1
p3 (x) dx − p2 (x) dx and p3 (x) dx − p2 (x) dx
−1 −1 0 0
are equal in absolute value and have opposite signs. Therefore, the integral of the
cubic polynomial is equal to the value from Simpson’s Rule, which is obtained by
5
integrating the quadratic polynomial.
Figure 1
Ref erence
1. R. L. Burden and J. D. Faires, Numerical Analysis, Brooks/Cole Publishing
Company, New York, 1997.
Mathematics Subject Classification (2000): 65D30
Rohan J. Dalpatadu
Department of Mathematical Sciences
University of Nevada – Las Vegas
Las Vegas, NV 89154-4020
email: [email protected]
Elizabeth E. Freeman
Department of Mathematical Sciences
University of Nevada – Las Vegas
Las Vegas, NV 89154-4020
email: lizfreeman [email protected]