Unit 3.3 Numerical Integration
Unit 3.3 Numerical Integration
Specific Objectives:
2. To apply Trapezoidal rule and Simpson’s rule in numerical integration and estimate their errors.
Detailed Content Time Ratio Notes on Teaching
16.1 Numerical Integration 1 The importance of numerical integration may be appreciated by noting how
frequently the formulation of problems in applied mathematics involves derivatives. It is
then natural to anticipate that the solutions of such problems will involve integrals.
Students are expected to know that for most integrals no representation in terms of
elementary functions is possible, and approximate integration becomes necessary. For
∫ ∫
sin x
e − x dx are difficult to find analytically.
2
example, the integrals dx and
x
Interpolating Polynomial method serves as the basis for the two integration formulae,
namely Trapezoidal rule and Simpson's rule, studied in this course, the main idea being
that if p( x ) is an approximation to f ( x ) , then
b b
∫ a
p( x ) dx ≈
∫
a
f ( x ) dx
16.2 Trapezoidal Rule 6 One way of motivating students to the learning of Trapezoidal rule is by appealing to
(a) Derivation of the the geometry of the rule, which uses a series of trapezoids to approximate the area in
trapezoidal rule question. A known definite integral such as
2
∫1
x 2 dx
can be used to demonstrate that the rule works well providing good accuracy if the
number of trapezoids is sufficient. It is easy for students to derive the Trapezoidal rule for
b
the integral
∫ a
f ( x ) dx with n trapezoids to be
∫
w
f ( x ) dx ≈
f ( x0 ) + 2f ( x1) + 2f ( x2 ) + …… + 2f ( xn −1) + f ( xn )
a 2
n −1
w
= f ( x0 ) + 2
2
k =1
∑
f ( xk ) + f ( x n )
b−a
where x0 = a , xn = b and w = .
n
Alternatively, the derivation may be done by linear interpolation in each interval. For
example, in the subinterval [x0, x1].
x1 x1
∫x0
f ( x ) dx ≈
∫ x0
p( x ) dx
x1
∫
x − x1 x − x0
= f ( x0 ) + f ( x1) dx
x0 x0 − x1 x1 − x0
w
= f ( x0 ) + f ( x1) where w = x1 − x0
115
2
By summing the area in all the subintervals, students could obtain the same formula
for Trapezoidal rule as before.
(b) Estimation of the error It is interesting to note what kind of accuracy may be expected for a given function.
Teachers may guide students to derive the maximum error as follows.
Consider the ith trapezoid of a trapezoidal integration, which lies between xi −1 and
b−a
xi , two points at a distance w = apart. Assume F ( x ) is the primitive function of
n
f ( x ) . Then, teachers may ask students to give the exact value of the integral
xi
∫
w
f ( x ) dx ( = F ( xi ) − F ( xi −1) ) and the calculated value = f ( xi −1) + f ( xi ) .
xi −1 2
Defining the error on this trapezoid as
w
Ei = f ( xi −1) + f ( xi ) − F ( xi ) − F ( xi −1)
2
Detailed Content Time Ratio Notes on Teaching
and using Taylor's series expansion of f ( xi −1) and F ( xi −1) about xi students could
be guided to discover
w3
Ei ≈ f ′′(εi )
2
By summing the errors in all the subintervals, students should be able to obtain the total
error as
w2
Maximum total error = ET = (b − a ) M where M = max f ′′(ε) for ε in the range
12
of integration.
(c) Application of Applications should be stressed. Common examples including computation of area,
trapezoidal rule work done by variable force and distance covered by a particle with given velocity, can be
given to students for illustration. The following are some of them.
Example 1
116
A curve is given by the points tabulated in the table. (t is the time travelled and v is the
speed.) Students may be required to calculate the distance covered between t = 0 and
t = 4.0.
t (hours) 0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 4.0
-1
v (kmh ) 23 20 15 11 12.5 15 18 20 22
Example 2
Use the trapezoidal rule with four equally spaced ordinates to estimate the value of
1
∫ 0
e x
dx to 3 significant figures.
Example 3
How small an interval w would be required to obtain In 2 correct to 4 decimal places?
Example 4
2
∫
1
Evaluate the integral dx using Trapezoidal rule with an accuracy of 0.001
1 1 + x2
and check the answer against the true value.
16.3 Simpson's Rule 6 The derivation can be done using the second-degree L.I.P., but the geometrical
(a) Derivation of Simpson’s meaning must be emphasized. Students should be able to realize that approximation by
rule a series of parabolic segments would, in general, more closely match a given curve
y = f (x) than would the straight lines in the Trapezoidal method.
n n −1
∑ ∑
b
∫
w
f ( x ) dx ≈ f ( x 0 ) + 4 f ( x2k −1) + 2 f ( x 2k ) + f ( x2 n )
3
a
k =1 k =1
b−a
where x0 = a , xn = b and w = .
n
Teachers should also remind students that the number of subintervals (or strips)
used in Simpson’s rule must be even, but there is no such restriction in Trapezoidal rule.
(b) Estimation of the error In a similar way to Trapezoidal rule, the truncation error of Simpson’s rule may also
be derived using Taylor’s series expansion of f ( x ) and the usual assumptions being
made as before. It is not too difficult though a bit more tedious for students themselves,
with some guidance from teachers, to arrive at the maximum total error term
w4 b−a
ET = (b − a ) M where w = and M = max f (4) (ε ) for ε in the range of
180 2n
integration.
Detailed Content Time Ratio Notes on Teaching
(c) Application of Basically, the kinds of problems resemble those of Trapezoidal rule. Here the emphasis,
Simpson’s rule apart from the application of the technique itself, should be placed on the comparison of
the degree of accuracy between the two formulae. Two examples follow.
Example 1
π
∫
6
Evaluate the integral ln(cos x ) dx by Simpson’s rule. Find the least number of strips
0
required so that the error is less than 10− in magnitude.
6
Example 2
2
∫
1
Find the value of the integral dx using both Trapezoidal and Simpson’s rule
1+ x2
1
with 6 strips. Compare their accuracy with the standard result.
13
118