ABSTRACT
In many situations the assumption of a straight line segment between points on a
function or between data values may not be suitable and a better approximation
might be formed by fitting some sort of curve – for example, a parabola. Since any
three non-collinear points can be joined by a second-order parabola it is possible to
derive an expression for this function (in this case in the form of a second-order
Lagrange polynomial as set out in Chapter 8). It can be written:
)(
))((
))((
)(
))((
))((
)(
))((
))((
)(
xf
xxxx
xxxx
xf
xxxx
xxxx
xf
xxxx
xxxx
xf
−−
−−
+
−−
−−
+
−−
−−
=
(7.1)
where x
, x
and x
are the x coordinates of the three points. The situation is shown
in Figure 7.1. If this is done the area under the three points is then the integral of
the function, that is:
(7.2)
x
x
x
f(x
)
f(x
)
f(x
)
and x
, then
where
(7.4)
The method can be programmed to work on an equal strip width, dividing the
area into an even increasing number of strips and this is referred to as Simpson’s
rule. In this case the formula for the area can be written:
+++
−
=
)()(2)(4)(
)(
xfxfxfxf
n
ab
I
(7.5)
Running the method on the same problem used to illustrate the trapezoidal
rule in the previous chapter demonstrates the benefits that come from using
Simpson’s rule. The results are shown in Table 7.1. Notice that the number of
segments must be a multiple of 2 for the method to work. This comes from the fact
that three points are required to define a parabola and three points enclose two sub-
segments of area. Notice also the impressive improvement in accuracy over the
trapezoidal rule. It is worth the additional effort.