Lecture Notes Topic 8
Lecture Notes Topic 8
Numerical Integrations
by
Norhayati Rosli & Rozieana Khairuddin
Faculty of Industrial Sciences and Technology
[email protected] & [email protected]
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Description
AIMS
This chapter is aimed to solve the integration of the given functions by using
numerical integration methods.
EXPECTED OUTCOMES
REFERENCES
1. Norhayati Rosli, Nadirah Mohd Nasir, Mohd Zuki Salleh, Rozieana Khairuddin,
Nurfatihah Mohamad Hanafi, Noraziah Adzhar. Numerical Methods, Second
Edition, UMP, 2017 (Internal use)
2. Chapra, C. S. & Canale, R. P. Numerical Methods for Engineers, Sixth Edition,
McGraw–Hill, 2010.
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Content
1 Introduction
2 Numerical Integration Methods
2.1 Trapezoidal Rule
2.2 Simpson’s Rule
2.2.1 Simpson’s 1/3rd Rule
2.2.2 Simpson’s 3/8 Rule
2.3 Simpson’s 1/3rd Rule and 3/8 Rule in Tandem
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
INTRODUCTION
Integration is a process of
measuring the area under a
function 𝑓(𝑥) which is plotted on a
graph
Graphical illustration of measuring
the area under the curve is
depicted in Figure 1.
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
INTRODUCTION (Cont.)
b
Mathematically, the integration
I f ( x)dx (1)
of 𝑓(𝑥) can be formulated as
a
Equation (1) represents the integral of the function 𝑓(𝑥) with respect to the
independent variable 𝑥, that is evaluated between the limits of 𝑥 = 𝑎 to
𝑥 = 𝑏.
Integration (1) in most of the cases cannot be solved analytically due to the
complexity form of the function, 𝑓 𝑥 .
Thus requires numerical integration methods to solve the integration (1).
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
INTRODUCTION (Cont.)
Numerical Integration Methods
Simpson’s Rule
2 Two Types 1 Trapezoidal Rule
of Methods
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS
Trapezoidal Rule
Geometrically, it is equivalent to
approximate the area of the trapezoid
under the straight line connecting 𝑓(𝑎)
and 𝑓(𝑏) as indicated in Figure 2.
Figure 2: Graphical illustration of the
approximation of the integral via
Trapezoidal rule
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Single Trapezoidal rule: Formula
h Single application of
I f (a ) f (b) Trapezoidal rule
2
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Example 1
Evaluate 1
sin 3 ( x) 1 dx
0
by using Trapezoidal rule.
Solution
b 1, a 0 and h b a 1 0 1.
1
0 sin 3
x 1
dx
1 0
2
f 0 f 1
0.5 1 1.2633
1.1317
Therefore, the numerical integration of Example 1 is 1.1317
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Composite Trapezoidal Rule
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Graphical Representation of Composite Trapezoidal Rule
x1 x2 xn
I
x0
f ( x)dx f ( x)dx
x1
xn1
f ( x)dx (3)
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Composite Trapezoidal rule: Formula
f ( x0 ) f ( x1 ) f ( x1 ) f ( x2 ) f ( xn 1 ) f ( xn )
I h h h (4)
2 2 2
h n 1
f xn ) 2 f ( xi )
Composite
I f ( x0 ) Trapezoidal
2 i 1 Rule Formula
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Example 2
Evaluate
1
sin 3 ( x) 1 dx
0
by using trapezoidal rule with 𝑛 = 10.
Solution
Composite trapezoidal rule is used, since the number of strips , 𝑛 > 1.
b 1, a 0, n 10
Step size, ℎ
Step 1 b a 1 0
h 0.1
n 10
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Solution (Cont.)
𝑥 𝑓(𝑥)
0 1
0.1 1.0005
0.2 1.0039
1
sin 3 ( x) 1 dx
0
Step 3
0.1
2
1 1.2633 2 1.0005 1.0039 1.2168
0.1
2
2.2633 2 9.7012
1.0833
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Solution (Cont.)
1
sin 3 ( x) 1 dx
0
Step 4
0.1
2
1 1.2633 2 1.0005 1.0039 1.2168
0.1
2
2.2633 2 9.7012
1.0833
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Simpson’s Rule
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Simpson’s Rule
2 Two Types 1
Simpson’s 3/8 Rule Simpson’s 1/3rd Rule
of Methods
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Simpson’s 1/3rd Rule
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Single Application Simpson’s 1/3rd Rule
h
I f ( x0 ) 4 f ( x1 ) f ( x2 ) Single application
3 Simpson’s 1/3rd rule
𝑏−𝑎
where ℎ = .
2
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Composite Simpson’s 1/3rd Rule
The accuracy of single application of Simpson’s 1/3rd rule can be
improved by dividing the interval into 𝑛 number of strips of equal
width
The method is known as Composite Simpson’s 1/3rd rule.
The total integral can be expressed as
x2 x4 xn
I f ( x) dx f ( x) dx
x0 x2
xn2
f ( x) dx (6)
h n 1 n2
Composite
I f ( x0 ) f ( xn ) 4 f ( xi ) 2 f ( xi ) Simpson’s
3 i 1,3,5,.. i 2,4,6,.. 1/3rd Rule
1
sin 3 ( x) 1 dx
0
by using Simpson’s rule.
Solution
Single application of Simpson’s 1/3rd rule is used, since no information of step size or
number of strips is provided.
b 1, a 0, n 2
Step 1 1 0 Step size, ℎ
h 0.5
2
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Solution (Cont.)
Step 2 𝑥 𝑓(𝑥)
0 1.0
0.5 1.0537
1.0 1.2633
0.5
Step 3 I 1 4 1.0537 1.2633 1.0793
3
1
sin 3 ( x) 1 dx
0
by using Simpson’s rule with 𝑛 = 10.
Solution
Single application of Simpson’s 1/3rd rule is used, since no information of step size or
number of strips is provided.
b 1, a 0, n 10
Step 1 1 0 Step size, ℎ
h 0.1
10
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Solution (Cont.)
For each value of 𝑥, find 𝑓(𝑥)
𝑛 𝑥 𝒇(𝒙𝟎 ), 𝒇(𝒙𝒏 ) 𝒇 𝒙𝒊𝒆𝒗𝒆𝒏 𝒇 𝒙𝒊𝒐𝒅𝒅
0 0 1
1 0.1 1.0005
2 0.2 1.0039
Step 2 3 0.3 1.0128
4 0.4 1.0291
5 0.5 1.0537
6 0.6 1.0863
7 0.7 1.1258
8 0.8 1.1701
9 0.9 1.2168
10 1.0 1.2633
Numerical Methods
Total 2.2633 4.2894 by Norhayati Rosli
5.4096
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Solution (Cont.)
0.1
Step 3 I 2.2633 2 4.2894 4 5.4096 1.0827
3
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Composite Simpson’s 3/8 Rule Formula
3h
I f x0 3 f x1 3 f x2 f x3
8
Formula
ba
h
3
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Example 3
Evaluate
1
sin 3 ( x) 1 dx
0
by using Simpson’s 3/8 rule.
Solution
Three segments with four equally spaced points are required.
b 1, a 0, n 3
Step 1 1 0 1 Step size, ℎ
h
3 3
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Solution (Cont.)
Step 2 𝑥 𝑓(𝑥)
0 1.0
1 1.0174
3
2 1.1120
3
1.0 1.2633
3 13
Step 3 I 1 3 1.0174 3 1.1120 1.2633 1.0814
8
Therefore, the numerical integration is 1.0814
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Simpson’s 1/3rd Rule and 3/8 Rule in Tandem
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Example 3
Evaluate
1
sin 3 ( x) 1 dx
0
by using Simpson’s rule with 𝑛 = 5.
Solution
Three segments with four equally spaced points are required.
b 1, a 0, n 5
Step 1 1 0 Step size, ℎ
h 0.2
5
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Solution (Cont.)
1 0.4 1
Step 2
0
sin 3 ( x) 1 dx
0
sin 3 ( x) 1dx
0.4
sin 3 ( x) 1dx
𝑥 𝑓(𝑥)
0 1.0
Step 3
0.2 1.0039
0.4 1.0291
0.6 1.0863
0.8 1.1701
Numerical Methods
1.0 1.2633 by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
NUMERICAL INTEGRATION
METHODS (Cont.)
Solution (Cont.)
0.4
Step 4 sin 3 ( x) 1 dx
0.2
3
1 4 1.0039 1.0291
0
0.4030
1
3 0.2
sin 3 ( x) 1 dx
8
1.0291 3 1.0863 3 1.1701 1.2633
0.4
0.6796
1
sin 3 ( x) 1 dx 0.4030 0.6796 1.0826
0
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Conclusion
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449
Author Information
Norhayati Binti Rosli,
Senior Lecturer, Rozieana Binti Khairuddin,
Applied & Industrial Mathematics Lecturer,
Research Group, Faculty of Industrial Sciences &
Faculty of Industrial Sciences & Technology (FIST),
Technology (FIST), Universiti Malaysia Pahang,
Universiti Malaysia Pahang, 26300 Gambang, Pahang.
26300 Gambang, Pahang. UMPIR ID: 3481
SCOPUS ID: 36603244300
Google
UMPIR ID: 3449
Google Scholars: https://scholar.google.co
Scholars: https://scholar.google.com/cit m/citations?user=o_8-
ations?user=SLoPW9oAAAAJ&hl=en p0UAAAAJ&hl=en
e-mail: [email protected] e-mail: [email protected]
Numerical Methods
by Norhayati Rosli
http://ocw.ump.edu.my/course/view.php?id=449