trapezoidal
rule
for
numerical
integration
2.6
OPERATORS
IN
NUMERICAL
ANALYSIS
75
where we expanded (1+AY using the binomial infinite series.Equations (2.28)
and (2.29) givethe desired evaluationof the integral.
Let us make a few remarks before developing any commonly used rules of
approximation.First, once
h is set, the function can be evaluatedonly at
Xo
+nh,
wheren is apositiveinteger.This meansthat fn is givenonly for positiveiotegers
n. Thus, in the sum in (2.28) ka must be an integer. Since k is an integer, we
conclude that
a must be an integer. Second, since N =
Ma
for some integer M,
we must choose N to be a multiple
of
a. Third, if we areto be able to evaluate
Jaf(M-l)a [the last term io (2.28)], J
a
cannot have powers of A higher than a,
because An f(M-l)a contaics a term of the form
f(xo
+
(M
-
l)ah
+
nh)
= f(XN +(n -
a)h),
whichforn > a givesf atapointbeyondtheupperlimit.Thus,inthepower-series
expansionof J
a,
we must make sure that
no power
of
A beyond a is retained.
There are several specific
Ja's
commonly used in numerical integration. We
will consider these next. The trapezoidal
rnle
sets a = 1. Accordiog to the
remarks above, we therefore
retain terms up to the firstpower in the expansionof
J
a.
Then
(2.29) gives JI =J =h(1 +
~A).
Substituting this in Equation (2.28),
we obtain
(
N- l )
N-l
1=
h(1 +
~A)
~
fk = h
~[!k
+
~(fk+l
-
fk)]
h
N-l
h
="2
L(fk
+ fk+l) =
"2(fo+2fl
+
..
·+2fN-l
+fN).
k~O
(2.30)
Simpson's
one-third
rule
for
numerical
integration
Simpson's
three-eighths
ruie
for
numerical
integration
Simpson's one-third rule sets a = 2. Thus, we have to retain all terms
up to the A2 term. However, for
a = 2, the third power of A disappears in
Equation
(2.29), and we get an extra ''power'' of accuracy for free! Because of
this,Simpson'sone-thirdruleispopularfornumericalintegrations.Equation
(2.29)
yieldsJ2 = 2h(1 +A +
~A
2). Substituting this in (2.28) yields
h N/2-1 h N/2-1
1=
- L
(61
+6A +A 2)fzk = - L (flk+2 +
4flk+l
+
flk)
3 k=O 3 k=O
h
=
"3
(fo
+
4fl
+
2fz
+
4/3
+...+
4fN-l
+
fN).
(2.31)
It
is understood,of course,thatN is aneveninteger.Thefactor tgivesthismethod
its name.
For Simpson's three-eighths rule, we set
a = 3, retain terms up to A3, and
use Equation
(2.29) to obtaio
J3 = 3h(1 +
~A
+
~A
2 +
fA
3) =
3:
(81 +
l2A
+6A 2 +A3).