Numerical Integration Zerihun
Numerical Integration Zerihun
DEPARTMENT OF MATHEMATICS
Numerical Integration
B.Sc Project
By
June 2017
Metu University
i
Numerical Integration
METU UNIVERSITY
By
June 2017
Metu University
ii
ACKNOWLEDGEMENTS
The first and foremost gratitude and praise goes to the omnipotent everlasting Almighty God in the name
of Jesus Christ for his blessing and stamina I acquired to finalize my work.
I would like to express my sincere and deepest appreciation to my advisor Mr. ___________ for his
interest in my work, diligent guidance, technical support, encouragement, criticism and critical comments
from proposal preparation to final write-up of this seminar paper. He took much of his time and energy in
shaping my seminar.
ii
TABLE OF CONTENTS
ACKNOWLEDGEMENTS ii
TABLE OF CONTENTS iii
PREFACE iv
CHAPTER ONE 1
1. INTODUCTION AND PRELIMINARIES 1
1.1. Introduction 1
1.2. Objectives of the Seminar 1
1.3. Methodology 2
1.4. Preliminaries 2
1.4.1. Interpolation 2
CHAPTER TWO 6
2. Numerical Integration 6
2.1. The Trapezoidal Rule 6
2.2. Simpson’s Rules 9
2.2.1. Simpson’s 1/3 Rule 9
2.2.2. Simpson’s 3/8 Rule 14
2.3. Gaussian quadrature method 16
2.3.1. Gauss-Legendre integration methods 17
2.3.2. Gauss- Chabyshev Integration method 24
2.4. Multiple integration 29
2.4.1. Double Integration 29
2.4.1.1. Trapezoidal method 29
2.4.1.2. Simpson’s method 29
CHAPTER THREE 31
SUMMARY, CONCLUSIONS, RECOMMENDATIONS AND FUTURE WORKS 31
3.1. Summary 31
3.2. Conclusions 31
3.3. Recommendations and Future Works 32
References 33
iii
PREFACE
The purpose of this seminar paper is to discuss the numerical integration in detail. The preliminary
contains all the possible efforts to facilitate the understanding of numerical integration for which a
qualitative theory is available and also some illustrative examples was given. The study is divided in to
four chapters; the first chapter includes preliminary concepts of numerical integration. The second
chapter is concerned with the methods of finding numerical integration. The third chapter is devoted to
present the Numerical integration. The fourth chapter presents summary and conclusions of the study
what we have discussed in the main part of the seminar paper. Based on the findings and implication of
the study, thus, recommendations and future works were forwarded, too.
iv
CHAPTER ONE
1.1. Introduction
Mathematically, integration is just finding the area under a curve from one point to another. It is
b
∫ f ( x )dx
represented by a , where the symbol
∫
∫ ¿¿ ¿
is an integral sign, the numbers a and b are the lower and
upper limits of integration, respectively, the function f is the integrand of the integral, and x is the variable
of integration. Figure 1 represents a graphical demonstration of the concept.
We are interested in integration because most equations in physics are differential equations that must be
integrated to find the solution(s). Furthermore, some physical quantities can be obtained by integration,
for instance, displacement from velocity.
The problem is that sometimes integrating analytically some functions can easily become laborious. For
this reason, a wide variety of numerical methods have been developed to find the integral.
Figure 1: Integration.
Hence, this project paper intends to explore the following specific objectives:
1
To define numerical integration.
To introduce a fairly general methods of numerical integration.
To introduce different techniques of numerical integration.
Use different Gauss-Legendre and Gauss- chebyshev integration methods.
Evaluate double integrals using trapezoidal rule and Simpson’s methods
1.3. Methodology
The project will involve collecting information in some books available in libraries and will also search
the internet regularly as much as possible. All the information obtained will be recorded in the project that
will be done. In addition to this:
1. The collected materials and the techniques or methods that were under taken by other
authors will be examined in detail.
2. A detailed study of some techniques of numerical integration and many others related
concepts will be made.
3. Note of concepts and facts will be made to study the numerical integration.
4. The investigator will collect some concepts and ideas about numerical integration and
prepare reports then will make a frequent contact with the advisor throughout the project
work.
1.4. Preliminaries
In this section we present some of the materials that are relevant to all parts of numerical integration.
1.4.1. Interpolation
Different interpolating formulas for equally spaced data points and arbitrarily spaced points x 0, x
1, x 2, ….., x n for instance, Newton’s forward and backward interpolation formulas which are used
for equally spaced data points x 0, x 1, x 2, ….., x n are essential in numerical integration.
One of equally spaced data points x 0, x 1, x 2, ….., x n which is essential in numerical integration is
Lagrange’s interpolation method, which is used for n+1 arbitrarily spaced points x 0, x 1, x 2, …..,
x n. The first degree Lagrange interpolation polynomial for two points x 0 and x 1 is given by
x−x 1 x−x 1
P1 (x)=¿ f (x 0 ) +¿ f (x 1 )
x 0−x 1 x1− x0
2
P1 (x)=L0 (x)+ f ( x 0 )+ L1(x )f (x 1 )
x−x 1 x−x 0
Where L0(x)¿ and L1(x)¿
x 0−x 1 x1−x 0
The quadratic Lagrange’s interpolating polynomial for three arbitrary points x 0, x 1 and x 2 is given
by
(x−x 1) ( x −x2 )
( x−x 0) (x−x 1)
P1 ¿ = ( x 0−x 1 ) (x−x 0) ( x−x 2) + or
(x ¿ ¿ 1−x 2)f ( x 0 ) + ¿ ( x 1−x 0 ) (x ¿ ¿ 2−x 1)f ( x 2 ) ¿
(x 1−x 0 ) (x ¿ ¿ 1−x 2)f ( x 1 ) ¿
shortly,
(x−x 1) ( x −x2 )
Where Lo(x) = ,
( x 0−x 1 ) (x ¿ ¿ 0−x 2 )¿
( x−x 0) ( x−x 2 )
L1(x) ¿ and
( x 1−x 0 ) (x ¿ ¿ 1−x 2)¿
( x−x 0) ( x−x 1 )
L2(x) ¿
( x 2−x 0 ) (x ¿ ¿ 2−x 1)¿
In general for n+1 arbitrarily spaced points x 0, x 1, x 2, … .., x n , the nth degree Lagrange
interpolation polynomial is given by.
n
¿ ∑ Li ( x ) t (x i)
i=0
Where
(x−x 0 ) ( x−x 1 ) … …
Li ( x ) =
(x i−x 0) (x−x i−1) ( x−x i+1 ) … …( x−x n)
(x ¿ ¿ i−x 1 )… … ¿
(x i−x i−1) (x ¿ ¿i−xi +1)… …(x i−x n )¿
3
n
( x−x j )
Li ( x ) =¿ ∏
j=0 ( x i−x j )
j
i
Example 1: Find the second order Lagrange’s interpolating polynomial that fits the data points
(0 , 0) , ( 16 , 12 )and ( 12 , 1)
Solution:
1 1
Here x 0=0 , x 1= ∧x 2=
6 2
p ( x) =
( x− )( x− )
1
6
1
2
f ( x )+
( x−0 ) ( x− )
1
2 1
f ( ¿+
( x−0 ) ( x − )
1
6 1
f( ¿
( 0− 16 )( 0− 12 ) ( 16 −x )( 16 − 12 ) 6 ( 12 −0)( 12 − 16 ) 2
2 0
1
= 0+ x x− ( )
1 2
2 1
+
x x−
1 1
6 1 ( )
6
18
(
2 1 2
) (
1
= -9 x − x + 6 x − x
2 6 )
2 9 2
=−9 x + x+ 6 x −x
2
7 2
¿ x−3 x
2
4
Example 2: Using Lagrange’s interpolation formula find P3 (x )given that
xi -1 0 1 2
f (x i) 1 1 1 5
Solution:
L0 ( x ) =
( x−0 ) ( x −1 )( x−2 ) x ( x 2−3 x +2 )
=
(−1−0 ) (−1−1 ) (−1−2 ) −6
−1 3
= ( x −3 x 2+ 2 x )
6
1 3
= ( x −2 x 2+ x +2 )
2
−1 3
= ( x −3 x 2+ 2 x ) ( 1 ) + 1 ( x 3−2 x 2−x +2 ) . ( 1 )
6 2
1 3 2 1 3
¿ ( x −x −2 x ) . ( 1 ) + ( x −x ) .(5)
2 6
4 3 2 4
¿ x + 0. x − x +1
6 6
5
2 3 2
= x − x +1
3 3
CHAPTER TWO
2. Numerical Integration
The general problem of numerical integration is to find an approximate value of the definite
integral.
I= ∫ f ( x ) dx
a
The most common numerical integration schemes are the Newton-cotes formulas. They are
based on the strategy of replacing a complicated function or tabulated data with an
approximating (or interpolating) function that is easy to integrate.
6
Thus
b b
I= ∫ f ( x ) dx ≅ ∫ pn ( x ) dx
a a
The trapezoidal rule is the first of the newtoncotes closed integration formulas. It corresponds to
the case where the polnomid is first order. Thus
b b
I= ∫ f ( x ) dx ≅ ∫ p1 ( x ) dx
a a
where
f ( b )−f ( a )
p1(x)¿ f(a) + (x −a)
b−a
(b , f (b))
¿) f
7
The area of the region under this straight line and above the x -axis is an estimate of the integral
of f (x) between the limits a and b .
Thus
[ ]
b
f ( b )−f ( a )
I =¿ ∫ f ( x ) dx ≅ f ( a ) + ( x−a) dx
a b−a
[
= f ( a ) . x+
b−a 2(
f ( b )−f (a) x 2
−ax b
a )]|
[
f ( b )−f (a) b 2
]
2
a 2
¿ f (a)(b−a)+¿ −ab− + a
b−a 2 2
f ( b )−f (a)
¿ f (a)(b−a) + ¿
b−a
¿ f (a)(b−a)+¿
f ( b )−f (a)
b−a
(b−a)
a+b
2 (
−a )
f ( b )−f (a)
¿ f (a)(b−a)+¿ (b−a)
2
[
¿(b−a) f ( a ) +
f ( b )−f (a)
2 ]
( b−a )
¿ ( f ( a ) + f (b))
2
b
b−a
Therefore, I =∫ f ( x ) dx= ( f ( a )+ f (b) ) which is called trapezoidal rule
a 2
b
h
I =∫ f ( x ) dx= ( f ( a ) + f (b) ) , whereh=b−a.
a 2
An estimate for the local truncation error of the trapezoidal rule can be given by
3
¿ Εt = ( b−a ) f ' ' ( ε )
12
8
Thus, if the function being integrated is linear the trapezoidal rule will be exact. Otherwise, for
functions with second and higher-order derivatives some error can be occur.
One way to improve the accuracy of the trapezoidal rule is to divide the integration interval form
a to b into a number of segments. There are n+1 equally spaced base points ( x 0 , x 1 , … , x n ¿
Consequently, there are n segments of equal width.
b−a
h=
n
If a and b are denoted by x 0 and x n respectively, then the total integral can be represented as
x1 x2 xn
I =∫ f ( x ) +¿ ∫ f ( x ) dx +…+¿ ∫ f ( x ) dx ¿ ¿
x0 x1 xn−1
h h h
=
2
[ f ( x 0 ) +f ( x 1 ) ] + [ f ( x 1 )+ f ( x 2 ) ] +… [ f ( x n−1 )+ f ( x n ) ]
2 2
h
=
2
[ f ( x 0 ) +f ( x 1 ) + f ( x 1 ) + f ( x2 ) + …+f ( x n−1 ) + f ( xn ) ]
h
=
2 [
f ( x 0 ) +2 ( f ( x 1 ) + f ( x 2) + …+ f ( x n−1 ) ) + f ( x n ) ]
[ ]
n−1
h
= f ( x 0 ) +f ( x n ) +2 ∑ f ( x i )
2 i=1
[ ]
n−1
( b−a )
¿ I =¿ f ( x 0 ) + f ( x n ) +2 ∑ f ( xi )
2n i=1
Which is called the multiple –application trapezoidal rule or composite integration method
Note an error for the multiple –application trapezoidal rule can be obtained by summing the
individual errors for each segment to give.
3 n
−( b−a )
Et =
12 n3
∑ f ' ' ( ε i)
i =1
9
2.2. Simpson’s Rules
1
2.2.1. Simpson’s Rule
3
1
Simpson’s rule results when a 2nd order interpolating polynomial is substituted instead of the
3
given function. Thus
b b
I= ∫ f ( x ) dx ≅ ∫ p2 ( x ) dx
a a
If a andb are designated as x 0∧x 2 and p2(x) is represented by a second order Lagrange
polynomial, the integral becomes
[ ]
x2
b
( x−x 1 ) ( x−x 2 ) ( x−x 0 ) ( x−x 2 ) ( x−x 0 ) ( x−x 1 )
I=∫ f ( x ) dx =∫ f ( x 0 )+ + f ( x 2 ) dx
a x0 ( x 0−x 1 ) ( x 0−x 2 ) ( x 1−x 0 ) ( x 1−x 2 ) ( x 2−x 0 ) ( x 2−x 1 )
h
I≅
3
[ f ( x0 )+ 4 f ( x1 )+ f ( x2 )]
b−a 1
Where in this case h¿ , which is called Simpson’s rule.
2 3
b
b−a ( b−a )
Sineh=¿ , the above formula becomes I¿ ∫ f ( x ) dx ≅ [ f ( x 0 ) + 4 f ( x1 ) + f ( x 2 ) ]
2 a 6
Remarks:
1
1. Simpson’s rule can also be derived by integrating the forward Newton Gregory
3
interpolating polynomial
1
2. The estimated error for Simpson’s rule is :
3
−1 5 (IV )
Et = h f ( ε ) or
90
10
5
−( b−a ) ( IV ) b−a
Et = f ( ε ) where a< ε <b and h=
2880 2
a+b ' 1
3. Since, x 0=a , x 1= ∧x 2=b , Simpso n s rule also given as
2 3
[ ]
b
I =∫ f ( x ) dx=
a
( b−a )
6
f ( a )+ 3 f ( )
a+ b
2
+ f ( b)
1
dx
I =∫
0 1+ x
1
ii) Simpson’s rule and obtain a bound for the errors.
3
Solution:
1
dx 1−0
I =∫ = ( f ( 0 )+ ( 1 ) )
0 1+ x 2
¿
1
2( )
1+
1
2
¿
3
4
= 0.75
|E t|≤
( b−a )3
max |f ' ' ( x )|≤
12 0 ≤x ≤1
1
max
| | 2
≤
12 0≤ x ≤1 ( 1+ x )3 6
1
1
So, the bound for the error in trapezoidal rule is
6
11
1
ii) using Simpson’s rule , we have:
3
I =f ( x ) dx=
( b−a )
6 [
f ( a )+ 4 f
a+b
2 ( )
+ f (b)
]
[ ]
1
⟹ I =∫
0
dx 1−0
1+ x
=
6
f ( x ) +4 f
0+1
2
+ f (1) ( )
=
1
6[f ( 0) + 4 f
1
2 () 1 2 1
+ f (1) = 1+ 4. +
6 3 2 ] (
1 8 1 25
¿ 1+ + =
6 3 2 36
= 0.694444 ) ( )
Error=I −ln 2=0694444−0693147=0.001297
|E t|≤
( b−a )5
|
( IV )
max f ( x ) ≤
2880 0 ≤x ≤1
1
max
24
2880 ❑ ( 1+ x )5
=0.008333
| |
We note that in both cases, the actual error is much smaller than the error bounds obtained from
the theoretical considerations.
1
Remark: Simpson’s rule can be improved by dividing the integration interval into a number
3
b−a
of segments of equal width, h=¿ .
n
Thus the interval [a , b] is divided in equal spaced a = x 0 < x 1< x 2 <…< x n=b
b xn x2 x4 xn
¿
h
3 [ h
f ( x 0 ) +4 f ( x 1 ) +f ( x 2 ) + [ f ( x 2) + 4 f ( x3 ) + f ( x 4 ) +¿
3 ]
h
…
3
[ f ( x n−2) + 4 f ( x n−1 ) + f ( x n ) ]
12
h h h
=
3
[ f ( x 0 ) +4 f ( x 1 )+ f ( x 2 ) +f ( x 2 ) ] 3 [ ( x 2 ) + 4 f ( x 3 ) + f ( x 4 ) ] +…+ 3 [ f ( x n−2 ) + 4 f ( x n−1 ) + f ( x n ) ]
[
= f ( x 0 ) +4 f ( x 1 )+ f ( x 3 ) +…+ f ( x n−1 )+ 2 ( f ( x 2 ) + f ( x 4 ) +…+ f ( x n−2) ) +…+ f ( x n ) ]
[ ]
n−1 n−2
h
= f ( x 0 ) +f ( x n ) + 4 ∑ f ( x i ) +2 ∑ f ( x j )
3 i=1 ,3 ,5 i=2 , 4 ,6
1
Which is called the composite integration method or the multiple application Simpson’s rule.
3
Note:
2) The error in the integration method is the sum of the errors in each segment
Thus
5
−h (IV )
R L=
90
[ f ( ε 1) + f ( ε 2 ) +…+ f ( ε n ) ] Where x 2 i−2 <ε i < x 2 i ;=1 , 2, … , n
( IV ) ( IV )
Hence
5
nh5 (IV ) ( b−a ) ( IV )
|R L|≤ f ( n) = f ( n)
90 2880 n 4
( b−a ) h4 ( IV )
¿ f (n)
180
1
dx
Example 2: Evaluate the integral I = ∫
0 1+ x
ii) Composite Simpson’s rule with n=2, 4 and 8 equal sub intervals
Solution:
13
1−0 1 1
a) When n=2, we have h=¿ = and the there nodes are 0, ∧1.
2 2 2
Let I T and I s represent the values obtained by uing the trapezoidal rule and Simpson’s
rule respectively. Here we have two sub intervals for trapezoidal rule and only one
interval or Simpson’s rule.
Then
1
dx h
i) I=∫ =I T [ f ( x 0 ) +2 f ( x 1 ) + f ( x 2 ) ]
0 1+ x 2
=
1
4 [
f ( 0 ) +2 f
1
2 ()
+ f ( 1)
]
¿
1
4( 4 1
1+ +
3 2 )
17
⟹ IT = =0.708333
24
1
dx
ii I =∫ =I =[ f ( x 0 ) +2 f ( x 1 ) +f ( x 2 ) ]
0 1+ x s
¿
1
6 [
f ( 0) + 4 f
1
2 () ]
+ f ( 1)
¿ (1+ + )
1 8 1
6 3 2
25
¿
36
¿ 0.69444
1 1 1 3
b) When n=4 , We have h = and there are five nodes;)0 , , , and 1. Here we have,
4 4 2 4
x 0 1 1 3 1
4 2 4
f (x) 1 4 2 4 1
5 3 7 2
14
So, we have four sub intervals for trapezoidal rule and two subintervals for Simpson’s rule.Then
[ ( ) () () ]
1
dx h 1 1 1 3
i ¿∫ =I T = [ f ( x 0 ) +2 f ( x 1 )+ f ( x 2 ) +f ( x 3 ) + f ( x 4 ) ]¿ f ( 0 ) +2 f + f +f + f (1)
0 1+ x 2 8 4 2 4
¿
1
8 [ (
1+2 + + + = × ¿ )
4 2 4 1 1 1171 1171
5 3 7 2 8 210 1680 ]
=0.697024
[ ( ( ) ( )) ( )]
1
dx h 1 1 3 1
ii ¿∫ =I s= ¿ ¿ f ( 0 )+ f ( 1 ) +4 f +f +2 f
0 1+ x 3 12 4 4 2
=
1
12[ 1
2
4 4
5 5( 2
)
1 1747 1747
1+ + 4 + + 2. = . =
3 12 210 2520 ]
=0.693254
1 1 2 3 4 5 6 7
C) When n=8, We have h=¿ ∧¿nine nodes 0, , , , , , , , and 1.
8 8 8 8 8 8 8 8
So, we get the table below
x 0 1 1 3 1 5 3 7 1
8 4 8 2 8 4 8
f (x) 1 8 4 8 2 8 4 8 1
9 5 11 3 13 7 15 2
Here we have eight subintervals for trapezoidal rule and four subintervals for Simpson’s rule .
So, we get:
[ ( )]
7
1 i
i) I T= f ( o ) +f ( 1 ) +2 ∑ f
16 i=1 8
¿
1
16[ 1
1+ + 2 f
2 ( ( ) ( ) ( ) ( ) ( ) ( ) ( ))]
1
8
+f
1
4
+f
3
8
+f
1
2
+f
5
8
+f
3
4
+f
7
8
¿
[ (
1 3
16 2
8 4 8 2 8 4 8
+2 + + + + + +
9 5 11 3 13 7 15
= 0.694122 )]
[ ( ) ( )]
7 3
1 2i−1 2i
ii) I T= f ( o) + f ( 1) + 4 ∑ f + 2∑ f
24 i=1 8 i =1 8
¿
1
24[ 1
1+ +4 f
2
1
8
+f
3
8( ( ) ( ) ( ) ( ) ( ) ( ) ( ))] [ (
+f
5
8
+f
7
8
+2f
1
4
+f
1
2
+f
3
4
=
1 3
24 2
8 8 8 8
+4 + + +
9 11 13 15
+2 + +) (
4 2 4
5 3 7 )]
¿0.693155
15
Recall that the exact value of the integral
1
dx
I =∫ is l n 2=0.693147
0 1+ x
3
2.2.2. Simpson’s Rule
8
1
Similar to the derivation of trapezoidal and Simpson’s rules, a 3rd order Lagrange interpolating
3
polynomial can be fit to four points and integrated.
Thus
b b
I =∫ f ( x ) dx ≅ ∫ P3 ( x ) dx ¿ yield
a a
3h b−a
I=
8
[ f ( x 0) + 3 f ( x 1 )+ 3 f ( x 2 ) +f ( x 3 ) ] where h=
3
b
(b−a)
I =∫ f ( x ) dx ≅ [ f ( x 0 )+ 3 f ( x 1 ) +3 f ( x 2 ) +f ( x 3 ) ]
a 8
3 3
Which is called Simpson’s rule Simpson’s rule has an error of
8 8
5
−3 5 (iv ) ( b−a ) ( iv )
Et = h f ( ε )∨E t= f (ε )
80 6480
b−a
Where h and a¿ ε < b
3
1
dx 3
Examples 3: Evaluate the integral I =∫ by using Simpson’s rule
8
0 1+ x
Solution:
b−a 1−0 1
h= = =
3 3 3
16
1 2
Then x 0=0 , x 1= , x 2= ∧x3 =1
3 3
3
So, by Simpson’s rule, we have
8
3h
I=
8
[ f ( x 0) + 3 f ( x 1 )+ 3 f ( x 2 ) +f ( x 3 ) ]
=
1
8 [
f ( 0 ) +3 f
1
3
+3 f() ()
2
3
+ f ( 1)
]
=
1
8[ 9 9 1
1+ + +
4 5 2 ] 1 111 111
= .
8 20
=
160
=0.69375
3
3
Example 4: Evaluate I =¿ ∫ ( 1−e ) dx , . using Simpson's
−x
rule
0
8
Solution:
b−a 3−0
h= = =1
3 3
3
3h
I =∫ ( 1−e ) dx= [ f ( x 0 ) +3 f ( x 1 ) +3 f ( x 2 ) +f ( x 3 ) ]
−x
Therefore,
0 8
3
¿
8
[ f ( 0 ) +3 f ( 1 ) +3 f ( 2 ) + f ( 3 ) ]
¿
3
8[ ( ) (
1
e
1
e
1
e
3
)
0+3 1− +3 1− 2 + 1− 3 = × 5.440571= 2.040214
8 ]
Here analytically, the exact value of the integral is
3
I =∫ ( 1−e ) dx=( x +e ) 3
0
−x −x
¿0 |
17
¿ ( 3+ e−3 ) −( 0+ e0 ) =3+e−3−1=2+e−3=2+0.049787 =2.049787
= 2.049787-2.040214 = 0.009573
The general problem of numerical integration is to find an approximate value of the integral
b
I =∫ w ( x ) f ( x ) dx
a
where w ( x ) >0∈ [ a , b ]is the weight function. We assume that w ( x ) andw ( x ) f (x) are integrable, in
the Riemann sense on [ a , b ] . The above integral is approximated by a finite linear combination
of values of f (x) in the form.
b n
I =∫ w ( x ) f ( x ) dx ≈ ∑ λ Κ f ( λk ) … .. ( ¿ )
a K=0
where x k , k=0 , 1 , 2… , nare called nodes or abscissas distributed within the limits of integration
[ a , b ]and λ Κ , k =0 , 1, 2 … , nare called the weights of the integration rule or the quadrature
formula. The error of approximation is given as
b n
Rn =∫ w ( x ) f ( x ) dx−∑ λ Κ f (x k )
a k=0
Definition: An integration method of the form (*) is said to be of order p, if it produces exact
results ( Rn =0 ¿for all polynomials of degree less than or equal to p.
In (*) above, we have 2 n+2 unknowns (n+1) nodes x 'ks and (n+1) weights x 'ks and n+1 weights
's
λ k ) and the method can be made exact for polynomials of degree ≤ m=2 n+1.
In the integration method (*), the nodes x 'ks and weights λ 'ks , k =0 , 1, 2 , … , n can also obtained by
making the formula exact for polynomials of degree up to m=2 n+1.
18
When the nodes are known, i.e, m=n, the corresponding methods are called Newton-cotes
method.
When the nodes also determined, we have m=2 n+1 and the methods are called Gaussian
integration methods. Since any finite interval [ a , b ]can always be transformed to [ −1 ,1 ] ,using the
transformation .
b−a b+a
x= t+
2 2
1 n
∫ w ( x ) f ( x ) dx=∑ λ k f ( x k )
−1 k=0
In this section we shall discuss two quadrature formulas, namely, Gauss-Legendre integration
methods and Gauss-chebyseu integration methods.
1 n
∫ f ( x ) dx=∑ λk f ( x k )
−1 k=0
In this case, all the nodes x k and weights λ k are unknown. Now consider the following cases.
∫ f ( x ) dx=¿ λ 0 f ( x 0 ) ¿
−1
Here we have two unknowns λ 0 and x 0. Making the method exact for f(x)= 1, x we get
1
f ( x )=1 ∫ 1 dx=¿ λ0 f ( x 0 ) ; f ( x 0 )=1 ¿
−1
19
⇒ 2=λ0
1
f ( x )=x , ∫ xdx=λ 0 f ( x )=λ 0 x 0
−1
1
2 2
C=∫ x dx−2 f ( 0 ) ; f ¿ )= x ⟹ f ( 0 )=0∨C= - 2(0)=
2 2
−1
3 3
C 1
R1=¿ f' ' ( ε )= f ' ' ( ε ), -1¿ ε < 1
2! 3
ii) Two –point formula n=1. In this case the formula is given by
1
f (x)=1, ∫ 1 dx=¿ λ 0 f ( x 0 )+ λ1 f ( x 1 )¿
−1
1
f ( x )=x , ∫ xdx=λ 0 x 0 + λ 1 x 1
−1
⇒ 0=x 0 + λ1 x 1 … ( b )
1
f ( x )=x , ∫ x dx=¿ λ0 x 0 ¿+ λ 1 x 31
2 2 2
−1
20
2 3
⇒ 0=λ 0 x 0+ λ 1 x 1 … … ( b )
⇒ λ 1 x 1 ( x1−x 0 ) ( x 1 + x 0 )=0
2 2
Now using (c), we get = x 20+(−x 0 )
3
2 1
⇒ x 0=
3
1 1
x 0=± and x 1= ∓
√3 √3
∫ f ( x ) dx=f √13
−1
( )+f ( √13 )
the error constant is given by
[ ( √ ) ( √ )]
1
1 1
C¿ ∫ f x dx= f
4
+f
−1 3 3
⇒C¿ ( )
2 1 1 2 2 8
− + = - =
5 9 9 5 9 45
21
C (iv ) 1 (iv )
R4 = f ( ε )= f ( ε ) ,−1< ε <¿ 1
4! 135
1 2
∫ f ( x ) dx=¿ ∑ λk ( x k )=λ 0 f ( x 0 ) + λ1 f ( x 1 ) ¿+ λ 2 f ( x 2 )
−1 k=0
There are six unknowns in the method and it can be made exact for polynomials of degree up to
five
1
f (x)=1: ∫ 1 dx=¿ λ 0+ λ1 + λ 2 ¿
−1
⇒ λ 0 + λ1 + λ 2= 2…………………..(a )
1
f (x)=x :∫ xdx=¿ λ 0 x 0 + λ 1+ x 1 + λ 2+ x 2 ¿
−1
⇒ λ 0 x 0 + λ 1 x 1 + λ2 x 2=0 … … … … … ( b )
1
f ( x )=x : ∫ x dx=¿ λ0 x 0+ λ2 x2 ¿
2 2 2 2
−1
2 2 2 2
⇒ λ 0 x 0 + λ 1 x 1+ λ2 x2 = … … … … … .(c )
3
1
f ( x )=x : ∫ x dx=¿ λ0 x 0 + λ1 x 1+ λ2 x 2 ¿
3 3 3 3 3
−1
3 3 3
⇒ λ 0 x 0 + λ 1 x 1+ λ2 x2 =0 … … … …(d)
1
f ( x )=x : ∫ x dx=¿ λ0 x 0 + λ 1 x 1 + λ 2 x 2 ¿
4 4 4 4 4
−1
4 4 4 2
⇒ λ 0 x 0 + λ 1 x 1 + λ 2 x 2 = … … … …(e)
5
22
1
f ( x )=x : ∫ x dx=¿ λ0 x 0 + λ1 x 1+ λ2 x 2 ¿
5 5 5 5 5
−1
5 5 5
⇒ λ 0 x 0 + λ 1 x 1+ λ2 x2 =0 … … .(f )
λ 1 x 31 ( x12−x20) + λ2 x 32 ( x22−x 20 ) =0
Or λ 2 x 2 ( x2 −x 0)( x 2−x 1) =0
2 2 2 2
Since x 0 , x 1 , x2 , are distinct, we get on cancelling the terms ( x 2−x 0 )and ( x 2−x 1 ), we have
( λ 0−λ 2 ) x 0 + λ 0+ x1 =0
( λ 0−λ 2 ) x 30 + λ 1+ x 31=0
2 2 4 2
2 λ0 x 0= ∧2 λ0 x 0= From which we get
3 5
23
2 2 1
2 λ0 x 0 = ⇒ λ 0 = 2
3 3 x0
4 2 1 4 2
Therefore, 2 λ0 x 0= 5 ⇒ 2 x 0 = 5
3 x0
2 3
⇔ x0 =
5
⇒ x 0=±
√ 3 and then
5
x 2=±
3
5 √
1 3 1 5
Also from λ 0 x 0= , we get λ 0 = or λ 0= which gives λ 2=¿ λ
2
5 ¿
3 5 3 9 0=¿ ¿
9
5 5 10 8
λ 0+ λ1 + λ 2=0 ⇒ + λ 1+ =2 ⇒ λ 1=2− =
9 9 9 9
[ (√ ) (√ 35 )]
1
−3
∫ f ( x ) dx= 19 5f
5
+8 f ( 0 ) +5
−1
x x
Note that if we take 2=¿±
√ 3
5
¿ and 1=¿±
√ 3
5
¿ giving the same method.
[ ( √ ) (√ ) ]
1 6 6
∫ x dx= 19 5 − 35 + 0+5
6 3
5
−1
−6 8
= =
25 175
C (iv ) 8 1
R6 f ( ε )= f ( iv ) ( ε ) ¿ f (iv ) ( ε ) ,-1¿ ε < 1
6! ( 6 ! ) 175 15750
This method is called the Gauss- Legendre quadrature Methods
24
1
dx
Example 1: Evaluate the integral I= ∫ , using Gauss- Legendre three-point formula
0 1+ x
Solution:
b−a b−a
Thus, [a,b] → [−1 , 1 ] by x= t+
2 2
1
1 dx 11
dx 2 dx 1
I= ∫ =∫ =∫ ; f (x)=¿
0 1+ x
t +1 t +3 t+3
−1
1+ −1
2
[ ( √ ) (√ 35 )]
1
dx 1 3
I =¿ ∫ = 8 f ( 0 )+5 f − +5 f
−1 3+t 9 5
[ ( )
( √ ) ( √ )] ( )
1 1 1 1 1 8 5 5
¿ 8 +5 +5 ¿ + +
√ √
9 0+3 3 3 9 3 3 3
3− 3+ 3− 3+
5 5 5 5
( ) ( )
1 8 30 1 8 150
¿ + = + 1 262 131
9 3 3 9 3 42 ¿ x = =0.693122
9− 9 42 189
5
2
2 xdx
Example 2: Evaluate the integral I= ∫ 4
1 1+ x
Using the Gauss, Lagendre one-point, two –point and three-point quadrature rules. Compare
with exact solution.
25
Solution: To use the Gauss- Lagendre rules, the interval [1, 2] is to be reduced to [−1 ,1] Thus
2−1 2+1 1 3 t +3 1
X =¿ t+ = t+ = and dx = dt
2 2 2 2 2 2
1
2 2 ( t +3 ) dt 1 8 ( t+3 ) dt
∫ 1+ x 4 =∫ 1+ ¿ ¿ ¿ ¿ ∫
Therefore, 2 xdx 2 4
−1 16+(t +3)
1 −1
8 ( t+3 )
Thus f (t)=¿ 4
16+(t+3)
I =2 f (0)=2 ( 16+81
24
)= 4897 =0.4948
ii) Using the two –point formula, we get
(
I =f −1
1
√3)( )
+ 1
1
√3
=
8 − ( √ 13 +3) + 8(√ 13 +3)
( ) ( )
4 4
−1 1
16+ +3 16+ +3
√3 √3
¿ 0.3842+0.1592
¿ 0.5434
I=
1
9
5f[ (√ ) −3
5
+8 f ( 0 ) +5 (√ 35 )]
1
¿
9
[ 5 ( 0.4393 ) +8 ( 0.2474 ) + ( 0.1379 ) ]
¿ 0.5406
Thus
26
2 2
2 xdx 2 xdx
I =∫ 4 ∫
= ¿
1 1+ x 1 1+ ¿ ¿
4
du
¿∫ 4
; U= x 2 ⇒ du=2 xdx
1 1+u
−1
¿ tanu |¿41 x= 1 ⇒ u=1∧¿
= tan−1 −1
4 −tan 1 x=2⇒ u=4
−1 π
= tan4 −
4
= 0.5404
1
In Gauss- chabyshev integration method we let the weight function W ( x)=¿ .
√1−x 2
1 n
Then the method ∫ w ( x ) f ( x ) dx=∑ λ k f (λ k ¿ ¿)¿¿ is reduced to:
−1 k=0
1 n
f (x )
∫ dx=∑ λ k f (¿ x k )¿
−1 √ 1−x
2
k=0
The nodes x k and weight λ k are unknown consider the following cases.
i) One –point formula n=0. In this case the formula is given by:
1
f (x )
∫ dx=λ 0 f ( x 0) ,
−1 √1−x2
where λ 0 and x 0are unknowns to be determined.
1
dx
f ( x )=1 : ∫ =λ0
−1 √ 1−x 2
−1
⇒ sin x ¿
−1 −1
⇒ sin 1−sin (−1)=λ 0
27
π π
⇒ + = λ0
2 2
⇒ λ 0=π
1
xdx
f ( x )=x : ∫ = λ0 x 0
−1 √1−x 2
⇒0¿ λ 0 x 0
⇒ x 0=0 ,Since λ 0= π
1
f (x )
Hence, Gauss-chabychev one-point method is given by ∫ dx = πf (0)
−1 √1−x2
The error constant is given by
1 2 2 1
x dx x dx π π
C=¿ ∫ =2 ∫ ; x= sin θ ,− ≤ θ ≤ dx=cos θdθ
−1 √1−x 0 √1− x
2 2 2 2
π
2
=2∫ sin2 θdθ √ 1−sin 2 θ = √ 1−cos 2 θ = cos θ
0
x=0 ⇒ θ =0
π
x=1 ⇒ θ =
2
C π
R1= f ' ' ( ε )= f ' ' ( ε ), −1< ε< 1
2! 4
28
f (x)=¿ 1 , x , x 2 , x 3 we get
1
dx
f ( x )=1 ∫ =λ0 + λ 1
−1 √ 1−x 2
⇒ λ 0 + λ1=π … … … . ( a )❑
1
xdx
f ( x )=∫ =λ 0+ x0 + λ1+ x1
−1 √1−x 2
⇒ λ 0 + x 1 + λ 1 x 1=0 … … … . ( b )❑
1 2
x dx
f ( x )=x
2
∫ 2
=λ 0 + x 0 + λ 1+ x1
2
−1 √1−x 2
2 2 π
⇒ λ 0 x 0 + λ1 + x 1 = ……………….(c)
2
1 3
x dx
f ( x )=x
3
∫ 3 3
=λ 0 + x 0 + λ1+ x1
−1 √1−x 2
3 3
⇒ λ 0 x 0 + λ1 + x 1= 0 ……………….(d)
3 2
λ 1 x 1 + λ1 x 1 x 0 = 0
2 2
⇒ λ 0 x 1 (x ¿¿ 1 + x 0)¿= 0
⇒ λ 0 x 1 ( x 1−x 0 )( x 1 + x 0 )=0
Therefore, x1 ≠ 0
π
Substituting x 1= −x 0 in (b), we get λ 0=λ 1 Using (a), we get λ 0=¿ λ 1=¿ . Using (c), we have
2
29
π π 2 2 π 1
2 2
λ 0 x 0 + λ 1 x 1= ⇒ ( x ¿ ¿ 0 + x 0 )= ¿, Since x 1= ∓
2 2 2 √2
[ ( √ ) ( √ )]
f
−1
2
+f
1
2
( )
4
x dx π 1 1
The error constant is given by ∫ = +
−1 √1−x 2 2 4 4
[ ]
2
Setting x=sin θ , θϵ
−π π
, , we get C= ∫ sin 4 θdθ− π =2 3 . 1 . π −π =
2 2 −π 4 4 2 4 4 8
π
( )
2
C ( IV ) π ( iv )
Then the error term R4 becomes R4 f (η)= f ( η ) ; −1<η<1
4! 192
iii) Similarly three-point formula for Gauss –Chebyshev method is derived and is given
[( ) ( √23 )]
1
f √ + f ( 0 )−f
f (x )dx π − 3
by ∫ =
−1 √1−x 2 3 2
C (Vi ) π
And its error term R6 is given by R6 = f (η)= f ( v i) ( η ); −1<η<1
6! 23040
[( ) ( ) ]
1 6 6
π − √3 √3
x 6 dx π
Where C= ∫ = +0+ =
−1 √ 1−x 3 2 2 32
2
1 3
Example 3: Evaluate the integral I =¿ ∫ ( 1−x ) cos xdx and three –point quadrature rules.
2 2
−1
Solution:
30
1 3 1 1 2
f (x )dx ( 1−x 2 ) cosx dx
I =∫ ( 1−x ) cos xdx =∫ , where f(x) =( 1−x 2 ) cosx ¿ ∫
2 2 2
−1 −1 √1−x2 −1 √ 1−x 2
i) Using one-point Gauss-chebyshev formula, we get I =πf ( 0 )=π=3.14159
ii) Using two –point Gauss-chebyshev forumula we get
I=
π
3[ ( ) ( √ )]
f
1
√2
+f
1
2
=
π
3[ ( ) ( √ )]
2
1
4
cos
1
2
= 0.59709
iii) Using three-point Gauss-chebychev by formula, we get
I=
π
3 [( )
f √ +f ( 0 )+ f
− 3
1 ( 2 )]
√3
¿
π
3[(
2
1
16 ) ( )
cos √ +1
3
2 ]
= 1.13200
3
iv) Using the thee- point G-Legendre formula, We get (With f (x)=¿ ( 1−x 2 ) 2 cost ¿
I =¿
1
9[ ( )
5 f √ +8 f ( 0 )+ 5 f
− 3
1 ( √23 )]
I=
9 [( )
1 −√ 3
2
+8 f (0)+5 f ( √23 )]
[ ( ) (√ 35 )+8]
3
1 2 2
¿ 10 cos
9 5
= 1.08979
31
2.4. Multiple integration
(∫ )
d b
I =∫ f ( x , y ) dx dy … … … … … … … … … … … … . (1 )
c a
Numerically over the rectangle x=a , x=b , y =c and y=d . This integral can be evaluated
numerically, by two successive integrations in x and y directions respectively, taking into
account one variable at one time.
In trapezoidal method, first we evaluate the inner integral by trapezoidal rule. That is
(∫ )
d b
I =∫ f ( x , y ) dx dy
c a
d
b−a
=
2 c
∫ [ f ( a , y )+ f ( b , y ) ] dy
=
b−a d −c
2 2 [( f ( a , c) + f ( a , d ) )+
d−c
2
( f ( b , c ) +f ( b , d ) ) ]
(b−a)( d−c)
¿
4
[ f ( a , c ) +f ( a , d )+ f ( b , c ) +f ( b , d) ]
hk
=
4
[ f ( a , c )+ f ( a , d ) + f ( b , c ) + f (b ,d )]
32
2.4.1.2. Simpson’s method
b−a d−c
If we apply Simpson’s rule to evaluate (1) with h=¿ and k = , then we obtain the
2 2
following result.
d b
hk
I =∫ ∫ f ( x , y ) dxdy =¿ [ f ( a , c ) + f ( a , d ) +f ( b , c ) + f (b , d )+ 4 {f ( a , c+ k )+ f (a+h , c)+ f (a+h , d)+ f (b ,c +k )}+ 16
c a 4
Remark: The above procedures can be extended for evaluating multiple integrals.
2 2
dxdy
Example 1: Evaluate the integral I =∫ ∫ using the trapezoidal rule.
1 1 x+ y
Solution: H=2−1=1=k
2 2
hk
I =∫ ∫ f ( x , y ) dxdy =¿ [ f ( a , c ) + f ( a , d )=f ( b , c )+ f ( b , d ) ] ¿
1 1 4
2 2
dxdy 1
I =∫ ∫ =¿ [ f ( 1 ,1 ) + f ( 1, 2 ) + f (2 , 1 ) +f (2 ,2) ] ¿
1 1 x+ y 4
= (
1 1 1 1 1 1 17
+ + + = × =0.35417
4 2 3 3 4 4 12 )
1.5 2
dxdy
Example 2: Evaluate the integral I = ∫ ∫ using Simpson’s rule with h=0.5 (along x
y=1 x=1 x+ y
−axis ) and k =0.25 (along y -axis)
I
1.5 2
1 hk
¿∫ ∫ dxdy=¿ [ f ( 1 ,1 ) + f ( 2 ,1 ) + f (1 , 1.5 ) + f (2 , 1.5 ) + 4 {f (1.5 , 1)+ f (1 ,1.25)+ f (1.5 ,+1.5)+f (2 ,1.25)}+16
1 1 x+ y 9
= [
1 1 1 2 2 2 4 1 4
+ + + +4 + + +
72 2 3 5 7 5 9 3 13 {
+16 x
4
11
=¿ 0.184432 } ]
33
CHAPTER THREE
3.1. Summary
In this paper we studied some results concerning the numerical integration which are solved by
different techniques. Also we studied the multiple integrals through the methods of numerical
integration. We studied the numerical integration by using the techniques:
34
Simpson’s Rules
1
Simpson’s Rule
3
3
Simpson’s Rule
8
Multiple integration
o Trapezoidal method
o Simpson’s method
3.2. Conclusions
In this work, a quite general type of numerical integration has been studied. Likewise, we have
presented some results for the application of numerical integration.
In this seminar paper, we gave a brief survey of numerical integration of a given function over a
given interval.
In this seminar paper, many works have been devoted to the study of numerical integration. In
addition, the Interpolation was considered roughly in which most of its concepts were
considered. In addition, many of the applications of the interpolations, and numerical
integrations are not touched by this seminar paper. So that we feel the work is not completed.
Therefore as per the results of this seminar paper, the following recommendations and future
works are suggested.
35
The participation in the upgrading of this paper is encouraged, which helps to address the
way one understands numerical integration and its applications.
To make more conclusive recommendation, further work related to numerical integration
need to be conducted.
This narrow seminar paper can indeed be applied in other fields, thus forming strong,
formidable inter-disciplinary co-operations with others who seek to improve it is
encourageble.
Finally, based on the aforementioned, discussions and conclusions it is recommended
that the study can be repeated in this area and further investigate when several layers all
References
1. Aho, A. V., J. E. Hopcroft, and J. D. Ullman, The design and analysis of computer
algorithms, Addison-Wesley, Reading
2. Ames, W. F., Numerical methods for partial differential equations, (Third edition),
Academic Press, New York, 1992
36
3. Ascher, U. M., R. M. M. Mattheij, and R. D. Russell, Numerical solution of boundary
value problems for ordinary differential equations, Prentice-Hall, Englewood Cliffs, NJ,
1988
4. Axelsson, O. and V. A. Barker, Finite element solution of boundary value problems:
theory and computation, Academic Press, Orlando, FL, 1984
37