Information Technology Reference
In-Depth Information
Z
x
i C1
f.x/dx
.x
i C1
x
i
/
1
2
Œf .x
i
/
C
f.x
i C1
/ :
x
i
Since
x
i C1
x
i
D
h;
we have the approximation
Z
x
i C1
h
2
Œf .x
i
/
C
f.x
i C1
/ :
f.x/dx
(1.14)
x
i
Next, we apply this approximation to each of the terms in (
1.13
). This leads to
Z
b
Z
x
i C1
f.x/dx
D
n
X
i D0
n
X
h
2
f.x/dx
Œf .x
i
/
C
f.x
i C1
/ :
(1.15)
a
x
i
i D0
This expression can be simplified slightly. By expanding the sum, we observe that
n
X
Œf .x
i
/
C
f.x
i C1
/
D
Œf .x
0
/
C
f.x
1
/
C
Œf .x
1
/
C
f.x
2
/
C
Œf .x
2
/
C
f.x
3
/
i D0
CC
Œf .x
n2
/
C
f.x
n1
/
C
Œf .x
n1
/
C
f.x
n
/ :
Here we note that, except for i
D
0 and i
D
n, all the f.x
i
/ terms appear twice in
this sum. Hence, we have
n
X
Œf .x
i
/
C
f.x
i C1
/
D
f.x
0
/
C
2Œf.x
1
/
C
f.x
2
/
CC
f.x
n1
/
C
f.x
n
/:
i D0
By using this observation in (
1.15
), we get
Z
b
f.x/dx
h
1
2
f.x
n
/
;
1
2
f.x
0
/
C
f.x
1
/
C
f.x
2
/
CC
f.x
n1
/
C
a
which can be written more compactly as
f.x/dx
h
"
1
2
f.x
n
/
#
:
Z
b
2
f.x
0
/
C
n
X
i D1
1
f.x
i
/
C
(1.16)
a
This approximation is referred to as the
composite trapezoidal rule
5
of integration.
A simple example is illustrated in Fig.
1.5
.
5
In the rest of the text we often use the term trapezoidal rule as shorthand for the composite
trapezoidal rule.