View
219
Download
0
Category
Preview:
Citation preview
8/17/2019 Integración Numérica (I Parte)
1/81
Numerical Differentiation & Integration
Elements of Numerical Integration I
Numerical Analysis (9th Edition)
R L Burden & J D Faires
Beamer Presentation Slidesprepared byJohn Carroll
Dublin City University
c 2011 Brooks/Cole, Cengage Learning
http://find/
8/17/2019 Integración Numérica (I Parte)
2/81
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Outline
1 Introduction to Numerical Integration
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 2 / 36
http://find/
8/17/2019 Integración Numérica (I Parte)
3/81
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Outline
1 Introduction to Numerical Integration
2 The Trapezoidal Rule
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 2 / 36
http://find/
8/17/2019 Integración Numérica (I Parte)
4/81
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Outline
1 Introduction to Numerical Integration
2 The Trapezoidal Rule
3 Simpson’s Rule
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 2 / 36
http://find/
8/17/2019 Integración Numérica (I Parte)
5/81
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Outline
1 Introduction to Numerical Integration
2 The Trapezoidal Rule
3 Simpson’s Rule
4 Comparing the Trapezoidal Rule with Simpson’s Rule
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 2 / 36
I d i T id l R l Si ’ R l C i M i P i i
http://find/
8/17/2019 Integración Numérica (I Parte)
6/81
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Outline
1 Introduction to Numerical Integration
2 The Trapezoidal Rule
3 Simpson’s Rule
4 Comparing the Trapezoidal Rule with Simpson’s Rule
5 Measuring Precision
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 2 / 36
I t d ti T id l R l Si ’ R l C i M i P i i
http://find/
8/17/2019 Integración Numérica (I Parte)
7/81
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Outline
1 Introduction to Numerical Integration
2 The Trapezoidal Rule
3 Simpson’s Rule
4 Comparing the Trapezoidal Rule with Simpson’s Rule
5 Measuring Precision
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 3 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
8/81
Introduction Trapezoidal Rule Simpson s Rule Comparison Measuring Precision
Introduction to Numerical Integration
Numerical Quadrature
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 4 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
9/81
Introduction Trapezoidal Rule Simpson s Rule Comparison Measuring Precision
Introduction to Numerical Integration
Numerical Quadrature
The need often arises for evaluating the definite integral of a
function that has no explicit antiderivative or whose antiderivativeis not easy to obtain.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 4 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
10/81
Introduction Trapezoidal Rule Simpson s Rule Comparison Measuring Precision
Introduction to Numerical Integration
Numerical Quadrature
The need often arises for evaluating the definite integral of a
function that has no explicit antiderivative or whose antiderivativeis not easy to obtain.
The basic method involved in approximating b
a f (x ) dx is called
numerical quadrature. It uses a sum
n i =0 a i f (x i ) to approximate
b a f (x ) dx .
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 4 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/http://goback/
8/17/2019 Integración Numérica (I Parte)
11/81
Introduction Trapezoidal Rule Simpson s Rule Comparison Measuring Precision
Introduction to Numerical Integration
Quadrature based on interpolation polynomials
The methods of quadrature in this section are based on the
interpolation polynomials.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 5 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
12/81
Introduction Trapezoidal Rule Simpson s Rule Comparison Measuring Precision
Introduction to Numerical Integration
Quadrature based on interpolation polynomials
The methods of quadrature in this section are based on the
interpolation polynomials.
The basic idea is to select a set of distinct nodes {x 0, . . . , x n } fromthe interval [a , b ].
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 5 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
13/81
p p p g
Introduction to Numerical Integration
Quadrature based on interpolation polynomials
The methods of quadrature in this section are based on the
interpolation polynomials.
The basic idea is to select a set of distinct nodes {x 0, . . . , x n } fromthe interval [a , b ].Then integrate the Lagrange interpolating polynomial
P n (x ) =
n
i =0 f (x i )Li (x )
and its truncation error term over [a , b ] to obtain:
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 5 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
14/81
p p p g
Introduction to Numerical Integration
Quadrature based on interpolation polynomials (Cont’d)
b a
f (x ) dx =
b a
n
i =0
f (x i )Li (x ) dx +
b a
n
i =0
(x − x i ) f (n +1)(ξ (x ))
(n + 1)! dx
=n
i =0
a i f (x i ) + 1
(n + 1)!
b a
n i =0
(x − x i )f (n +1)(ξ (x )) dx
where ξ (x ) is in [a , b ] for each x and
a i =
b a
Li (x ) dx , for each i = 0, 1, . . . , n
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 6 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
15/81
Introduction to Numerical Integration
Quadrature based on interpolation polynomials (Cont’d)The quadrature formula is, therefore,
b
a
f (x ) dx ≈n
i =0
a i f (x i )
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 7 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
16/81
Introduction to Numerical Integration
Quadrature based on interpolation polynomials (Cont’d)The quadrature formula is, therefore,
b
a
f (x ) dx ≈n
i =0
a i f (x i )
where
a i =
b a
Li (x ) dx , for each i = 0, 1, . . . , n
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 7 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
17/81
Introduction to Numerical Integration
Quadrature based on interpolation polynomials (Cont’d)The quadrature formula is, therefore,
b
a
f (x ) dx ≈n
i =0
a i f (x i )
where
a i =
b a
Li (x ) dx , for each i = 0, 1, . . . , n
and with error given by
E (f ) = 1
(n + 1)!
b a
n i =0
(x − x i )f (n +1)(ξ (x )) dx
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 7 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
18/81
Outline
1 Introduction to Numerical Integration
2 The Trapezoidal Rule
3 Simpson’s Rule
4 Comparing the Trapezoidal Rule with Simpson’s Rule
5 Measuring Precision
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 8 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
19/81
Numerical Integration: Trapezoidal Rule
Derivation (1/3)
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 9 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
20/81
Numerical Integration: Trapezoidal Rule
Derivation (1/3)
To derive the Trapezoidal rule for approximating b
a f (x ) dx , let x 0 = a ,x 1 = b , h = b − a
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 9 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
21/81
Numerical Integration: Trapezoidal Rule
Derivation (1/3)
To derive the Trapezoidal rule for approximating b
a f (x ) dx , let x 0 = a ,x 1 = b , h = b − a and use the linear Lagrange polynomial:
P 1(x ) = (x − x 1)(x 0 − x 1) f (x 0) + (x − x 0)(x 1 − x 0) f (x 1)
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 9 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
22/81
Numerical Integration: Trapezoidal Rule
Derivation (1/3)
To derive the Trapezoidal rule for approximating b
a f (x ) dx , let x 0 = a ,x 1 = b , h = b − a and use the linear Lagrange polynomial:
P 1(x ) = (x − x 1)(x 0 − x 1) f (x 0) + (x − x 0)(x 1 − x 0) f (x 1)
Then
b a f (x ) dx =
x 1x 0
(x −x 1)
(x 0 − x 1) f (x 0) + (x
−x 0)
(x 1 − x 0) f (x 1)
dx
+ 1
2
x 1x 0
f ′′(ξ (x ))(x − x 0)(x − x 1) dx .
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 9 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
23/81
Numerical Integration: Trapezoidal Rule
Derivation (2/3)The product (x − x 0)(x − x 1) does not change sign on [x 0, x 1], so theWeighted Mean Value Theorem for Integrals See Theorem can be applied
to the error term
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 10 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
24/81
Numerical Integration: Trapezoidal Rule
Derivation (2/3)The product (x − x 0)(x − x 1) does not change sign on [x 0, x 1], so theWeighted Mean Value Theorem for Integrals See Theorem can be applied
to the error term to give, for some ξ in (x 0, x 1),
x 1
x 0
f ′′(ξ (x ))(x − x 0)(x − x 1) dx
= f ′′(ξ )
x 1x 0
(x − x 0)(x − x 1) dx
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 10 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
25/81
Numerical Integration: Trapezoidal Rule
Derivation (2/3)The product (x − x 0)(x − x 1) does not change sign on [x 0, x 1], so theWeighted Mean Value Theorem for Integrals See Theorem can be applied
to the error term to give, for some ξ in (x 0, x 1),
x 1
x 0
f ′′(ξ (x ))(x − x 0)(x − x 1) dx
= f ′′(ξ )
x 1x 0
(x − x 0)(x − x 1) dx
= f ′′(ξ )
x 3
3 − (x 1 + x 0)
2 x 2 + x 0x 1x
x 1
x 0
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 10 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
26/81
Numerical Integration: Trapezoidal Rule
Derivation (2/3)The product (x − x 0)(x − x 1) does not change sign on [x 0, x 1], so theWeighted Mean Value Theorem for Integrals See Theorem can be applied
to the error term to give, for some ξ in (x 0, x 1),
x 1
x 0
f ′′(ξ (x ))(x − x 0)(x − x 1) dx
= f ′′(ξ )
x 1x 0
(x − x 0)(x − x 1) dx
= f ′′(ξ )
x 3
3 − (x 1 + x 0)
2 x 2 + x 0x 1x
x 1
x 0
= −h 3
6 f ′′(ξ )
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 10 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
27/81
Numerical Integration: Trapezoidal Rule
Derivation (3/3)
Consequently, the last equation, namely
x 1
x 0
f ′′(ξ (x ))(x −
x 0)(x −
x 1) dx =−
h 3
6 f ′′(ξ )
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 11 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
28/81
Numerical Integration: Trapezoidal Rule
Derivation (3/3)
Consequently, the last equation, namely
x 1
x 0
f ′′(ξ (x ))(x −
x 0)(x −
x 1) dx =−
h 3
6
f ′′(ξ )
implies that
b
a
f (x ) dx = (x − x 1)2
2(x 0 − x 1)f (x 0) +
(x − x 0)2
2(x 1 − x 0)f (x 1)
x 1
x 0 − h 3
12
f ′′(ξ )
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 11 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
29/81
Numerical Integration: Trapezoidal Rule
Derivation (3/3)
Consequently, the last equation, namely
x 1
x 0
f ′′(ξ (x ))(x −
x 0)(x −
x 1) dx =−
h 3
6
f ′′(ξ )
implies that
b
a
f (x ) dx = (x − x 1)2
2(x 0 − x 1)f (x 0) +
(x − x 0)2
2(x 1 − x 0)f (x 1)
x 1
x 0 − h 3
12
f ′′(ξ )
= (x 1 − x 0)
2 [f (x 0) + f (x 1)] − h
3
12f ′′(ξ )
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 11 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
30/81
Numerical Integration: Trapezoidal Rule
Using the notation h = x 1
−x 0 gives the following rule:
The Trapezoidal Rule b a
f (x ) dx = h
2[f (x 0) + f (x 1)] − h
3
12f ′′(ξ )
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 12 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
31/81
Numerical Integration: Trapezoidal Rule
Using the notation h = x 1
−x 0 gives the following rule:
The Trapezoidal Rule b a
f (x ) dx = h
2[f (x 0) + f (x 1)] − h
3
12f ′′(ξ )
Note:
The error term for the Trapezoidal rule involves f ′′, so the rule
gives the exact result when applied to any function whose second
derivative is identically zero, that is, any polynomial of degree one
or less.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 12 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/http://goback/
8/17/2019 Integración Numérica (I Parte)
32/81
Numerical Integration: Trapezoidal Rule
Using the notation h = x 1
−x 0 gives the following rule:
The Trapezoidal Rule b a
f (x ) dx = h
2[f (x 0) + f (x 1)] − h
3
12f ′′(ξ )
Note:
The error term for the Trapezoidal rule involves f ′′, so the rule
gives the exact result when applied to any function whose second
derivative is identically zero, that is, any polynomial of degree one
or less.
The method is called the Trapezoidal rule because, when f is a
function with positive values, b
a f (x ) dx is approximated by the
area in a trapezoid, as shown in the following diagram.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 12 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
33/81
Trapezoidal Rule: The Area in a Trapezoid
y
x a5 x 0 x 1 5 b
y5 f ( x )
y5 P1( x )
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 13 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
34/81
Outline
1 Introduction to Numerical Integration
2 The Trapezoidal Rule
3 Simpson’s Rule
4 Comparing the Trapezoidal Rule with Simpson’s Rule
5 Measuring Precision
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 14 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
35/81
Numerical Integration: Simpson’s Rule
Simpson’s rule results from integrating over [a , b ] the second Lagrange
polynomial with equally-spaced nodes x 0 = a , x 2 = b , and x 1 = a + h ,where h = (b − a )/2:
y
x a5 x 0 x 2 5 b x 1
y5 f ( x )
y5 P2( x )
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 15 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
36/81
Numerical Integration: Simpson’s Rule
Naive Derivation
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 16 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
N i l I i Si ’ R l
http://find/
8/17/2019 Integración Numérica (I Parte)
37/81
Numerical Integration: Simpson’s Rule
Naive DerivationTherefore
b a
f (x ) dx =
x 2x 0
(x − x 1)(x − x 2)(x 0
−x 1)(x 0
−x 2)
f (x 0) + (x − x 0)(x − x 2)(x 1
−x 0)(x 1
−x 2)
f (x 1)
+ (x − x 0)(x − x 1)(x 2 − x 0)(x 2 − x 1)
f (x 2)
dx
+
x 2x 0
(x − x 0)(x − x 1)(x − x 2)6
f (3)(ξ (x )) dx .
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 16 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
N i l I i Si ’ R l
http://find/
8/17/2019 Integración Numérica (I Parte)
38/81
Numerical Integration: Simpson’s Rule
Naive DerivationTherefore
b a
f (x ) dx =
x 2x 0
(x − x 1)(x − x 2)(x 0
−x 1)(x 0
−x 2)
f (x 0) + (x − x 0)(x − x 2)(x 1
−x 0)(x 1
−x 2)
f (x 1)
+ (x − x 0)(x − x 1)(x 2 − x 0)(x 2 − x 1)
f (x 2)
dx
+
x 2x 0
(x − x 0)(x − x 1)(x − x 2)6
f (3)(ξ (x )) dx .
Deriving Simpson’s rule in this manner, however, provides only an
O (h 4) error term involving f (3).
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 16 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
N i l I t ti Si ’ R l
http://find/
8/17/2019 Integración Numérica (I Parte)
39/81
Numerical Integration: Simpson’s Rule
Naive DerivationTherefore
b a
f (x ) dx =
x 2x 0
(x − x 1)(x − x 2)(x 0
−x 1)(x 0
−x 2)
f (x 0) + (x − x 0)(x − x 2)(x 1
−x 0)(x 1
−x 2)
f (x 1)
+ (x − x 0)(x − x 1)(x 2 − x 0)(x 2 − x 1)
f (x 2)
dx
+
x 2x 0
(x − x 0)(x − x 1)(x − x 2)6
f (3)(ξ (x )) dx .
Deriving Simpson’s rule in this manner, however, provides only an
O (h 4) error term involving f (3). By approaching the problem in anotherway, a higher-order term involving f (4) can be derived.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 16 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
N i l I t ti Si ’ R l
http://find/
8/17/2019 Integración Numérica (I Parte)
40/81
Numerical Integration: Simpson’s Rule
Alternative Derivation (1/5)
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 17 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
N merical Integration Simpson’s R le
http://find/
8/17/2019 Integración Numérica (I Parte)
41/81
Numerical Integration: Simpson’s Rule
Alternative Derivation (1/5)
Suppose that f is expanded in the third Taylor polynomial about x 1.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 17 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
42/81
Numerical Integration: Simpson s Rule
Alternative Derivation (1/5)
Suppose that f is expanded in the third Taylor polynomial about x 1.
Then for each x in [x 0, x 2], a number ξ (x ) in (x 0, x 2) exists with
f (x ) = f (x 1) + f ′(x 1)(x
−x 1) +
f ′′(x 1)
2
(x
−x 1)
2 + f ′′′(x 1)
6
(x
−x 1)
3
+f (4)(ξ (x ))
24 (x − x 1)4
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 17 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
43/81
Numerical Integration: Simpson s Rule
Alternative Derivation (1/5)
Suppose that f is expanded in the third Taylor polynomial about x 1.
Then for each x in [x 0, x 2], a number ξ (x ) in (x 0, x 2) exists with
f (x ) = f (x 1) + f ′(x 1)(x
−x 1) +
f ′′(x 1)
2
(x
−x 1)
2 + f ′′′(x 1)
6
(x
−x 1)
3
+f (4)(ξ (x ))
24 (x − x 1)4
and
x 2
x 0
f (x ) dx =
f (x 1)(x − x 1) + f ′
(x 1)2
(x − x 1)2 + f ′′
(x 1)6
(x − x 1)3
+ f ′′′(x 1)
24 (x − x 1)4
x 2x 0
+ 1
24
x 2x 0
f (4)(ξ (x ))(x − x 1)4 dx
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 17 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
44/81
Numerical Integration: Simpson s Rule
Alternative Derivation (2/5)
Because (x − x 1)4 is never negative on [x 0, x 2], the Weighted MeanValue Theorem for Integrals See Theorem
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 18 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
45/81
Numerical Integration: Simpson s Rule
Alternative Derivation (2/5)
Because (x − x 1)4 is never negative on [x 0, x 2], the Weighted MeanValue Theorem for Integrals See Theorem implies that
1
24
x 2
x 0
f (4)(ξ (x ))(x − x 1)4 dx = f (4)(ξ 1)
24
x 2
x 0
(x − x 1)4 dx
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 18 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
46/81
Numerical Integration: Simpson s Rule
Alternative Derivation (2/5)
Because (x − x 1)4 is never negative on [x 0, x 2], the Weighted MeanValue Theorem for Integrals See Theorem implies that
1
24
x 2
x 0
f (4)(ξ (x ))(x − x 1)4 dx = f (4)(ξ 1)
24
x 2
x 0
(x − x 1)4 dx
= f (4)(ξ 1)
120 (x − x 1)5
x 2x 0
for some number ξ 1 in (x 0, x 2).
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 18 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
47/81
Numerical Integration: Simpson s Rule
1
24
x 2x 0
f (4)(ξ (x ))(x − x 1)4 dx = f (4)(ξ 1)
120 (x − x 1)5
x 2x 0
Alternative Derivation (3/5)
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 19 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
48/81
Numerical Integration: Simpson s Rule
1
24
x 2x 0
f (4)(ξ (x ))(x − x 1)4 dx = f (4)(ξ 1)
120 (x − x 1)5
x 2x 0
Alternative Derivation (3/5)
However, h = x 2 − x 1 = x 1 − x 0, so
(x 2 − x 1)2 − (x 0 − x 1)2 = (x 2 − x 1)4 − (x 0 − x 1)4 = 0
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 19 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
49/81
Numerical Integration: Simpson s Rule
1
24
x 2x 0
f (4)(ξ (x ))(x − x 1)4 dx = f (4)(ξ 1)
120 (x − x 1)5
x 2x 0
Alternative Derivation (3/5)
However, h = x 2 − x 1 = x 1 − x 0, so
(x 2 − x 1)2 − (x 0 − x 1)2 = (x 2 − x 1)4 − (x 0 − x 1)4 = 0
whereas
(x 2 − x 1)3 − (x 0 − x 1)3 = 2h 3 and (x 2 − x 1)5 − (x 0 − x 1)5 = 2h 5
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 19 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
50/81
Numerical Integration: Simpson s Rule
Alternative Derivation (4/5)
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 20 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
51/81
Numerical Integration: Simpson s Rule
Alternative Derivation (4/5)
Consequently,
x 2
x 0
f (x ) dx = f (x 1)(x −x 1) +
f ′(x 1)
2
(x
−x 1)
2 + f ′′(x 1)
6
(x
−x 1)
3
+ f ′′′(x 1)
24 (x − x 1)4
x 2x 0
+ 1
24
x 2x 0
f (4)(ξ (x ))(x − x 1)4 dx
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 20 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/http://goback/
8/17/2019 Integración Numérica (I Parte)
52/81
Numerical Integration: Simpson s Rule
Alternative Derivation (4/5)
Consequently,
x 2
x 0
f (x ) dx = f (x 1)(x −x 1) +
f ′(x 1)
2 (x
−x 1)
2 + f ′′(x 1)
6 (x
−x 1)
3
+ f ′′′(x 1)
24 (x − x 1)4
x 2x 0
+ 1
24
x 2x 0
f (4)(ξ (x ))(x − x 1)4 dx
can be re-written as
x 2x 0
f (x ) dx = 2hf (x 1) + h 3
3 f ′′(x 1) +
f (4)(ξ 1)
60 h 5
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 20 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
53/81
g p
Alternative Derivation (5/5)
If we now replace f ′′(x 1) by the approximation given by the SecondDerivative Midpoint Formula See Formula
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 21 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
54/81
g p
Alternative Derivation (5/5)
If we now replace f ′′(x 1) by the approximation given by the SecondDerivative Midpoint Formula See Formula we obtain
x 2
x 0
f (x ) dx = 2hf (x 1) + h 3
3
1
h 2
[f (x 0)
−2f (x 1) + f (x 2)]
− h 2
12
f (4)(ξ 2)+
f (4)(ξ 1)
60 h 5
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 21 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
55/81
g p
Alternative Derivation (5/5)
If we now replace f ′′(x 1) by the approximation given by the SecondDerivative Midpoint Formula See Formula we obtain
x 2
x 0
f (x ) dx = 2hf (x 1) + h 3
3
1
h 2
[f (x 0)
−2f (x 1) + f (x 2)]
− h 2
12
f (4)(ξ 2)+
f (4)(ξ 1)
60 h 5
= h
3[f (x 0) + 4f (x 1) + f (x 2)]
−
h 5
12 1
3f (4)(ξ 2)
−
1
5f (4)(ξ 1)
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 21 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
56/81
g p
Alternative Derivation (5/5)
If we now replace f ′′(x 1) by the approximation given by the SecondDerivative Midpoint Formula See Formula we obtain
x 2
x 0
f (x ) dx = 2hf (x 1) + h 3
3
1
h 2
[f (x 0)
−2f (x 1) + f (x 2)]
− h 2
12
f (4)(ξ 2)+
f (4)(ξ 1)
60 h 5
= h
3[f (x 0) + 4f (x 1) + f (x 2)]
−
h 5
12 1
3f (4)(ξ 2)
−
1
5f (4)(ξ 1)
It can be shown by alternative methods that the values ξ 1 and ξ 2 in thisexpression can be replaced by a common value ξ in (x 0, x 2). Thisgives Simpson’s rule.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 21 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
57/81
Simpson’s Rule
x 2
x 0 f (x ) dx =
h
3 [f (x 0) + 4f (x 1) + f (x 2)] − h 5
90 f
(4)
(ξ )
The error term in Simpson’s rule involves the fourth derivative of f , so it
gives exact results when applied to any polynomial of degree three or
less.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 22 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Outline
http://find/
8/17/2019 Integración Numérica (I Parte)
58/81
1 Introduction to Numerical Integration
2 The Trapezoidal Rule
3 Simpson’s Rule
4 Comparing the Trapezoidal Rule with Simpson’s Rule
5 Measuring Precision
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 23 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Trapezoidal Rule .v. Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
59/81
Example
Compare the Trapezoidal rule and Simpson’s rule approximations to
20
f (x ) dx when f (x ) is
(a) x 2 (b) x 4 (c) (x + 1)−1
(d)√
1 + x 2 (e) sin x (f) e x
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 24 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Trapezoidal Rule .v. Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
60/81
Solution (1/3)
On [0, 2], the Trapezoidal and Simpson’s rule have the forms
Trapezoidal:
20
f (x ) dx ≈ f (0) + f (2)
Simpson’s: 2
0
f (x ) dx ≈ 13
[f (0) + 4f (1) + f (2)]
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 25 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Trapezoidal Rule .v. Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
61/81
Solution (1/3)
On [0, 2], the Trapezoidal and Simpson’s rule have the forms
Trapezoidal:
20
f (x ) dx ≈ f (0) + f (2)
Simpson’s: 2
0
f (x ) dx ≈ 13
[f (0) + 4f (1) + f (2)]
When f (x ) = x 2 they give
Trapezoidal: 2
0
f (x ) dx ≈ 02 + 22 = 4
Simpson’s:
20
f (x ) dx ≈ 13
[(02) + 4 · 12 + 22] = 83
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 25 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Trapezoidal Rule .v. Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
62/81
Solution (2/3)
The approximation from Simpson’s rule is exact because its
truncation error involves f (4), which is identically 0 when f (x ) = x 2.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 26 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Trapezoidal Rule .v. Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
63/81
Solution (2/3)
The approximation from Simpson’s rule is exact because its
truncation error involves f (4), which is identically 0 when f (x ) = x 2.
The results to three places for the functions are summarized in the
following table.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 26 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Trapezoidal Rule .v. Simpson’s Rule
http://find/
8/17/2019 Integración Numérica (I Parte)
64/81
Solution (3/3): Summary Results
(a) (b) (c) (d) (e) (f)
f (
x )
x 2 x 4
(x
+ 1
)
−1 √
1 +
x 2 sin x e x
Exact value 2.667 6.400 1.099 2.958 1.416 6.389
Trapezoidal 4.000 16.000 1.333 3.326 0.909 8.389
Simpson’s 2.667 6.667 1.111 2.964 1.425 6.421
Notice that, in each instance, Simpson’s Rule is significantly superior.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 27 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Outline
http://find/
8/17/2019 Integración Numérica (I Parte)
65/81
1 Introduction to Numerical Integration
2 The Trapezoidal Rule
3 Simpson’s Rule
4 Comparing the Trapezoidal Rule with Simpson’s Rule
5 Measuring Precision
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 28 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
66/81
Rationale
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 29 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
67/81
Rationale
The standard derivation of quadrature error formulas is based on
determining the class of polynomials for which these formulas
produce exact results.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 29 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
68/81
Rationale
The standard derivation of quadrature error formulas is based on
determining the class of polynomials for which these formulas
produce exact results.
The following definition is used to facilitate the discussion of this
derivation.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 29 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
69/81
Rationale
The standard derivation of quadrature error formulas is based on
determining the class of polynomials for which these formulas
produce exact results.
The following definition is used to facilitate the discussion of this
derivation.
Definition
The degree of accuracy or precision, of a quadrature formula is the
largest positive integer n such that the formula is exact for x k , for each
k = 0, 1, . . . , n .
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 29 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
70/81
Rationale
The standard derivation of quadrature error formulas is based on
determining the class of polynomials for which these formulas
produce exact results.
The following definition is used to facilitate the discussion of this
derivation.
Definition
The degree of accuracy or precision, of a quadrature formula is the
largest positive integer n such that the formula is exact for x k , for each
k = 0, 1, . . . , n .
This implies that the Trapezoidal and Simpson’s rules have degrees of
precision one and three, respectively.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 29 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
71/81
Establishing the Degree of Precision
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 30 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
72/81
Establishing the Degree of PrecisionIntegration and summation are linear operations; that is,
b a
(αf (x ) + β g (x )) dx = α
b a
f (x ) dx + β
b a
g (x ) dx
and
n i =0
(αf (x i ) + β g (x i )) = αn
i =0
f (x i ) + β n
i =0
g (x i ),
for each pair of integrable functions f and g and each pair of real
constants α and β .
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 30 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
73/81
Establishing the Degree of PrecisionIntegration and summation are linear operations; that is,
b a
(αf (x ) + β g (x )) dx = α
b a
f (x ) dx + β
b a
g (x ) dx
and
n i =0
(αf (x i ) + β g (x i )) = αn
i =0
f (x i ) + β n
i =0
g (x i ),
for each pair of integrable functions f and g and each pair of real
constants α and β . This implies the following:
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 30 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
74/81
Degree of Precision
The degree of precision of a quadrature formula is n if and only if the
error is zero for all polynomials of degree k = 0, 1, . . . , n , but is notzero for some polynomial of degree n + 1.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 31 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
75/81
Degree of Precision
The degree of precision of a quadrature formula is n if and only if the
error is zero for all polynomials of degree k = 0, 1, . . . , n , but is notzero for some polynomial of degree n + 1.
Footnote
The Trapezoidal and Simpson’s rules are examples of a class of
methods known as Newton-Cotes formulas.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 31 / 36
Introduction Trapezoidal Rule Simpson’s Rule Comparison Measuring Precision
Numerical Integration: Measuring Precision
http://find/
8/17/2019 Integración Numérica (I Parte)
76/81
Degree of Precision
The degree of precision of a quadrature formula is n if and only if the
error is zero for all polynomials of degree k = 0, 1, . . . , n , but is notzero for some polynomial of degree n + 1.
Footnote
The Trapezoidal and Simpson’s rules are examples of a class of
methods known as Newton-Cotes formulas.
There are two types of Newton-Cotes formulas, open and closed.
Numerical Analysis (Chapter 4) Elements of Numerical Integration I R L Burden & J D Faires 31 / 36
http://find/
8/17/2019 Integración Numérica (I Parte)
77/81
Questions?
http://find/
8/17/2019 Integración Numérica (I Parte)
78/81
Reference Material
The Weighted Mean Value Theorem for Integrals
Suppose f ∈ C[a b] the Riemann integral of g exists on [a b]
http://find/
8/17/2019 Integración Numérica (I Parte)
79/81
Suppose f ∈ C [a , b ], the Riemann integral of g exists on [a , b ],and g (x ) does not change sign on [a , b ]. Then there exists anumber c in (a , b ) with
b a
f (x )g (x ) dx = f (c )
b a
g (x ) dx .
When g (x ) ≡ 1, this result is the usual Mean Value Theorem forIntegrals. It gives the average value of the function f over the
interval [a , b ] as
f (c ) = 1
b − a b
a
f (x ) dx .
See Diagram
Return to Derivation of the Trapezoidal Rule
Return to Derivation of Simpson’s Method
The Mean Value Theorem for Integrals
1 b
http://find/
8/17/2019 Integración Numérica (I Parte)
80/81
f (c ) = 1
b
−a
a
f (x ) dx .
Return to the Weighted Mean Value Theorem for Integrals
x
y
f (c)
y5 f ( x )
a bc
Numerical Differentiation Formulae
http://find/
8/17/2019 Integración Numérica (I Parte)
81/81
Second Derivative Midpoint Formula
f ′′(x 0) = 1
h 2[f (x 0
−h )
−2f (x 0) + f (x 0 + h )]
− h 2
12
f (4)(ξ )
for some ξ , where x 0 − h < ξ
Recommended