Вы находитесь на странице: 1из 15

MATHEMATICS

MTHC02C02
Lecture 5
( )
x b
x a
Area Under The Curve f x dx
=
=
=
}
Numerical Integration
We know that
Area Under The Curve
So in the numerical integration methods we will try to calculate an approximation
for the area under the curve
Consider the function , then we can approximate the area as following
Area of the trapezium
Area under the curve
approximately equals to the
area of the trapezoidal. This
means
( )
( ) ( ) ( )
2
b
a
h
f x dx f a f b ~ +
}
The Trapezoidal Rule
h
( )
( ) ( )
2
h
f a f b = +
Where h b a =
( ) y f x =
The Composite Trapezoidal Rule
Let be continuous on . If we have a partition

of such that then
( ) f x [ , ] a b
[ , ] a b
0 1 2 3
, , , , ,
n
a x x x x b x = =
b a
h
n

=
| |
0 1 2 1
2 ( ) 2 ( ) 2 ( ) ( ) ( ) ( )
2
b
n
a
n
h
f x dx f f x f x f x x x f

+ + ~ + + +
}
0
( ) f x
1
( ) f x
2
( ) f x
3
( ) f x
( )
n
f x
h
Use the trapezoidal rule with n=8 to approximate
2
1
1
dx
x
}
Solution
2 1
0.125
8
b a
h
n

= = =
1
1.125 x =
0
1 x =
2
1.25 x =
3
1.375 x =
4
1.5 x =
5
1.625 x =
6
1.75 x =
7
1.875 x =
8
2 x =
0.889
1
0.8 0.727 0.667 0.615 0.571 0.533 0.5
( ) 1/
n n
f x x =
1 1 2 2 2 2 2 2 2
1.778 1 1.6 1.454 1.334 1.23 1.142 1.066 0.5
Multiply by
Example 1
2
1
1 0.125
[1 1.778 1.6 1.454 1.334 1.23
2
1.142 1.066 0.5] 0.694
dx
x
~ + + + + +
+ + + =
}
Then
Noting that
2
2
1
1
1
(2) (1) 0.693
x
x
dx Lnx Ln Ln
x
=
=
= = =
}
A man-made lake has the shape illustrated in the following figure.














Use the trapezoidal rule to estimate the surface area of the lake.
11
15
20 11
Example 2
Solution
0.2 h = We have
Area of the lake = area under the upper curve area under the lower curve
| |
| |
0 1 2 1
0 1 2 1
( ) 2 ( ) 2 ( ) 2 ( ) ( )
2
( ) 2 ( ) 2 ( ) 2 ( ) ( )
2
n n
n n
h
Area f x f x f x f x f x
h
g x g x g x g x g x

~ + + + + +
+ + + + +
( ) ( ) ( )
1 1 2 2 1 1
2 ( ) ( ) ( ) ( ) ( ) ( )
2
n n
h
f x g x f x g x f x g x

( = + + +

0.2[11 15 20 11]
11.4
= + + +
=
Consider the function , then we can approximate the area as following
Area under the
quadratic curve
Area under the curve
approximately equals to the
area under the quadratic curve.
This means
( ) ( ) 4 ( ) ( )
3 2
b
a
h a b
f x dx f a f f b
+
| |
~ + +
|
\ .
}
The Simpsons Rule
( ) 4 ( ) ( )
3 2
h a b
f a f f b
+
| |
= + +
|
\ .
Where
2
b a
h

=
h h
( ) y f x =
The Composite Simpsons Rule
Let be continuous on . If we have a partition

of such that is an even number and then
( ) f x [ , ] a b
[ , ] a b
0 1 2 3
, , , , ,
n
a x x x x b x = =
b a
h
n

=
1 3 2
1
4
2
0
4 ( ) 4 ( ) 2 ( ) 2 ( ) ( ) [
4 (
( )
3
( )] 2 ( ) )
b
a
n n n
f x f x
f x
f x f x
h
f x dx f
x
x
x f f

+ +
+
+ +
+
~ +
+
}
n
Use Simpsons rule with n=8 to approximate
2
0
5 (1 ) Ln x dx + +
}
Solution
2 0
0.25
8
b a
h
n

= = =
1
0.25 x =
0
0 x =
2
0.5 x =
3
0.75 x =
4
1 x =
5
1.25 x =
6
1.5 x =
7
1.75 x =
8
2 x =
2.2854
2.2361
2.3249 2.3579 2.386 2.4105 2.4324 2.4519
2.4695
( ) 5 (1 )
n n
f x Ln x = + +
1 1 4 2 4 2 4 2 4
2.2361 4.6499
9.4315
4.772 9.6423 4.8647 9.8074 2.4695 9.1417
Multiply by
Example 3
2
0
0.25
5 (1 ) [2.2361 (9.1417 4.6499 9.4315 4.772
3
9.6423 4.8647 9.8074) 2.4695]
Ln x dx + + ~ + + + +
+ + + +
}
Then
Simpsons rule is more accurate than the trapezoidal rule
5.51307 =
We are given that .
1
2
0
1
1 4
dx
x
t
=
+
}
Solution
1 0
0.125
8
b a
h
n

= = =
1
0.125 x =
0
0 x =
2
0.25 x =
3
0.375 x =
4
0.5 x =
5
0.625 x =
6
0.75 x =
7
0.875 x =
8
1 x =
0.9846 1 0.9411 0.8767 0.8 0.7191 0.64 0.5664 0.5
2
( ) 1/( 1)
n n
f x x = +
1 1 4 2 4 2 4 2 4
1 1.8822 3.5068 1.6 2.8764 1.28 2.2656
0.5
3.9384
Multiply by
Use Simpsons rule with n=8 to approximate
the value of to four decimal places
t
Example 4
1
2
0
1 0.125
[1 3.9384 1.8822 3.5068 1.6 2.8764
1 4 3
1.28 2.2656 0.5] 0.7854
dx
x
t
= ~ + + + + +
+
+ + + =
}
Then
0.7854
4
3.1416
t
t
~
~
Hence
For more details about this lecture you may use the following:

Our text book, chapter twenty one sections 21.1 and 21.2
Numerical Analysis by: Burden and Fares, Brooks/Cole Publications
Numerical Recipes in C; The Art of Scientific Computing by: William H. Press,
Brian P. Flannery, Saul A. Teukolsky and William T. Vetterling, Cambridge
University Press Publications
http://en.wikipedia.org/wiki/Trapezoidal_rule
http://www.intmath.com/integration/5-trapezoidal-rule.php
http://www.youtube.com/watch?v=8z6JRFvjkpc
http://en.wikipedia.org/wiki/Simpson%27s_rule
http://mathworld.wolfram.com/SimpsonsRule.html
http://www.youtube.com/watch?v=ns3k-Lz7qWU
http://www.codecogs.com/code/maths/calculus/quadrature/trapezoidal.php
http://www.dreamincode.net/forums/topic/203268-trapezoidal-rule-and-
simpsons-rule-from-fixed-array/
http://www.codecogs.com/code/maths/calculus/quadrature/simpson.php

Вам также может понравиться