Lecture15 - Integracion
Lecture15 - Integracion
Chapter 17
Numerical Integration
Formulas
Prof. Hae
Hae--Jin Choi
é
b f (b) - f ( a ) ù
I = ò ê f (a) + ( x - a )ú dx
a
ë b-a û
f ( a ) + f (b)
I = (b - a ) ® I = (b - a )(average height)
2
0.2 + 0.232
Sol.) I = (0.8 - 0) = 0.1728
2
® Et = 1.640533 – 0.1728 = 1.467733
® et = 89.5%
(b - a ) 3 n
å f ¢¢(ξ ) i
l The total integral can be calculated by Et = - å f ¢¢(ξ )
i f ¢¢ @ i =1
12n 3 i =1 n
integrating each subinterval and then adding
them together: n
(b - a )3
å f ¢¢(ξ i ) @ nf ¢¢ Ea = -
12n 2
f ¢¢
xn x1 x2 xn i =1
I = ò f n ( x ) dx = ò f n ( x ) dx + ò f n ( x ) dx + L + ò f n ( x ) dx
x0 x0 x1 xn-1
f ( x0 ) + f ( x1 ) f ( x1 ) + f ( x2 ) f ( xn -1 ) + f ( xn ) If the number of
I = ( x1 - x0 ) + ( x2 - x1 ) + L + ( xn - xn -1 )
2 2 2 segments is doubled,
n -1
f ( x0 ) + 2å f ( xi ) + f ( xn ) the error will be
n -1
hé ù quartered
I = ê f ( x0 ) + 2å f ( xi ) + f ( xn ) ú ® I = (b - a) i =1
2ë 1 2 3 2n
û Width 14444244443
i =1
Average height
Sol.
For n = 2 (h = 0.4)
f (0) = 0.2 f (0.4) = 2.456 f (0.8) = 0.232
0.2 + 2(2.456) + 0.232
I = 0.8 = 1.0688
4
E t = 1.640533 - 1.0688 = 0.57173 ε t = 34.9%
0.8 2
Ea = - 2
(-60) = 0.64
12(2)
School of Mechanical Engineering
Chung-Ang University
Numerical Methods 2010-2 13
Example 17.2 (2/2)
<Results for the composite trapezoidal rule to estimate the
integral of f(x) = 0.2 + 25x – 200x2 + 675x3 – 900x4
from x = 0 to 0.8. The exact value is 1.640533>
à As the number of segments increases, the error decreases.
n h I et (%)
2 0.4 1.0688 34.9
3 0.2667 1.3695 16.5
4 0.2 1.4848 9.5
5 0.16 1.5399 6.1
6 0.1333 1.5703 4.3
7 0.1143 1.5887 3.2
8 0.1 1.6008 2.4
9 0.0889 1.6091 1.9
10 0.08 1.6150 1.6
School of Mechanical Engineering
Chung-Ang University
Numerical Methods 2010-2 14
Simpson’s Rules
l One drawback of the trapezoidal rule is that the error is related to the
second derivative of the function.
l More complicated approximation formulas can improve the accuracy for
curves - these include using (a) 2nd and (b) 3rd order polynomials.
l 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
l Integration over the three points simplifies to:
x2
� I = ò f n ( x ) dx
x0
h f ( x0 ) + 4 f ( x1 ) + f ( x2 )
I= éë f ( x0 ) + 4 f ( x1 ) + f ( x2 ) ùû = I = (b - a )
3 6
0.85
Estimated error: Ea = - 4
(-2400) = 0.017067
180(4)
School of Mechanical Engineering
Chung-Ang University
Numerical Methods 2010-2 20
Example 17.4
l The composite version of Simpson 1/3 rule is superior to
the trapezoidal rule for most applications.
l It is limited to cases where the values are equispaced.,
even number of segments, and odd number of points.
l Odd segment and even point formula is known as
Simpson 3/8 formula.
poi
n name 공 식 절단오차
nts
Trapezoidal f ( x 0 ) + f ( x1 )
1 2 (b - a) - (1 / 12 )h 3 f ¢¢(x)
rull 2
f ( x0 ) + 4 f ( x1 ) + f ( x 2 ) - (1 / 90 )h 5 f ( 4)
( x)
2 3 Simpson 1/3 (b - a)
6
f ( x0 ) + 3 f ( x1 ) + 3 f ( x 2 ) + f ( x3 ) - (3 / 80 )h 5 f ( 4)
(x)
3 4 Simpson 3/8 (b - a)
8
7 f ( x0 ) + 32 f ( x1 ) + 12 f ( x2 ) + 32 f ( x3 ) + 7 f ( x4 )
4 5 Boole’s rull (b - a) - (8 / 945)h 7 f (6)
(x)
90
19 f ( x0 ) + 75 f ( x1 ) + 50 f ( x2 ) + 50 f ( x3 ) + 75 f ( x4 ) + 19 f ( x5 )
5 6 (b - a) - (275 / 12,096 )h 7 f ( 6 ) (x)
288
xn x1 x2 xn
I= ò x0
fn (x) dx = ò x0
fn (x ) dx + ò x1
fn (x ) dx +L+ ò x n-1
fn (x) dx
f (x0 ) + f (x1 ) f (x1 ) + f (x2 ) f (xn-1 ) + f (xn )
I = (x1 - x0 ) + (x2 - x1 ) +L+ (xn - xn-1 )
2 2 2