Professional Documents
Culture Documents
Lecture 06 1
Lecture 06 1
1
Introduction to Numerical
Integration
Definitions
Upper and Lower Sums
Trapezoid Method (Newton-Cotes Methods)
Romberg Method
Gauss Quadrature
Examples
2
Integration
Indefinite Integrals Definite Integrals
2 1 2 1
x x 1
x dx 2 c 0 xdx 2
2
0
3
Fundamental Theorem of Calculus
If f is continuous on an interval [a,b] ,
F is antiderivative of f (i.e., F ' (x) f(x) )
b
a
f(x)dx F(b) F(a)
x2
There is no antiderivative for : e
b
x2
No closed form solution for : e dx
a
4
The Area Under the Curve
One interpretation of the definite integral is:
Integral = area under the curve
f(x)
b
Area f(x)dx
a
a b
5
Newton-Cotes Methods
In Newton-Cote Methods, the function
is approximated by a polynomial of
order n.
Computing the integral of a polynomial
is easy.
a
b
f ( x)dx
a
b
a 0 a1 x ... a n xn
dx
b (b 2 a 2 ) (b n 1 a n 1 )
a
f ( x)dx a0 (b a ) a1
2
... an
n 1
6
Newton-Cotes Methods
Trapezoid Method (First Order Polynomials are used)
b b
a f ( x)dx
a
a0 a1x dx
a
b
f ( x)dx
b
a
a0 a1 x a 2 x
2
dx
7
Trapezoid Method
Derivation-One Interval
Multiple Application Rule
Estimating the Error
Recursive Trapezoid Method
Read 21.1
8
Trapezoid Method
b
I f ( x)dx
f (b) f (a) a
f (a ) ( x a)
ba b f (b) f (a )
I f (a) ( x a ) dx
f(x)
a
ba
b
f (b) f (a )
f (a) a x
ba a
2 b
f (b) f ( a ) x
ba 2 a
a b f (b) f (a )
b a
2
9
Trapezoid Method
Derivation-One Interval
b b f (b) f (a )
I f ( x)dx f (a) ( x a) dx
a a
ba
b f (b) f (a) f (b) f (a)
I f (a) a x dx
a
ba ba
b 2 b
f (b) f (a) f (b) f (a ) x
f (a) a x
ba a ba 2 a
f (b)
f (a )
ba
Area f (a) f (b)
2
a b
11
Trapezoid Method
Multiple Application Rule
f ( x2 ) f ( x1 )
Area x2 x1
f(x) 2
The interval [a, b] is
partitioned into n segments
a x0 x1 x2 ... xn b
b
a
f ( x)dx sum of the areas
of the trapezoids
x
x0 x1 x2 x3
a b
12
Trapezoid Method
General Formula and Special Case
f ( x)dx xi 1 xi f ( xi 1 ) f ( xi )
i 0 2
a
Obtain an estimate of
the distance traveled in
the interval [0,3].
Trapezoid Method
h xi 1 xi 1
n 1 1
T h f ( xi ) f ( x0 ) f ( xn )
i 1 2
1
Distance 1(10 12) (0 14) 29
2
15
Error in estimating the integral
Theorem
Assumption : f ' ' ( x) is continuous on [a,b]
Equal intervals (width h)
Theorem : If Trapezoid Method is used to
b
approximate a
f ( x)dx then
b a 2 ''
Error h f ( ) where [a,b]
12
ba 2
Error h max f ' ' ( x)
12 x[ a ,b ]
16
Estimating the Error
For Trapezoid Method
17
Example
1
sin( x )dx, find h so that error 105
2
0
ba 2
Error h max f ' ' ( x )
12 x[ a ,b ]
b ; a 0; f ' ( x ) cos( x ); f ' ' ( x ) sin( x )
2 1
f ' ' ( x ) 1 Error h 105
12 2
2 6
h 105 h 0.00437
(b a )
n 719 intervals
h 0.00437 18
Example
x 1.0 1.5 2.0 2.5 3.0
3
Use Trapezoid method to compute : 1
f ( x)dx
1
n 1
Trapezoid T ( f , P ) xi 1 xi f ( xi 1 ) f ( xi )
i 0 2
3 n1 1
1 f ( x)dx h f ( xi ) f ( x0 ) f ( xn )
i 1 2
1
0.5 3.2 3.4 2.8 2.1 2.7
2
5.9
20
Simpson’s Rule
21
Simpson’s Rule
22
Simpson’s Rule
23
Simpson’s Rule
24
Simpson’s Rule
25
Simpson’s Rule
26
Simpson’s Rule
27
Homework
28