THE TRAPEZOIDAL RULE AND SIMPSON'S
RULE
251
and from (5.0.8)
2.83 X
10-
5
::;
1-
1
6
::;
7.70 X
10-
5
The true error
is
3.18
X
10-
5
•
For
integrals in which the integrand has some kind of bad behavior, for
example, an infinite value at some point,
we
often will consider the integrand in
the form
!{!)
=
jbw(x)f(x)
dx
a
(5.0.9)
The
bad
behavior
is
assumed to be located in w( x ), called the weight function,
and the function
f(x)
will
be assumed to be well-behaved. For example, consider
evaluating
fo\ln
x)f(x)
dx
for arbitrary continuous functions
f(x).
The framework (5.0.2)-(5.0.4) gener-
alizes easily to the treatment of
(5.0.9). Methods for such integrals are considered
in Sections 5.3 and
5.6.
Most numerical integration formulas are based on defining fn(x) in (5.0.2) by
using polynomial or piecewise polynomial interpolation. Formulas using such
interpolation with evenly spaced node points are derived and discussed in
Sections
5.1
and 5.2. The Gaussian quadrature formulas, which are optimal in a
certain sense and which have very rapid convergence, are given in Section 5.3.
They are based on defining fn(x) using polynomial interpolation at carefully
selected node points that need not
be
evenly spaced.
Asymptotic error formulas for the methods of Sections
5.1 and 5.2 are given
and
discussed in Section 5.4, and some new formulas are derived based on
extrapolation with these error formulas. Some methods that control the integra-
tion error in an automatic
way,
while remaining efficient, are
giveiJ.
in Section 5.5.
Section 5.6 surveys methods for integrals that are singular or ill-behaved in some
sense, and Section
5.7
discusses the difficult task of numerical differentiation.
5.1 The Trapezoidal
Rule
and
Simpson's Rule
We begin our development of numerical integration by giving two well-known
numerical methods for evaluating
(5.1.1)
We analyze and illustrate these methods very completely, and they serve as an
introduction to the material of later sections. The interval
[a,
b]
is
always finite in
this section.