Professional Documents
Culture Documents
Week6 Integration
Week6 Integration
1
Mathematics - Integral
2
What is Integration?
b
I f ( x ).dx
a
3
Chapter 21
Newton-Cotes Integration
Formulas
4
What is Integration?
b
I f ( x ).dx A
a
5
Newton-Cotes Integration Formulas
Introduction
• The Newton-Cotes formulas are the most
common numerical integration methods.
• They are based on the strategy of replacing a
complicated function with an approximating
function that is easy to integrate.
b b
I f ( x)dx f n ( x)dx
a a
f n ( x) a0 a1 x an 1 x n 1 an x n
6
1. Trapezoidal Rule
The trapezoidal rule uses a polynomial of the first
degree to replace the function to be integrated.
b b
I f ( x ).dx f
a a
1 ( x ).dx
f (b) f ( a )
f1 ( x ) a ( x a)
b b
ba
I f ( x ).dx f 1 ( x ).dx
a a
b
f (b) f ( a )
a ( x a ) .dx
a
ba
f (a) f (b)
I (b a)
2
7
Error of the Trapezoidal Rule
1
Et f ( )(b a) 3
12
8
Trapezoidal Rule
Example 21.1
9
Multiple Trapezoidal Rule
10
Multiple Trapezoidal Rule
11
Multiple Trapezoidal Rule
ba
h a x0 b xn
n
x1 x2 xn
f (i) nf
(b a)3
Ea 2
f
12n
14
Simpson’s Rules
15
Simpson’s Rules
16
Lagrange Interpolating Polynomials
17
Lagrange Interpolating Polynomials
x x1 x x0
f1 ( x) f ( x0 ) f ( x1 )
x0 x1 x1 x0
Lo (x) L1 ( x)
18
Lagrange Interpolating Polynomials
f 2 ( x)
x x1 x x2
f ( x0 ) Lo ( x) , j 0
x0 x1 x0 x 2
x x0 x x2
f ( x1 ) L1 ( x) , j 1
x1 x0 x1 x 2
x x0 x x1
f ( x2 ) L2 ( x) , j 2
x2 x0 x2 x1
19
Simpson’s Rules
b b
I f ( x)dx f 2 ( x)dx
a a
a x0 b x2
x2
( x x1 )( x x2 ) ( x x0 )( x x2 ) ( x x0 )( x x1 )
I f ( x0 ) f ( x1 ) f ( x2 )dx
x0
( x0 x1 )( x0 x2 ) ( x1 x0 )( x1 x2 ) ( x2 x0 )( x2 x1 )
h ba
I f ( x0 ) 4 f ( x1 ) f ( x2 ) h
3 2
21
Simpson’s 1/3 Rule
(b a) 5 ( 4)
Et f ( ) a b
2880
• Simpson’s 1/3 rule is more accurate than trapezoidal
rule.
22
The Multiple-Application Simpson’s 1/3 Rule
• Just as the trapezoidal rule, Simpson’s rule
can be improved by dividing the integration
interval into a number of segments of equal
width.
f ( xo ) 4 f ( x1 ) f ( x2 ) f ( x 2 ) 4 f ( x 3 ) f ( x4 )
I 2h 2h
6 6
f ( x n 2 ) 4 f ( x n 1 ) f ( x n ) ba
.......... 2h with h
6 n
n 1 n2
f ( xo ) f ( xn ) 4 f ( xi ) 2 f ( x j )
(b a )
i 1, 3 , 5 j 2 , 4 ,6
3n
(b a) 5 ( 4) Error is fourth derivative means the
Et f ( )
180n 4 method is third order accurate
23
The Multiple-Application Simpson’s 1/3 Rule
Graphical representation of
the multiple application of
Simpson’s 1/3 rule. Note that
the method can be employed
only if the number of segments
is even.
24
Simpson’s 3/8 Rule
If there are 2 extra points between the integration
limits a and b, then a 3rd degree polynomial can
be used instead of the parabola to replace the
function to be integrated.
25
Simpson’s 3/8 Rule
3h (b a)
I f ( x0 ) 3 f ( x1 ) 3 f ( x2 ) f ( x3 ), h
8 3
(b a) 5 ( 4)
Et f ( ) Simpson’s 3/8 Rule
6480
26
The Simpson’s 3/8
rule is used in
conjunction with the
1/3 rule to permit
evaluation
of both even and odd
numbers of segments.
27
Newton Cotes Integration-Example
Find the integral of:
f(x) = 0.2 +25 x – 200 x 2 + 675 x 3 – 900 x 4 + 400 x 5
Between the limits 0 to 0.8, f(0) = 0.2, f(0.8) = 0.232,
Iexact=1.640533
1. The trapezoidal rule (ans. 0.1728)
f (a) f (b) 0.2 0.232
I (b a) I (0.8 0) 0.1728
2 2
Et 1.640533 0.1728 1.467733 t 89.5%
f '' ( x) 400 4050 x 10,800 x 2 8000 x 3
0 .8
f ''
( x)
0
(400 4050 x 10,800 x 2 8000 x 3 ) dx
60
0.8 0
1
Ea (60)(0.8)3 2.56
12 28
Newton Cotes Integration-Example
h n 1
I f ( x0 ) 2 f ( xi ) f ( xn )
2 i 1
0.2
0.2 2(1.288 2.456 3.464) 0.232 1.4848
2
29
Newton Cotes Integration-Example
3. The Simpson 1/3 rule (ans. 1.367467)
f(0) = 0.2, f(0.4) = 0.2.456, f(0.8) = 0.232
b a 0.8 0
h 0.4
2 2
h
I f ( x0 ) 4 f ( x1 ) f ( x2 )
3
0.4
0.2 4 2.456 0.232 1.367467
3
Et 1.640533 1.367467 0.2730667 t 16.6%
f ( 4) ( x) 2400
(b a)5 ( 4) 0.85
Ea f ( ) (2400) 0.1213630
6480 6480
32
Chapter 22
Integration of Equations
33
Romberg Method
34
Romberg Method
R(0,0)
ba
R (0,0) f ( a ) f (b) R(1,0) R(1,1)
2 R(2,0) R(2,1) R(2,2)
ba
h n
, R(3,0) R(3,1) R(3,2) R(3,3)
2
2( n 1)
1
R( n,0) R( n 1,0) h
2
k 1
f a ( 2k 1)h
R ( n, m ) m
1
4 1
4m R( n, m 1) R( n 1, m 1) n 1, m 1
38
Property of Romberg Method
Theorem R(0,0)
b R(1,0) R(1,1)
a
f ( x)dx R(n, m) O(h 2 m 2 ) R(2,0) R(2,1) R(2,2)
R(3,0) R(3,1) R(3,2) R(3,3)
39
Example
1
Compute
x 2dx
0
0.5
3/8 1/3
ba
h 1, R (0,0) f (a ) f (b) 1 0 1 0.5
2 2
1 1 11 11 3
h , R (1,0) R (0,0) h ( f ( a h ))
2 2 22 24 8
R ( n, m ) m
1
4 1
4m R ( n, m 1) R ( n 1, m 1) for n 1, m 1
1 1 3 1 1
R (1,1) 1 4 R (1,0) R (0,0) 4
4 1 3 8 2 3
40
Example (cont.)
0.5
3/8 1/3
1 1 1 3 1 1 9 11
h , R ( 2,0) R (1,0) h( f ( a h ) f ( a 3h ))
4 2 2 8 4 16 16 32
R ( n, m ) m
1
4 1
4m R( n, m 1) R ( n 1, m 1)
1 1 11 3 1
R( 2,1) 4 R ( 2,0) R (1,0) 4
3 3 32 8 3
R( 2,2) 2
1
4 1
1 16 1 1
42 R( 2,1) R (1,1)
15 3 3 3
41
When do we stop?
STOP if
R ( n, n ) R ( n, n 1)
or
After a given number of steps,
for example, STOP at R(4,4)
42
Gauss Quadrature
I c0 f ( x0 ) c1 f ( x1 )
• c0 and c1 are constants, the function arguments x0 and x1 are
unknowns…….(4 unknowns)
Two points Gauss-Legendre
Formula
3
1st order, 2nd order, and 1
1
3 order functions:
rd
c0 f ( x0 ) c1 f ( x1 ) x 3 dx 0
1
Two points Gauss-Legendre
Formula
• Solving these 4 equations, we can determine c1,
c2, x1 and x2.
The weighting factors are : c0 c1 1
The Integratio n points are :
1
x0 0.5773503
3
1
x1 0.5773503
3
1 1
I f f
3 3
Two points Gauss-Legendre
Formula
• Since we used limits for the previous integration from –1
to 1 and the actual limits are usually from a to b, then we
need first to transform both the function and the
integration from the x-system to the xd-system
f()
x b 1 f(x)
f(x1)
x a 1 f(xo)
ba ba
x
2 2
ba x
dx d xo x1
2 a b
-1 1
Higher-Points Gauss-Legendre
Formula
1
I f ( )d
1
i using n Gauss points :
n
I ci f ( i ) c1 f ( 1 ) c2 f ( 2 ) ..... cn f ( n )
i 1
Multiple Points Gauss-Legendre
Points Weighting factor Function argument Exact for
2 1.0 -0.577350269 up to 3rd
1.0 0.577350269 degree