6.1 Basic Ideas of Numerical Integration
133
where
h =
b − a
n
.
(6.4)
That is, we get n sub-intervals of the same size h. Given the integration points, the
original integral is re-written as a sum of integrals, each integral being computed
over the sub-interval between two consecutive integration points. The integral
in (6.2) is thus expressed as
b
a
f (x)dx =
x 1
x 0
f (x)dx +
x 2
x 1
f (x)dx + . . . +
x n
x n−1
f (x)dx .
(6.5)
Note that x 0 = a and x n = b.
Proceeding from (6.5), the different integration methods will differ in the way
they approximate each integral on the right hand side. The fundamental idea is that
each term is an integral over a small interval [x i , x i+1 ], and over this small interval,
it makes sense to approximate f by a simple shape, say a constant, a straight line, or
a parabola, that can be easily integrated. The details will become clear in the coming
examples.
Computational Example To understand and compare the numerical integration
methods, it is advantageous to use a specific integral for computations and graphical
illustrations. In particular, we want to use an integral that we can calculate
by hand such that the accuracy of the approximation methods can easily be
assessed.
Our specific integral is taken from basic physics. Assume that you speed up your
car from rest, on a straight road, and wonder how far you go in T seconds. The
displacement is given by the integral
T
0 v(t)dt, where v(t) is the velocity as a
function of time. A rapidly increasing velocity function might be
v (t) = 3t
2 e
t 3
.
(6.6)
The distance traveled in 1 s is then
1
0
v(t)dt,
(6.7)
which is the integral we aim to compute by numerical methods.
By hand, we get
1
0
3t
2 e
t 3
dt =
e
t 3
1
0
≈ 1.718,
(6.8)
which is rounded to 3 decimals for convenience.
Précédent

- 154/350

Suivant