Chapter19
Chapter19
Integration:
f x dx
b
I a
Newton-Cotes Formulas
• The Newton-Cotes formulas are the most common numerical integration
schemes.
• Generally, they are based on replacing a complicated function or
tabulated data with a polynomial that is easy to integrate:
f x dx f x dx
b b
I a a n
b f b f a
I f (a) x a dx
a
ba
f a f b
I b a
2
(width) (average height)
1 1
ò f ¢¢ (x )d x
Et = - f (x )(b - a ) Ea = - (b - a )
3 3
¢¢ a
12 12 b -a
where is somewhere between a
and b.
• Error can thus be reduced by
breaking the curve into parts.
Ex19.1)
x0 x0 x1 xn1
f x0 f x1 f x1 f x2 f xn 1 f xn
I h h h
2 2 2
h n 1
ba
I f x0 2 f xi f xn (h )
2 i 1 n
• Error for the composite trapezoidal rule
n
b a
3
n f i
b a
3
Et
12n3
f
i 1
By f '' i 1
n
, Ea
12n 2
f ''
Simpson’s Rules
• One drawback of the trapezoidal rule is that the error is related to the
second derivative of the function.
• More complicated approximation formulas can improve the accuracy for
curves - these include using (a) 2nd and (b) 3rd order polynomials.
• The formulas that result from taking the integrals under these
polynomials are called Simpson’s rules.
fn x
x x1 x x2 f x x x0 x x2 f x x x0 x x1 f x
x0 x1 x0 x2 0 x1 x0 x1 x2 1 x2 x0 x2 x1 2
• Integration over the three points simplifies to:
I f n x dx
x2
x0
x x1 x x2 f x x x0 x x2 f x x x0 x x1 f x dx
x2
x0
x0 x1 x0 x2 0 x1 x0 x1 x2 1 x2 x0 x2 x1 2
h ba
I f x0 4 f x1 f x2 (h )
3 2
x0 x0 x2 xn2
h h h
I f x0 4 f x1 f x2 f x2 4 f x3 f x4 f xn 2 4 f xn 1 f xn
3 3 3
n 1 n2
• An error estimate
f x 4
f xi 2 f x j f xn
b a
5
0
i 1 j 2
E f (4)
I (b a )
a
i , odd j , even
180n 4
3n
Numerical analysis Chapter 19 Ex 19.4)
19. Numerical Integration Formulas – Simpson’s Rules
* Lagrange polynomial interpolation for nnpoints *
n x xj
Simpson’s 3/8 Rule fn -1 (x i ) = å Li (x ) f (x i ) where Li x
i =1 j1
xi x j
• Simpson’s 3/8 rule corresponds to ji
3h é
I = ê f (x 0 ) + 3 f (x 1 ) + 3 f (x 2 ) + f (x 3 )ùú
8 ë û
where h = (b - a ) / 3
Ex 19.5)
x0 x0 x1 xn1
f x0 f x1 f x1 f x2 f xn 1 f xn
I h1 h2 hn
2 2 2
where hi : the width of segment
Ex 19.6)