Professional Documents
Culture Documents
Integration 4.6
Integration 4.6
4.6 NUMERICAL
INTEGRATION
Objectives
3
The Trapezoidal Rule
The Trapezoidal Rule
• Some elementary functions simply do not have antiderivatives
that are elementary functions.
5
The Trapezoidal Rule
• In this case, it is easier to resort to an approximation technique.
Two such techniques are described in this section.
7
The Trapezoidal Rule
• Then form a trapezoid for each subinterval (see Figure 4.43).
8
The Trapezoidal Rule
9
Note :
ba
f x0 2 f x1 2 f x2 2 f xn1 f xn
2n
ba
f x0 2 f x1 2 f x2 2 f xn1 2 f xn f xn
2n
b a n
f x0 f xn 2 f xn
2n i 1
x n
ba
f a f b 2 f xn x
2 n
i 1
f a f b n
f xn x
2 i 1
10
The Trapezoidal Rule
11
Example 1 – Approximation with the Trapezoidal Rule
12
Example 1 – Solution
•When n = 4, x = /4, and you obtain
13
Example 1 – Solution
cont’d
• For the Trapezoidal Rule, you average the function values at the
endpoints of the subintervals, but for the Midpoint Rule, you
take the function values of the subinterval midpoints.
Midpoint Rule
Trapezoidal Rule
15
Simpson’s Rule
Simpson’s Rule
• One way to view the trapezoidal approximation of a definite
integral is to say that on each subinterval, you approximate
f by a first-degree polynomial.
17
Simpson’s Rule
• Before presenting Simpson’s Rule, consider the next theorem for
evaluating integrals of polynomials of degree 2 (or less).
18
Integrals of polynomials of degree 2
b
Ax Bx
3 2
b b
a p x dx Ax Bx C dx
2
Cx
a
3 2 a
A b3 a 3
B b2 a 2
C b a
3 2
2 A b a b 2 ab a 2 3B b a b a 6C b a
6 6 6
b a
6
2 A a 2
ab b 2
3B b a 6C
2 Aa 2 2 Aab 2 Ab 2 3Bb 3Ba 6C
( Aa 2
Ba C ) Aa 2 2 Aab Ab 2 ( Ab 2 Bb C ) 2 Bb 2 Ba 4C
19
Integrals of polynomials of degree 2
( Aa 2 Ba C ) Aa 2 2 Aab Ab 2 2 Bb 2 Ba 4C ( Ab 2 Bb C )
( Aa 2 Ba C ) A(a 2 2ab b 2 ) 2 B b a 4C ( Ab 2 Bb C )
( Aa 2 Ba C ) A(a b) 2 2 B b a 4C ( Ab 2 Bb C )
2
ab
2
Aa Ba C 4 A
a b
B C A
b 2
Bb C
2 2
pa ab
4 p p b
2
20
Integrals of polynomials of degree 2
b
Ax Bx 3
2
b b
a p x dx Ax Bx C dx
2
Cx
a
3 2 a
A b3 a 3
B b2 a 2
C b a
3 2
2 A b a b 2 ab a 2 3B b a b a 6C b a
6 6 6
b a
6
2 A a 2
ab b 2
3B b a 6C
So we can get
b b a ab
a p x dx p a 4 p p b
6 2
21
Simpson’s Rule
Figure 4.45
22
Proof of Simpson’s Rule
a x0 x1 x2 x3 x4 xn2 xn1 xn b
x0 , x2 x2 , x4 xn2 , xn
x2 x2
x f x dx x p x dx
0 0
x2 x0 x0 x2
p x0 4 p p x2
6 2
2 b a n
p x0 4 p x1 p x2
6
ba
f x0 4 f x1 f x2
3n 23
Proof of Simpson’s Rule
a x0 x1 x2 x3 x4 xn2 xn1 xn b
x0 , x2 x2 , x4 xn2 , xn
x4 x2 x4
x f x dx x p x dx x p x dx
0 0 2
ba
3n
f x0 4 f x1 f x2 + f x2 4 f x3 f x4
ba
f x0 4 f x1 2 f x2 4 f x3 f x4
3n
Repeating the procedure on the entire interval [a,b] produce the Simpson’s Rule
24
Simpson’s Rule
25
Simpson’s Rule
•In Example 1, the Trapezoidal Rule was used to
•estimate
26
Example 2 – Approximation with Simpson’s Rule
• Solution
• When n = 4, you have
27
Error Analysis
Error Analysis
• When you use an approximation technique, it is important to
know how accurate you can expect the approximation to be.
• The next theorem, gives the formulas for estimating the errors
involved in the use of Simpson’s Rule and the Trapezoidal Rule.
29
Error Analysis
30
Error Analysis
• Furthermore, these errors can be made arbitrarily small by
increasing n, provided that fand f (4) are continuous and
therefore bounded in [a, b].
31
Example 3 – The Approximate Error in the Trapezoidal Rule
• Solution
• Begin by letting and finding the second
derivative of f.
• and
32
Example 3 – Solution
cont’d
• 1/(12n2) 1/100.
Figure 4.46
34
Example 3 – Solution
cont’d
35