Graphics Programs Reference
In-Depth Information
f
(
x
)
h
h
Figure 6.5.
Composite Simpson's 1
/
3rule.
x
x
1
x
i
x
i
+ 1
x
i
+ 2
x
n
a
b
To obtain the
composite Simpson's 1
/
3 rule
, the integration range(
a
,
b
) is divided
into
n
−
1 panels (
n
odd)ofwidth
h
=
(
b
−
a
)
/
(
n
−
1)each, as indicated in Fig. 6.5.
Applying Eq. (a)totwo adjacent panels, wehave
x
i
+
2
f
(
x
i
+
2
)
]
h
3
f
(
x
)
dx
≈
[
f
(
x
i
)
+
4
f
(
x
i
+
1
)
+
(b)
x
i
Substituting Eq. (b) into
b
x
n
x
i
+
2
f
(
x
)
dx
n
−
2
f
(
x
)
dx
=
f
(
x
)
dx
=
a
x
1
x
i
i
=
1
,
3
,...
yields
b
f
(
x
)
dx
≈
I
=
[
f
(
x
1
)
+
4
f
(
x
2
)
+
2
f
(
x
3
)
+
4
f
(
x
4
)
+···
(6.10)
a
f
(
x
n
)]
h
3
···+
2
f
(
x
n
−
2
)
+
4
f
(
x
n
−
1
)
+
The composite Simpson's 1
3rule in Eq. (6.10) is perhaps the best-known method of
numerical integration. Its reputationissomewhat undeserved,since the trapezoidal
rule is more robust, and Romberg integrationis moreefficient.
The errorinthe composite Simpson's rule is
/
a
)
h
4
180
(
b
−
f
(4)
(
E
=
ξ
)
(6.11)
fromwhich weconcludethat Eq. (6.10) isexact if
f
(
x
) is apolynomialofdegree three
or less.
Simpson's 1
3rule requires the number of panels to beeven. If thisconditionis
not satisfied, wecan integrate over the first (or last) three panels with
Simpson's 3
/
/
8
rule
:
f
(
x
4
)]
3
h
8
I
=
[
f
(
x
1
)
+
3
f
(
x
2
)
+
3
f
(
x
3
)
+
(6.12)
and use Simpson's 1
3rule for the remaining panels. The errorinEq. (6.12) is of the
sameorderas in Eq. (6.10).
/
EXAMPLE 6.1
Derive Simpson's 1
/
3rule from Newton-Cotes formulas.
Search WWH ::
Custom Search