Data Loading...
S41641 Mathematics 06 Flipbook PDF
S41641 Mathematics 06
179 Views
91 Downloads
FLIP PDF 6.16MB
School of Architecture, Science and Technology, Programs
Yashwantrao Chavan Maharashtra Open University &
Course Codes Programs
V92 - SEC511 Programs
&
&
Course Codes
Course Codes V92 - SEC511 Mathematics - 06
V92: B.Sc. S41641
NUMERICAL ANALYSIS
S41641-T01
Email: [email protected]
Website: www.ycmou.ac.in Phone: +91-253-2231473
A S T, Y C M O U , N a s h i k – 4 2 2 2 2 2 , M H , I n d i a
Yashwantrao Chavan Maharashtra Open University Vice-Chancellor: Prof. Dr. E. Vayunandan School of Architecture, Science and Technology Director (I/C) of the School: Dr. Sunanda More School Council (2018-2020) Dr Sunanda More Dr Manoj Killedar Mrs Chetana Kamlaskar Director(I/c) & Associate Associate Professor, School of Assistant Professor, School of Professor, School of Architecture, Science & Architecture, Science & Architecture, Science & Technology, YCMOU, Nashik Technology, YCMOU, Nashik Technology, YCMOU, Nashik Dr. Sanjivani Mahale Dr. Rucha Gujar Dr. Pramod Khandare Associate Professor, School of Assistant Professor, Director(I/c) & Associate Education, YCMOU, Nashik School of Continuing Professor, School of Computer Education, YCMOU, Nashik Science, YCMOU, Nashik
Dr. Surendra Patole Assistant Professor, School of Commerce & Management, YCMOU, Nashik
Dr. Sanjay J. Dhoble Prof. Dept. of Physics, R.T.M. Nagpur University, Nagpur
Dr. T.M. Karade Retired Professor, R.T.M. Nagpur University, Nagpur
Mr. D.B. Saundarkar, Representative Study Centre Coordinator, (S.C. Code: 42108) Brahmpuri, Dist. Chandrapur
Dr. Gangadhar Asaram Meshram Professor of Organic Chemistry, Department of Chemistry, Mumbai University, Mumbai Dr. D.R. Nandanwar, Joint Director, Technical Education Regional Office, Pune – 411 016
Development Team Course Coordinator and Instructional Technology Editor
Book Writer
Book Editor
Dr Manoj Killedar Associate Professor, School of Architecture, Science & Technology, YCMOU, Nashik
Dr. T.M. Karade Retired Professor, R.T.M. Nagpur University, Nagpur
Dr. J. N. Salunke Former Professor, School of Mathematical Sciences, Swami Ramanand Teerth Marathwada University, Vishnupuri, Nanded -431606
This work by YCMOU is licensed under a Creative Commons AttributionNonCommercial-ShareAlike 4.0 International License . ❖ First eBook Publication : 20 March 2018 ❖ Publisher : Registrar, YCMOU, Nashik - 422 222, MH, India ❖
Free Access for this book at: https://goo.gl/iM5RHk
❖ Send Your Feedback about this book to: [email protected]
S41641-T01: Mathematics - 06
Page 1
V ICE C HANCELLOR ’ S M ESSAGE Dear Students, Greetings!!! I offer cordial welcome to all of you for the Master ’s degree programme of Yashwantrao Chavan Maharashtra Open University. As a post graduate student, you must have autonomy to learn, have information and knowledge regarding differen t dimensions in the field of Mathematics and at the same time intellectual development is necessary for application of knowledge wisely. The process of learning includes appropriate thinking, understanding important points, describing these points on the basis of experience and observation, explaining them to others by speaking or writing about them. The science of education today accepts the principle that it is possible to achieve excellence and knowledge in this regard. The syllabus of this course has been structured in this book in such a way, to give you autonomy to study easily without stirring from home. During the counseling sessions, scheduled at your respective study centre, all your doubts will be clarified about the course and you will get guidance from some qualified and experienced counsellors/ professors. This guidance will not only be based on lectures, but it will also include various techniques such as question-answers, doubt clarification. We expect your active participation in the contact sessions at the study centre. Our emphasis is on ‘self study’. If a student learns how to study, he will become independent in learning throughout life. This course book has been written with the objective of helping in self-study and giving you autonomy to learn at your convenience. During this academic year, you have to give assignments, complete laboratory activities, field visits and the Project work wherever required. You may have to opt for specialization as per programme structure. You will get experience and joy in personally doing above activities. This will enable you to assess your own progress and there by achieve a larger educational objective. We wish that you will enjoy the courses of Yashwantrao Chavan Maharashtra Open University, emerge successful and very soon become a knowledgeable and honorable Master’s degree holder of this university. I congratulate “Development Team” for the development of this excellent high quality “Self- Learning Material (SLM)” for the students. I hope and believe that this SLM will be immensely useful for all students of this program. Best Wishes! - Dr. Prof E. Vayunandan Vice-Chancellor, YCMOU
S41641-T01: Mathematics - 06
Page 2
F ORWARD B Y T HE D IRECTOR
This book aims at acquainting the students with basic fundamentals of Mathematics required at degree level. The book has been specially designed for Science students. It has a comprehensive coverage of Mathematical concepts and its application in practical life. The book contains numerous mathematical examples to build understanding and skills. The book is written with self- instructional format.
Each chapter is prepared with
articulated structure to make the contents not only easy to understand but also interesting to learn. Each chapter begins with learning objectives which are stated using Action Verbs as per the Bloom’s Taxonomy. Each Unit is started with introduction to arouse or stimulate curiosity of learner about the content/ topic. Thereafter the unit contains explanation of concepts supported by tables, figures, exhibits and solved illustrations wherever necessary for better effectiveness and understanding. This book is written in simple language, using spoken style and short sentences. Topics of each unit of the book presents from simple to complex in logical sequence. This book is appropriate for low achiever students with lower intellectual capacity and covers the syllabus of the course. Exercises given in the chapter include MCQs, conceptual questions and practical questions so as to create a ladder in the minds of students to grasp each and every aspect of a particular concept. 02 - 04 practical activities are written in the last unit in each credit block to build application of knowledge and skills from that credit part to real world scenario, case study or problem. I thank the students who have been a constant motivation for us. I am grateful to the writers, editors and the School faculty associated in this SLM development of the Programme.
- Dr. Sunanda More Director (I/C), School of Architecture, Science and Technology
S41641-T01: Mathematics - 06
Page 3
S41641 AND S41642: MATHEMATICS NUMERICAL ANALYSIS Author T M KARADE M Sc (Pure Maths-Nagpur Uni) M Sc (Maths – Shivaji Uni) Ph D (Maths-IIT Kharagpur) D Sc (Maths-Nagpur Uni) D Sc (Maths- Amravati Uni) The following notations are used in the book. • ln x means log e x • Theorem is concluded by QED, which stands for quod erat demonstrandum meaning that had to be proved The source of various examples in this text lies in • various standard texts on the subject concerned in REFERENCES • examinations from the universities • construction by the author Special thanks to Dr Sunanda More (Director) and Dr M Killedar
1
PREFACE I am pleased to submit the text entitled NUMERICAL ANALYSIS to YASHWANTRAO CHAVAN MAHARASHTRA OPEN UNIVERSITY, NASHIK. I have followed many books on the subject and are listed in the references. Though I do not claim originality, I have my way of presenting the subject. I am hopeful that the students will be benefited in their pursuit of learning mathematics. As regard to the format of the text adopted by the University, I have been benefited by the guidance from Dr Killedar, and I owe to him. Attempts are made to keep the book free from mistakes. However, I can not claim that it is totally without mistakes. Any suggestion for the improvement will be highly appreciated. Author Nagpur, March 08, 2019
2
CONTENTS
1-7
CREDIT 01
1-85
Unit 01-01: Mathematical Preliminaries
1-28
Introduction
1
1.1
Real number system R
1
1.2
Algebraic and transcendental equations f ( x) = 0
8
1.3
Some theorems from calculus
11
1.4
Maxima and minima of a function f (x)
14
1.5
Error analysis
15
Summary
28
Key words
28
Unit 01-02: Graphical solution of equations
29-38
Introduction
29
2.1
29
Graphical solution of equations
Summary
38
Key words
38
Unit 01-03: Iterative method
39-54
Introduction
39
3.1
39
Working of the method to choose initial approximation
Summary
54
Key words
54
1
Unit 01-04: Method of bisecton
55-72
Introduction
55
4.1
55
Bisection method
Summary
72
Key words
72
Unit 01-05: The method of false position (or Regula falsi method)
73-85
Introduction
73
5.1
About the method and its algorithm
73
5.2
Illustrative problems
75
Summary
85
Key words
85
CREDIT 02
87-198
Unit 02-01: The secant or the chord method
87-97
Introduction
87
1.1
Algorithm for the secant method
87
1.2
Convergence of secant method
88
Summary
97
Key words
97
Unit 02-02: The Newton-Raphson method
99-114
Introduction
99
2.1
Method and its algorithm
99
2.2
Convergence of the Newton-Raphson method
103
2.3
Newton-Raphson formula for reciprocal root
109
Summary
114
Key words
114
2
Unit 02-03: System of linear algebraic equations
115-148
Introduction
115
3.1
Matrix in brief
116
3.2
Representation of (3.1) in matrix form
127
3.3
Methods of solving (3.1) or (3.2) for m = n
131
3.4
Graphical method to solve (3.2) for n ≤ 3
132
3.5
Cramer’s rule
134
3.6
Elimination of unknowns
137
3.7
Vector and matrix norms
137
Summary
148
Key words
148
Unit 02-04: Linear equations continued
149-175
Introduction
149
4.1
Back substitution process and triangularization of a system
150
4.2
Gauss elimination method
153
4.3
Partial pivoting
161
4.4
Gauss – Jordon elimination method
164
4.5
LU decomposition method (method of Crout and Doolittle)
167
Summary
175
Key words
175
Unit 02-05: Linear equations continued
177-198
Introduction
177
5.1
Background material
177
5.2
Jacobi (or Gauss-Jacobi) method of iteration
180
5.3
Gauss-Seidel method of iteration
188
Summary
198
Key words
198
3
CREDIT 03 Unit 03-01: Finite forward difference operator
199-348 199-228
Introduction
199
1.1
Operators in general
200
1.2
Forward difference operator
202
1.3
Basic properties of the operator ∆
208
1.4
Difference of a polynomial
215
1.5
Factorial polynomial
221
Summary
228
Key words
228
Unit 03-02: Finite difference operators continued
229-252
Introduction
229
2.1
Error propagation in difference tables
229
2.2
Backward difference operator ∇
233
2.3
Shift operator E
235
2.4
Central difference operator δ
241
2.5
Average operator µ and differential operator D
244
2.6
Symbolic relations
245
Summary
252
Key words
252
Unit 03-03: Interpolation
253-286
Introduction
253
3.1
Interpolation
255
3.2
Forms of polynomials
257
3.3
Newton-Gregory forward difference interpolation formula
264
3.4
Newton-Gregory backward difference interpolation formula
266
Summary
286
Key words
286
4
Unit 03-04: Interpolation with unequal intervals
287-319
Introduction
287
4.1
Lagrange interpolation formula for unequal intervals
287
4.2
Inverse interpolation
304
4.3
Error terms and error bounds for Lagrange interpolation
307
Summary
319
Key words
319
Unit 03-05: Newton divided difference interpolation formula for unequal intervals
321-348
Introduction
321
5.1
Newton polynomial
322
5.2
Divided difference of various orders
322
5.3
Newton’s divided difference interpolation formula
334
5.4
Error term in Newton divided difference interpolation formula
347
Summary
348
Key words
348
CREDIT 04
349-488
Unit 04-01: Numerical differentiation
Introduction
349-374
349
1.1
Newton’s special formulae for derivatives at x = x0 and x = xn
350
1.2
Newton general formula for finding derivatives
362
Summary
374
Key words
374
Unit 04-02: Numerical differentiation continued
375-390
Introduction
375
2.1
Newton divided difference formula for derivatives
375
2.2
Maxima and minima of a tabulated function
384
Summary
390
Key words
390 5
Unit 04-03: Numerical integration
391-414
Introduction
391
3.1
Newton-Cotes quadrature formula
392
3.2
The first five closed quadrature formulae from Newton-Cotes formula
396
Summary
414
Key words
414
Unit 04-04: Numerical integration continued
415-438
Introduction
415
4.1
Composite trapezoidal quadrature rule
416
4.2
Composite Simpson’s one-third rule
419
4.3
Composite Simpson’s three-eighth rule
422
4.4
Composite Boole’s rule
425
4.3
Composite Weddle’s rule
428
Summary
438
Key words
438
Unit 04-05: Numerical integration continued
439-488
Introduction
439
5.1
The degree of precision and truncation error of a quadrature rule
440
5.2
Truncation error in the trapezoidal rule
442
5.3
Truncation error in Simpson’s one-third rule
455
5.4
Truncation error in Simpson’s three-eighth rule
466
5.5
Truncation error in Boole’s rule
471
5.6
Truncation error in Weddle’s quadrature rule
480
Summary
488
Key words
488
6
REFERENCES 1. Atkinson Kendall E An Introduction to Numerical Analysis John Wiley & Sons, 1978 2. Chapra Steven C and Canale Raymond P Numerical Methods for Engineers Tata McGraw Hill Education Private Limited, Fifth Edition, 2006 3. Jain M K, Iyengar S R K and Jain R K Numerical Methods for Scientific and Engineering Computation New Age International Publishers, Fifth Edition, 2007 4. Kreyszig Erwin Advanced Engineering Mathematics John Wiley and Sons, Eighth Edition, 2001 5. Mathews John H Numerical Methods for Mathematics, Science and Engineering Prentice Hall of India, Second Edition, 2005 6. Sankara Rao K Numerical Methods for Scientists and Engineers PHI Learning Private Limited, Third Edition 2009 7. Sastry S S Introductory Methods of Numerical Analysis Prentice Hall of India Private Limited, Fourth Edition, 2006 8. Scheid Francis Numerical Analysis Schaum’s Outline Series, McGraw Hill Book Co, Singapore, 1988
1
UNIT 01-01: MATHEMATICAL PRELIMINARIES
1-28
LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain a review of some basic concepts of mathematics which will be used in the text.
INTRODUCTION Every discipline of knowledge in the physical world does recognize the deterministic and predictive power of mathematics. Consequently attempts are made to build up one-one correspondence between physical world problems and mathematical models. In general the models are in the form of equations of various types
such as algebraic, transcendental,
differential and so on. The solutions of these models, using analytical methods, in exact forms are useful. However, the analytical methods can be applied to only limited class of problems. Thus analytical methods are of limited practical values. However, we should not be nervous. There are numerical methods to give approximate solutions to many of the problems which otherwise cannot be attended by exact methods. This leads to the discipline of mathematics called numerical analysis. The beauty of numerical methods lies in solving mathematical problems with elementary arithmetic operations such as addition, subtraction, multiplication and division. No longer any sophisticated technique is required – just the use of arithmetic operations used in our primary school days. But in all these approximation methods, one has to do large number of tedious calculations. However, with the development of modern fast computers one can get rid of such tedious computations manually. The numerical methods borrow some concepts and tools from other branches of mathematics such as real number system, theory of equations and calculus. Thus to make the text self explanatory, these concepts are reviewed.
1.1 Real number system R One cannot think of the development of mathematics without the basic concept of real numbers. As a matter of fact the day a kid enters the school of learning he comes across with simple numbers 1, 2, 3,L. As the learning continues he knows more and more about numbers. We now
summarize the types of numbers which form the building block of real number system.
Natural numbers Natural numbers are 1,2,3,… and are also called positive integers. The set of all natural numbers is denoted by N. 1
Integers The set of integers is Z = {0, ± 1, ± 2,L}.
Rational number A real number r expressible in the form
a , b ≠ 0 and a, b ∈ Z is called a rational number. For b
example, 1 3 2, , − 7 2 are rational numbers. If a and b are rational numbers, then
a+b is also a rational number. Let a < b. This implies that 2 a
5 ⇒ xround = ± 0. 3 1 0 9 9 (iii) Rounding up to 6 significant digits. Here n = 6, d n = d 6 = 7 = odd, d n +1 = d 7 = 5 ⇒ xround = ± 0. 3 1 0 9 8 8 (iv) Rounding up to 8 significant digits. Here n = 8, d n = d8 = 4 = even, d n +1 = d 9 = 5 ⇒ xround = ± 0. 3 1 0 9 8 7 5 4
Chopping off numbers When in the representation (1.5), the digits after d n are ignored, then we say that the number x is chopped off (or truncated to) n significant digits and write it as x = ± 0. d1 d 2 d 3 L d n × 10 m where
(1.6)
1 ≤ d1 ≤ 9 and 0 ≤ d i ≤ 9 for 2 ≤ i ≤ n.
Illustration. Consider y = 0 . 31 2 6 7 0 9 ×103.
(i) Up to four digits: ychop = 0.3126 ×103 and
yround = 0.3127 ×103
(ii) Up to six digits: ychop = 0.3126 70 ×103 = 0.3126 7 ×103 7
and
yround = 0.312671×103.
SAQ 1.2 Express the following numbers into the normalized decimal forms: 567.00345, 0. 00009256, 21. 010101.
SAQ 1.3 Give the rounding off and chopping off representation of the following numbers to four decimal digits: 0. 1 4 3 6 7 5 9, 98. 0 3 9 5 7, 3. 9 5 8 2 3 5.
Remark. To make the rounding of the number simple, hereafter we follow (1.5b) for d n +1 ≥ 5.
1.2 Algebraic and transcendental equations f (x) = 0 Algebraic equation f (x) = 0 Consider an expression of the form f ( x) = an x n + an −1 x n −1 + L + a1 x + a0 , an ≠ 0 where all ai ∈ R and n is a positive integer. We say that f (x) is a polynomial in x of degree n. Then f ( x) = 0 defines an algebraic equation. Accordingly, an equation f ( x) = 0 is an algebraic equation, if f (x) is a polynomial.
Illustration The equations x + 5 = 0, 3 x 2 − 7 x + 2 = 0, x 5 + 2 x 4 − x 3 + 5 x − 8 = 0 are algebraic equations. But the equations x + ln x + 2 = 0 and sin x − e x = 0 are not algebraic equations.
Transcendental equation f (x) = 0 We say that function f (x) is transcendental ⇔ f (x) is non-algebraic. Examples of transcendental functions are the functions containing trigonometric, exponential or logarithmic functions. Thus we define that f ( x) = 0 is a transcendental equation if f (x) is a transcendental function.
8
Illustration The equations e tan x + x 2 = 0, 3 x 4 + e 2 x + sin x = 0, 7 x + ln x − 9 = 0 are the transcendental equations.
Root of an equation We say that x0 is a root or solution of f ( x) = 0 ⇔ f ( x0 ) = 0
Remark. The root x0 is also called the zero of f (x). Hereafter we mention some of the important results in the form of theorems without proof. These theorems are of help in our study carried out in the subsequent units. The number of roots of an algebraic equation is specified by a theorem termed fundamental theorem of algebra as follows:
Theorem 1.1 (Fundamental theorem of algebra) Every algebraic equation of the n th degree has n and only n roots.
Illustration (i) The equation x 2 − 5 x + 6 = 0 is of degree 2 and has two roots 2 and 3. (ii) The equation x 4 − 1 = 0 is of degree 4 and it has four roots x = 1, − 1, i, − i. Two are real and two are imaginary.
Theorem 1.2 (Intermediate value property) Let f (x) be continuous on the finite interval [a, b]. If f (a ) and f (b) have opposite signs, then there exists at least one root of f ( x) = 0 in (a, b). f ( a ) > 0, f (b) < 0
y
f (a )
y = f (x)
a
c
f ( a) < 0, f (b) > 0
y
f (b)
y = f (x)
Fig 1.1 b f (b)
x
a
c
b
x
f (a ) 9
Illustration Consider the equation f ( x) = x 2 − x − 2 = 0. It has two roots − 1, 2. The function f (x) being a polynomial, it is continuous for all real values of x. Let [−2, 1] and [0, 3] be two intervals and f (x) is continuous on them. f ( −2) = 4 + 2 − 2 > 0 and f (1) = 1 − 1 − 2 < 0.
Now
Then by Theorem 1.2, there must a root of f ( x) = 0 between − 2 and 1. This is true for the root x = −1 : − 2 < −1 < 1. Similarly
f (0) = −2 < 0 and f (3) = 9 − 3 − 2 > 0.
The root 2 lies between 0 and 3 : 0 < 2 < 3.
Descartes’ rule of signs The nature of an equation is best understood from its roots. Therefore, finding the solution of an equation is important. However, solving any given equation is not an easy task and the problem of solving an equation becomes a problem itself. In such a situation the better way is to draw the qualitative information about the roots by the help of some existing rule or principle. Fortunately, there is a rule due to the noted French mathematician Rene Descartes and it is known as Descartes’ rule of signs. This helps us, by mere inspection of a given equation, to get the estimation of the number of positive, negative and imaginary roots.
Theorem 1.3 The negative roots of f ( x) are the positive roots of f (− x) .
Illustration. x = −1 is the negative root of f ( x) = x 2 − x − 2 = 0. By Theorem 1.3, − x = 1 is the root of f ( − x ) = ( − x ) 2 − ( − x ) − 2 = x 2 + x − 2 = 0. It is true since the roots of x 2 + x − 2 = 0 are 1, − 2.
Theorem 1.4 (Descartes’ rule of sign) An equation f ( x) = 0 cannot have more positive roots than there are changes of sign in f ( x) and cannot have more negative roots than there are changes of sign in f (− x).
Change of sign. Consider the polynomials and the pattern of the signs of the terms: (i) x 2 + x + 1 : + + + 10
(ii) 2 x 3 − 4 x 2 − 5 x + 3 : + − − + (iii) x 4 − x 3 + 2 x 2 + x − 4 : + − + + − We find the number of changes of sign from + to – and from – to + . In (i) it is 0, in (ii) it is 2 and in (iii) it is 3. Working of the rule. Consider the equations (a1) f ( x) = x 2 − 3x + 2 = 0 (a2) f ( x) = x 2 + x − 2 (a1) f ( x) : sign pattern : + – + : changes of sign 2 f (− x) = x 2 + 3x + 2 : + + + : change of sign 0.
Rule ⇒
Number of positive roots ≤ 2 or the positive roots are at most 2.
⇒ Number of negative roots ≤ 0 or there is no negative root. We know that the equation has two positive roots 1 and 2. (a2)
f (x) : sign pattern : + + – : changes of sign 1 f (− x) = x 2 − x − 2 : + − − : changes of sign 1.
Rule
⇒ Number of positive roots ≤ 1 and Number of negative roots ≤ 1.
The equation has one positive root 1 and one negative root –2.
1.3 Some theorems from calculus Theorem 1.5 (Rolle’s theorem) Let f (x) be a function such that
(a) f (x) be continuous in [a, b] (b) f (x) be differentiable in (a, b) (c) f (a) = f (b) = 0. Then there exists at least one value x = c in (a, b) such that f ′(c) = 0. Illustration. Let f ( x) = x 2 + x − 6 in [−3 , 2]
Here f (x) is a polynomial in x and hence is continuous and differentiable in [−3 , 2]. Also 11
f ( −3) = (−3) 2 − 3 − 6 = 0 and
f ( 2) = 2 2 + 2 − 6 = 0 i.e. f (−3) = f (2)
Thus all the conditions of Rolle’s theorem are satisfied. Then there is at least one c ∈ (−3 , 2) such that f ′(c) = 0. Now f ′( x) = 2 x + 1 . Then f ′(c) = 0 ⇒ 2c + 1 = 0 i.e. c = −
1 1 and − ∈ [ −3 , 2]. 2 2
Theorem 1.6 (Intermediate value theorem)
Let f ( x) be continuous in [a, b] and let k be any number between f (a) and f (b). Then there
exists a number c in (a, b) such that f (c) = k . The theorem is useful in locating the roots of equations. Illustration. Let f ( x) = x − cos x. The function f ( x) is continuous in [0,1]. Also
f (0) = −1 < 0 f (1) = 1 − cos1 > 0
and
Then by the intermediate value theorem the equation f ( x) = 0 has a root in the interval (0,1). Theorem 1.7 (Lagrange’s mean value theorem)
If a real function f ( x) defined on [a, b] is (i) continuous in [a, b]
and
(ii) differentiable in (a, b),
then there exists at least one point x = c in (a, b) such that f ′(c) =
f (b) − f (a ) or f (b) − f (a ) = (b − a ) f ′(c). b−a
(1.7)
Illustration. Let f ( x) = 2 x 2 − 7 x + 10 in [2 , 5].
Here f (x) being a polynomial in x, it is continuous and differentiable in [2 , 5]. Then by Lagrange’s mean value theorem, there is c ∈ (2 , 5) such that f ′(c) =
12
f (5) − f (2) 5−2
⇒
1 4c − 7 = [ f (5) − f (2)] , Q f ′( x) = 4 x − 7 3
⇒
1 4c − 7 = [ {2(5 2 ) − 7(5) + 10} − {2(2 2 ) − 7( 2) + 10}] 3
⇒
4c = 14 i.e. c = 3.5 ∈ ( 2 , 5) .
Theorem 1.8 (Taylor’s theorem for a function of one variable with remainder)
If f ( x) is continuous and possesses continuous derivatives of order n in some interval I that contains x = a, then Taylor’s expansion of the function f ( x) about the point x = a is given by
f ( x) = f (a) +
( x − a) ( x − a)2 ( x − a ) n −1 ( n −1) f ′(a) + f ′′(a ) + L + f (a ) + Rn ( x) 1! 2! (n − 1) !
(1.8a)
where Rn (x), the remainder, has the form Rn ( x) =
( x − a) n ( n) f (c), a < c < x. n!
(1.8b)
Remark. The remainder terms Rn (x) is also called the error term of the expansion. Taylor’s series for a function of one variable
If the remainder Rn ( x) → 0 as n → ∞, then (1.8) becomes f ( x) = f (a) +
( x − a) ( x − a) n −1 ( n −1) ( x − a) n ( n) f ′(a) + L + f (a) + f (a) + L 1! (n − 1) ! n!
(1.9)
This is called the Taylor’s series for f (x) about the point x = a. Maclaurin’s series
Taking a = 0 in (1.8), we get a series which is called the Maclaurin’s series: f ( x ) = f ( 0) +
x x2 x n−1 x n (n) f ′(0) + f ′′(0) + L + f ( n−1) (0) + f (0) + L n! 1! 2! (n − 1) !
(1.10)
Taylor’s series for a function of two variables
∂f ∂f 1 ∂ 2 f ∂2 f ∂2 f f ( x + h, y + k ) = f ( x, y ) + h + k + h 2 2 + 2hk + k2 2 ∂y 2! ∂x ∂x∂y ∂y ∂x
+L
(1.11a)
or writing h = δx, k = δy, above takes the form
13
f ( x + δx, y + δy ) ∂f ∂f 1 ∂2 f ∂2 f ∂2 f = f ( x, y ) + δx + δy + (δx) 2 2 + 2(δx)(δy ) + (δy ) 2 2 ∂y 2! ∂x∂y ∂x ∂y ∂x
+L
(1.11b)
The result (1.10) can be generalized to a function f ( x1 , x2 ,L, xn ) of several variables.
1.4 Maxima and minima of a function f(x) It is presumed that the readers are not totally new to the concepts of maxima and minima of a function f ( x) of a single variable. However, these ideas are recapitulated in order to demonstrate its use in numerical analysis. Consider a real valued function f ( x) defined in some interval [a, b] ⊂ R and c ∈ (a, b). Let f ( x) be differentiable up to order two. A function f (x) has a maxima at x = c means a function has a maximum value at x = c. Similarly f ( x) has a minima at x = c means a function has a minimum value at x = c. We say that f ( x) has a local maximum at x = c if f ( x) ≤ f (c) ∀ x ∈ N δ (c) f ( x) has a local minimum at x = c if f (c) ≥ f (a) ∀ x ∈ N δ (c) f ( x) has the absolute maximum at x = c if f ( x) ≤ f (c) ∀ x ∈ [ a, b] f ( x) has the absolute minimum at x = c if f ( x) ≥ f (c) ∀ x ∈ [a, b].
Here N δ (c) stands for some δ - neighborhood of c i.e. N δ (c) = (c − δ , c + δ) for some δ > 0. Let the graph of f ( x) in [a, b] be as shown in Fig 1.2, where f has y
H
D
B
A
F
Q
E
C
Fig 1.2
P
O
x
y = f ( x) G
absolute maxima at F absolute minima at G local maxima at B , D , H local minima at A , C , E , Q neither maxima nor minima at P. 14
Hereafter maxima means local maxima unless specified otherwise. The same is true for minima. From the graph, it is seen that at maxima or minima the tangent to the curve is parallel to the x axis i.e. dy = f ′( x) = 0. dx
If the graph of a function f ( x) is not available, then how are we going to judge the maxima or minima? This is considered in the necessary and sufficient conditions as follows: f ( x) has local maxima at x = c ⇔ f ′(c) = 0 and f ′′(c) < 0 f ( x) has local minima at x = c ⇔ f ′(c) = 0 and f ′′(c) > 0 f ( x) is neither maxima nor minima at x = c if f ′(c) = 0 and f ′′(c) = 0. Remark. At a local maxima or a local minima, the direction of a tangent (i.e. the sign of
f ′( x)) changes. On this basis a local maxima and a local minima can be found out as follows:
(i) f ′( x) changes from positive to negative at x = c ⇒ local maxima at x = c. The tangents to the curve at B, D and H changes direction from positive to negative and hence f ( x) has local maxima at these points.
(ii) f ′( x) changes from negative to positive at x = c ⇒ local minima at x = c. The tangents to the curve at C and E changes direction from negative to positive and hence these are the points of local minima. Extreme value of f(x) at x = c
If a function f ( x) has either local maxima or local minina at x = c, then f (c) is called an extreme value of f ( x) at x = c. Then we say that f ( x) has an extremum at x = c. Result 1
If f ( x) is defined and differentiable on [a, b] such that f ′( x) ≠ 0 for a < x < b, then the absolute maxima and absolute minima of f exist only at x = a and x = b.
1.5 Error analysis Numerical calculations do not lead to exact or true solutions. The effectiveness of numerical methods can be increased by decreasing the errors in the computations. It is therefore, necessary to look into the role of errors in numerical methods. 15
There are various causes for generating errors in solving problems. We list some of them. (i) Inaccurate mathematical modeling If a physical problem is represented by a faulty or inaccurate mathematical modeling, the subsequent computations based on the modeling are bound to create errors. (ii) Uncertainty in physical data To draw an accurate inference, certainty in physical data of a problem is necessary. If the data itself is uncertain, its reliability is questionable. Naturally the calculations based on the data are going to generate errors. (iii) Rounding of numbers The numerical methods are carried out in number of steps or iterations. If each step allows rounding of numbers, the cumulative effect of the method will result into sufficiently large error. (iv) Approximate methods in numerical analysis (truncation error) The methods of numerical analysis are not exact. They are approximate. Thus rounding of exactness is inherent in the methods. The credit of this aspect of errors goes to numerical analysis itself.
Definition. Let xa be an approximation to x. We define error Ea ( x) = x − xa relative error Er ( x) = and
(1.12a) x − xa , x≠0 x
percentage error E p ( x) =
x − xa ×100, x ≠ 0 x
(1.12b)
(1.12c)
Remark (i) These errors can be positive or negative. (ii) The error | Ea ( x) | is called an absolute error. (iii) We also denote Ea ( x) = x − xa = δx (iv) The relative error Er (x) is a better indicator of the accuracy of the approximation than the error Ea (x).
16
Problem 1.3 Compute the errors in the following cases and identify the bad approximations: (i) x = 0.000032, xa = 0.000021 (ii) y = 100000, ya = 99998 and
(iii) z = 2.71828, z a = 2.718
Solution. (i) Here we have Ea ( x) = x − xa = 0.000011 Er ( x ) =
0.000032 − 0.000021 = 0.34375 0.000032
E p ( x) = Er ( p ) × 100 = 34.375
and (ii) In this case, we write
Ea ( y ) = y − ya = 2, Er ( y ) = (iii)
Ea ( z ) = 0.00028, Er ( z ) =
2 = 0.00002, E p ( y ) = Er ( y ) × 100 = 0.002 100000
0.00028 = 0.000103, E p ( z ) = Er ( z ) ×100 = 0.0103 2.71828
From the above three cases, in (i) xa is the bad approximation to x. The best approximation is in case (ii) i.e. ya is the best approximation to y. Now we state two theorems which specify the errors related to truncation and rounding off values of a number. The proofs are beyond the scope of the syllabus.
Theorem 1.9 Let x = 0.d1 d 2 L d m L × 10 n be any real number and let xa be an approximate to x after truncation to m digits, then (a) | Ea ( x) | = | x − xa | < 10 n − m and
(b) | Er ( x) | = |
x − xa | < 101− m. x
(1.13a) (1.13b)
Theorem 1.10 Let x = 0.d1 d 2 L d m L × 10 n be any real number and let xa be an approximate to x after rounding off to m digits, then 17
1 × 10 n − m 2
(1.14a)
1 x − xa | < × 101− m. 2 x
(1.14b)
(a) | Ea ( x) | = | x − xa | < and
(b) | Er ( x) | = |
Problem 1.4 Let x = 0.00036923. Verify Theorem 1.10 if x is truncated to two decimal digits.
Solution. We rewrite x in the normalized form: x = 0.00036923 = 0.36923 ×10 −3 Let xa approximate x when it is truncated to two decimal places. ⇒
xa = 0.36 × 10 −3
In this case we have m = 2, n = −3. Now
Ea ( x) = x − xa = 0.36923 × 10 −3 − 0.36 × 10 −3 = 0.00923 × 10 −3 = 0.923 × 10 −3 − 2
⇒
| Ea ( x) | < 1× 10 −3 − 2 = 10 n − m
Hence (1.13a) is verified.
Ea 0.923 × 10 −5 = = 2.49979687 × 10 −2 = 0.24979787 × 10 −1 −3 x 0.36923 × 10
Also
Er =
⇒
| Er ( x) | < 10 −1 = 101− 2 (= 101− m ) etc
This verifies (1.13b) and consequently Theorem 1.9 is verified.
Problem 1.5 Let x = 0.00036923. Find the percentage error if x is rounded off to two decimal digits.
Solution. We have x = 0.36923× 10 −3 and
xa = value of x rounded off to two decimal digits = 0.37 × 10 −3
⇒
| E p ( x) | =
x − xa 0.36923 − 0.37 × 100 = × 10 − 3 + 2 = 0.00208542 × 10 −1 x 0.36923
= 0.208542 × 10 −3
18
MCQ 1.3 Let 2.3 be the measured value of x. If the absolute error occurred in the measurement is less that 0.01, then (A) x ∈ (a, b) such that b − a < 0.01 (B) x ∈ (a, b) such that b − a > 0.01 (C) x ∈ (a, b) such that b − a = 0.01 (D) x ∈ (a, b) such that b − a < 0.02 Hint. | x − xa | < k ⇔ xa − k < x < xa + k , here k = 0.01
SAQ 1.4 Verify Theorem 1.10 for x = 0.00036923 if x is rounded off to two decimal digits.
SAQ 1.5 Given the measurement xa = 23.75 with relative error in the measurement at most 1%. Find the interval within which the true value x of the measurement lies. Limit to three decimal places. Hint. | Er ( x) | < 0.01 i.e. − 0.01 < Er ( x) < 0.01. Find a, b such that x ∈ (a, b).
Problem 1.6 The approximate values of the number
1 are given by 7
x1 = 0.12, x2 = 0.13, x3 = 0.14 and x4 = 0.15. Identify the best approximation.
Solution. We compute | E ( x) | in each case. The least value is the best approximation. We have | E ( x1 ) | =
1 1 1 12 100 − 84 16 − x1 = − 0.12 = − = = 7 7 7 100 700 700
| E ( x2 ) | =
1 1 1 13 100 − 91 9 − x2 = − 0.13 = − = = 7 7 7 100 700 700
| E ( x3 ) | =
1 1 1 14 100 − 98 2 − x3 = − 0.14 = − = = 7 7 7 100 700 700
| E ( x4 ) | =
1 1 1 15 100 − 105 5 − x4 = − 0.15 = − = = 7 7 7 100 700 700 19
The least amongst these values is
2 1 and hence x3 = 0.14 is the least approximation to . 700 7
Error propagation We now study the propagation of errors in addition, subtraction, product and division operations.
Theorem 1.11 (Error propagation in addition and subtraction operations)
and
| Ea ( x + y ) | ≤ | Ea ( x ) | + | Ea ( y ) |
(1.15a)
| Ea ( x − y ) | ≤ | E a ( x ) | + | Ea ( y ) |
(1.15b)
Ea ( x) = x − xa , Ea ( y ) = y − ya
(1.16)
Proof. By definition, we have
where the symbols have their usual meaning. E a ( x + y ) = ( x + y ) − ( xa + y a )
Also ⇒
| E a ( x + y ) | = | ( x + y ) − ( xa + y a ) |
⇒
| E a ( x + y ) | = | ( x − xa ) + ( y − y a ) |
⇒
| Ea ( x + y ) | ≤ | ( x − xa ) | + | ( y − ya ) |, Q | a + b | ≤ | a | + | b | ≤ | Ea ( x) | + | Ea ( y ) |, by (1.12)
This gives (1.15a). Similarly noting | a − b | ≤ | a | + | b |, the remaining part can be proved.
QED
Theorem 1.12 (Error propagation in product) | Er ( xy ) | ≤ | Er ( x) | + | Er ( y ) |
(1.17)
for all nonzero x, y ∈ R.
Proof. By definition, we have
Er ( x ) = ⇒
x − xa y − ya xy − xa ya , Er ( y ) = and Er ( xy ) = x y xy
xy − xa ya = [ x Er ( x) + xa ][ y Er ( y ) + ya ] − xa ya = xy Er ( x) Er ( y ) + x ya Er ( x) + xa y Er ( y )
20
(1.18)
xy − xa ya y x = E r ( x ) Er ( y ) + a Er ( x ) + a Er ( y ) xy y x
⇒
Substituting the values of
x ya and a from (1.14), we get x y
xy − xa ya = Er ( x) Er ( y ) + [1 − Er ( y )]Er ( x) + [1 − Er ( x)] Er ( y ) xy
⇒
Er ( xy ) = Er ( x) + Er ( y ) − Er ( x) Er ( y ), by (1.18)
⇒
| Er ( xy ) | ≤ | Er ( x) | + | Er ( y ) | + | Er ( x) Er ( y ) |
Since the errors Er (x) and Er ( y ) are small, their product is negligible. Then above gives | Er ( xy ) | ≤ | Er ( x) | + | Er ( y ) |
QED
Remark. The result in (1.17) can be equivalently expressed as
Er ( xy ) ~ Er ( x) + Er ( y ). MCQ 1.4
Choose the true statement from the following: x E ( x) (A) Er = r y Er ( y ) x E ( x ) − Er ( y ) (B) Er = r 1 − Er ( y ) y x E ( x ) + Er ( y ) (C) Er = r 1 + Er ( y ) y x E ( x ) − Er ( y ) (D) Er = r 1 + Er ( y ) y Remark. The true statement gives the error propagation in division operation. MCQ 1.5
Choose the true statement from the following: (A)
x − xa ~
E ( x) x
21
(B)
x − xa ~
E ( x) 2 x
(C)
x − xa ~
2 E ( x) x
(D) None of the above SAQ 1.6
Show that ln x − ln xa ~
E ( x) . x
SAQ 1.7
Find to how many digits is the value
355 , an accurate approximation to π = 3.14159265L. 113
General rule for error Let f ( x1 , x2 ,L, xn ) be a function of several variables x1 ,L, xn . We give a rule to find the error E ( f ) = δf due to the errors δxi in xi , i = 1,L, n. We have f = f ( x1 , x2 ,L, xn ) The error δf in f is then given by δf = f ( x1 + δx1 , x2 + δx2 ,L, xn + δxn ) − f ( x1 , x2 ,L, xn ) Writing the Taylor’s series expansion of the first term on the right, we get ∂f ∂f 1 + ( terms containing (δx1 ) 2 , L , (δxn ) 2 ) + L + δxn δf = f ( x1 , L , xn ) + δx1 ∂ ∂ x x 2! 1 n + ( terms containing higher powers of (δxi ) ) − f ( x1 ,L, xn ) We suppose that the errors δxi are small enough to neglect their squares and higher powers. Then above becomes ∂f ∂f + L + δxn ∂x1 ∂xn
(1.19)
δf δx1 ∂f δx2 ∂f δx ∂f = + +L+ n f f ∂x1 f ∂x2 f ∂xn
(1.20)
δf = δx1
⇒
Er ( f ) =
This is the rule for computing the relative error in the function f ( x1 ,L, xn ) of several variables.
22
Problem 1.7
Find the absolute and relative errors in f ( x, y, z ) = x 2 yz at the point (1,1,1). Given that the errors in x, y and z are 0.01, 0.02 and 0.03 respectively. Solution. Using (1.19), the error in f is given by
δf = δx
∂f ∂f ∂f + δy + δz ∂x ∂y ∂z
where δx, δy and δz are the errors in x, y and z respectively. ⇒
δf = δx (2 xyz ) + δy ( x 2 z ) + δz ( x 2 y ), Q f = x 2 yz
For x = y = z = 1 and δx = 0.01, δy = 0.02, δz = 0.03, we have δf = (0.01)2 + (0.02)1 + (0.03)1 = 0.07
E ( f ) = δf = 0.07
i.e. ⇒
Er ( f ) =
δf 0.07 = = 0.07, Q f = 1 at x = y = z = 1 f 1
E p ( f ) = 100 Er ( f ) = 7.
and Problem 1.8
The percentage error in the measurement of the area of a circle is 0.2. Find the percentage error in the measurement of the radius. Solution. The area A of a circle of radius r is given by
A = πr2 E ( A) = δA = 2πr δr
⇒ ⇒
⇒ ⇒ ⇒
E p ( A) = 0.2 = 2
δA 2πr δr × 100 = × 100 A A
δr × 100, Q E p ( A) = 0.2 and A = πr 2 r 0.2 = 2 E p (r )
E p (r ) =
0.2 = 0 .1 2
23
MCQ 1.6
The relative error in the measurement of volume of a sphere is 0.01. Then the percentage error in the measurement of radius is (A) 0.33 (B) 0.32 (C) 0.31 (D) 0.30 Problem 1.9
Deduce the Taylor’s expansion of the function f ( x) = sin x about the point x = π / 4. Show that the error terms tends to zero as n → 0. Then write the Taylor’s series for sin x. Solution. The Taylor’s expansion of the function f ( x) about the point x = a is given by (1.8). In
the present case it becomes 1 π π π π f ( x) = f + x − f ′ + L + x− 4 4 4 ( 1 ) ! 4 n −
n −1
π f ( n −1) + Rn ( x) 4
(a1)
n
Rn ( x) =
where
π 1 π (n) x − f (c), < c < x 4 4 n!
(a2)
In (a1) the error term is Rn ( x). We show that it tends to zero as n → ∞. We have f ( x) = sin x. Then f ′( x) = cos x, f ′′( x) = − sin x, f ′′′( x) = − cos x, f (iv ) ( x) = sin x
i.e. Then
f ( 2 n ) ( x) = ( −1) n sin x and f ( 2 n +1) ( x) = ( −1) n cos x
| R2 n ( x) | =
1 π x− ( 2n) ! 4
2n
f ( 2 n ) (c )
2n
=
1 π n x − (−1) sin c ( 2n) ! 4 2n
1 π ≤ x − , Q | sin c | ≤ 1 ( 2n ) ! 4
⇒ 24
R2 n ( x) → 0 as n → ∞
(a3)
Similarly we can show that R2 n +1 ( x) → 0 as n → ∞
⇒
Rn ( x) → 0 as n → ∞
This completes the first part. For the remaining part, noting above (a1) becomes 1 π π π π f ( x) = f + x − f ′ + L + x− 4 4 (n − 1) ! 4 4
⇒
n −1
f
n
π (n) π π 1 + x − f +L 4 4 4 n!
( n −1)
2 3 4 1 1 1 π π π π 1 sin x = 1 + x − − x − − x − + x − + L, by (a3) 4 2! 4 3! 4 4! 4 2
Problem 1.10
Find the number n of terms about the point x = 0 for the function f ( x) = e x such that | Rn ( x) | ≤ 0.005, when x ∈ [−1, 1]. Solution. The Taylor’s expansion for f ( x) = e x about the point x = 0 is f ( x) = e x = f (0) + ( x − 0) f ′(0) + L +
i.e.
where
i.e.
ex = 1+ x + L +
1 ( x − 0) n −1 f ( n −1) (0) + Rn ( x) (n − 1) !
(a1)
1 x n −1 + Rn ( x), Q f ′(0) = f ′′(0) = L = 1 ( n − 1) ! Rn ( x) =
x n (n) f (c), 0 < c < x n!
Rn ( x) =
xn c e n!
In the interval [−1, 1], the maximum error is given by xn c e , x ∈ [−1, 1] n!
| Rn ( x) | =
≤ max
−1≤ x ≤1
≤
xn × max | e x | n ! −1≤ x ≤1
e n!
Noting | Rn ( x) | ≤ 0.005, we find n such that 25
e ≤ 0.005 n!
⇒
n! ≥
e = 200e 0.005 n ≥6
⇒
Therefore, we need at least 6 terms in the expansion (a1) for the given accuracy. Problem 1.11
Find the fourth degree Taylor’s expansion for f ( x) = e x about the point x = 0 and then determine the maximum error when − 1 ≤ x ≤ 1. Solution. Following the previous problem, the fourth degree Taylor’s expansion for f ( x) = e x is f ( x) = e x = 1 + x +
R5 ( x) =
where
x 2 x3 x 4 + + + R5 ( x) 2! 3! 4!
x 5 ( 5) f (c), 0 < c < x 5!
The error in the above expansion is R5 ( x). We compute the maximum error: | R5 ( x) | =
For − 1 ≤ x ≤ 1,
| R5 ( x) | ≤
Thus the maximum error is
1 5 ( 5) 1 | x f (c ) | = | x 5e c | 5! 120
1 1 e [ max x 5 ][ max e x ] = ×1× e = −1≤ x ≤1 120 −1≤ x ≤1 120 120
e . 120
MCQ 1.7
Consider the statements: (a) Rn ( x) → 0 as n → ∞ for the Taylor’s expansion of f ( x) = sin 3 x about x = 0. (b) Rn (x) does not tend to zero as n → ∞ for the Taylor’s expansion of f ( x) = 2 x for x = 1. Select the true statement from the following: (A) Both the statements are true. (B) Both the statements are false.
26
(C) Only (a) is true. (D) Only (b) is true. MCQ 1.8
tan −1 x = x −
Let
x3 x5 x 2 n −1 + − L + (−1) n −1 +L 3 5 2n − 1
The series determines tan −1 1 correct to eight significant digits. Then (A) n = 108 − 1 (B) n = 108 + 1 (C) n = 108 − 2 (D) n = 108 + 2 SAQ 1.8
Let n be the number of terms in the Maclaurin expansion for e x at x = 1 such that their sum gives the value of e x correct to 8 decimal places. Show that n ! > 2 × 108. SAQ 1.9
If V =
xy 2 and the errors in x, y, z are 0.001 for each x, y, z at the point (1,1,1), then show that z3
the maximum possible percentage error in V is 6. SAQ 1.10
Show that the number of terms required for the series of ln(1 + x) to compute ln 1.2 correct to six decimal places if 10.
27
SUMMARY The mathematical preliminaries including the concepts of scientific notations, truncating and rounding off numbers are explained. The error analysis is elaborately discussed with illustrations. The mean value theorems due to Rolle, Lagrange and Taylor are stated and thereupon the Taylor’s expansion is used in relation to the error management.
KEY WORDS Scientific notation Rounding of numbers Truncating of numbers Error Rolle’s theorem Lagrange’s mean value theorem Taylor’s expansion
28
UNIT 01-02: GRAPHICAL SOLUTION OF EQUATIONS
29-38
LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain the basic concepts of graphical solution of algebraic and transcendental equations Apply the method to solve the equations
INTRODUCTION All the mathematical equations necessarily not be able to predict exact solutions. In order to overcome the difficulty to get an exact solution, we take help of approximate methods. In technical terms these are called the numerical methods. These methods are varied in nature. They include geometric and algebraic methods. Though there are various problems where numerical methods are attracted, we confine to the solution of algebraic and transcendental equations in these units. The present unit is devoted to graphical solution of an equation.
2.1 Graphical solution of equations Suppose we have to solve the f ( x) = 0
(2.1)
where f (x) is a continuous function of x defined on some interval. We know that x0 is a root or solution of (2.1) ⇔ f ( x0 ) = 0
In case f (x) is a polynomial in x, the solution of (2.1) is guaranteed and x0 will be a number real or complex. For arbitrary nature of f (x) , the existence of a solution is necessarily not implied. For example, the equations | x |2 +1 = 0 , sin x = 2.5
do not posses any solution in R.
Therefore, we make an assumption that the equation f ( x) = 0 possesses a solution. The equation can be algebraic or transcendental depending upon f (x ). There exist analytical methods to solve algebraic equations when the degree of the polynomial equation is 2 , 3 or 4. In general, these methods are not of use to solve polynomial equations of degree higher than four. Hence when one 29
gets struck to find the solution exactly, one has to take the help of numerical methods – the graphical is one of them. Geometrically or graphically
x0 is the root of f ( x) = 0 ⇔ curve y = f ( x) cuts the x − axis at the point whose abscissa is x0
f ( x) = 0
Fig 2.1
O
x0
x
In this method we make use of the following theorem from theory of equations :
Theorem 2.1 If (i) f (x) is continuous in the interval [a, b] (ii) f (a) and f (b) are of opposite signs,
then
the equation f ( x) = 0 has at least one real root between a and b.
Working method to solve f(x) = 0 (i) Search the neighboring real numbers a and b so that f (a) and f (b) have opposite signs. Then by Theorem 2.1, there exists
a real number x0 between a and b
satisfying the
equation f ( x) = 0. We find x0 in two ways as follows. (ii) Plot the curve y = f ( x). It must intersect the x -axis. Identify this point. Its abscissa is the required solution x0 . This is illustrated in Fig 2.1. If the curve does not intersect the x - axis, the
equation f ( x) = 0 has no solution. This is shown in Fig 2.2.
y = f ( x) Fig 2.2 O
x
f ( x) = 0 has no solution
(iii) In general, the direct plotting of the curve f ( x) = 0 becomes difficult. In this case rewrite the equation f ( x) = 0 in the form g ( x) = h( x). Now plot two curves: 30
y = g ( x) and y = h( x) They must intersect at least at one point between a and b. Identify this point. Its abscissa is the required root x0 .
y = g ( x) y
Fig 2.3
y = h( x )
O
x0
x
Remark. In general, in comparison to algebraic methods, a graphical method is not encouraging
from the point of view of accuracy. Its success depends upon the search of the neighbouring values of a and b. To make the method more effective here are some hints for its operation. Initially make rough estimate of a and b. Then get five/six points ( x , f ( x)) in a tabular form. From this find another two neighbouring values of x, where f ( x) changes its sign. This is our next approximation (or the next iteration ) of a and b. Plot the curve between these iterated values. This enhances the better approximation. Problem 2.1
Solve the following equations graphically (a) x3 − x − 1 = 0 (b) 3 − x = e x−1 (c) sin x sinh x − 1 = 0 Hint. In the following graphs the values of f ( x) , g ( x) , h( x) are along the y -axis. We have
shown two types of curves: computer based and schematic in some cases. Solution. (a) Denote
Here
f ( x) = x 3 − x − 1 f (1) = 1 − 1 − 1 = negative and f (2) = 23 − 2 − 1 = positive
Hence one of the roots lies between 1 and 2. Compute the values ( x , f ( x) ): 31
x:
1
1 .2
1 .4
1 .6
1 .8
2
f ( x) : − 1 − 0.47 0.34 1.5 3.08 5
Noting the change in sign of f (x), the root lies between 1.2 and 1.4. Draw the graph of the curve between these points 1.2 and 1.4 from the following data: x:
1.2
1.24
1.28
1.32
1.36
1 .4
f ( x) : − 0.47 − 0.33 − 0.18 − 0.02 0.16 0.34 The curve is given in Fig 2.4. It intersects the x -axis at the point A whose abscissa is estimated as 1.33.
y = f (x)
0.4 0.2
A
A
0
Fig 2.4
-0.2
1.2
1.24
1.28
1.32
1.36
1.4
-0.4 -0.6
Another method. Rewrite the given equation in the form x3 = x + 1 Denote g ( x) = x 3 , h( x) = x + 1. Plot the curves I: y = g ( x), II : y = h( x) between the points x = 1.2 and x = 1.4 . The abscissa of their point of intersection A is the required root 1.33.
1.2 1.24 1.28 1.32 1.36 1.4 x: g ( x) : 1.73 1.91 2.10 2.30 2.52 2.74 h( x) : 2.2 2.24 2.28 2.32 2.36 2.4 Since y = h( x) is a straight line only two points are sufficient to plot it. For uniformity in the table we have shown six values.
32
3
I II
A
2.5 2
Fig 2.5
1.5 1 0.5 0 1.2
1.24
1.28
1.32
1.36
1.4
I II
A
x
O
x0
(b) Let f ( x) = 3 − x − e x −1. f (1) = 3 − 1 − 1 = + ve
Then
f ( 2) = 3 − 2 − e = − ve, Q e = 2.718
and ⇒
A root of f ( x) = 0 lies between 1 and 2
Write down the set of the points ( x , f ( x)) : x : 1 1 .2 1 .4 1.6 1 .8 2 f ( x) : 1 0.58 0.11 − 4.42 − 1.03 − 1.72 From the table itself one can guess that the root lies between x = 1.4 and x = 1.6. Now plot the graph of f ( x) = 0 between these values: x:
1.4
1.45
1.50
1.55
1.6
f ( x) : 0.19 − 0.02 − 0.15 − 0.28 − 0.42
The curve cuts the x -axis at the point A whose abscissa is approximated to 1.44 and then this the estimated value of the root.
33
0.2
Fig 2.6
0.1
A
A
0 -0.1 1.4
1.45
1.5
1.55
1.6
-0.2
y = f (x)
-0.3 -0.4 -0.5
Another method
Rewriting the given equation, g ( x ) = h( x ) where g ( x) = 3 − x and h( x) = e x −1. Plot the curves I : y = g ( x) and II : y = h( x) from the following table: x: 1 g ( x) : 2
1.2 1 .8
1.4 1.6
1.6 1.4
1 .8 1.2
2 1 .
h( x) : 1 1.22 1.50 1.82 2.23 2.72
The curves intersect each other at the point A. Its estimated abscissa 1.44 is the required value of the root.
3
II
2.5 2
A
1.5
Fig 2.7
1
I
0.5 0 1
1.2
1.4
1.6
1.8
2
II A
O 34
I
x x0
(c) Let f ( x) = sin x sinh x − 1 = 0. The values of x are in radians. Now f (0) = −1 = − ve and f (1.2) = 0.41 = + ve Hence the root lies between 0 and 1.2 radians. We have 0 0 .4 0.8 1.2 x: f ( x) : − 1.0 − 0.84 − 0.36 0.41 This shows that the root lies between 0.8 and 1.2. Plot the curve f ( x) = 0 between these two points. It intersects the x -axis at A whose abscissa is estimated as 1.01 and this is the required approximate value of the root: x: 0 .8 0.9 1.0 1.1 1.2 f ( x) : − 0.36 − 0.20 − 0.01 0.19 0.41
0.6 0.4 0.2
Fig 2.8
A
0 -0.2 0.8
0.9
1
1.1
1.2
-0.4 -0.6
Another method. Rewriting the given equation,
sinh x = cosec x or g ( x) = h( x), where g ( x) = sinh x and h( x) = sinh x = cosec x. Draw the curves I : y = g ( x) , II : y = h( x) between the points x = 0.8 and x = 1.2 : 0.8 0.9 1.0 1.1 1.2 x: g ( x) : 0.89 1.03 1.18 1.34 1.51 h( x) : 1.39 1.28 1.19 1.12 1.07 The abscissa of their point of intersection A approximates the root as 1.01.
35
2 1.5
I
A
II
1
Fig 2.9
0.5 0 0.8
0.9
1
1.1
1.2
MCQ 2.1
Consider the statements: (a) One root of the equation e − x − x = 0 lies in the interval (0,1). (b) One root of the equation x − cos x = 0 lies in the interval (0.7,1). Then
(A) Both the statements are true. (B) Both the statements are false. (C) Only (a) is true. (D) Only (b) is true.
MCQ 2.2
Let α and β be the approximate roots of the equations tan x − 1.2 x = 0 and x log10 x − 1.2 = 0 respectively. Then (A) α ≤ β (B) α, β ∈ (0, 3) (C) α − β ∈ (0, 3) (D) α + β ∈ (0, 3) SAQ 2.1
Solve the following equations graphically. (a) sin x = x − 1 (b) e − x − sin x = 0 (c) x 3 − 6 x 2 + 9 x − 3 = 0 36
SAQ 2.2
Find a positive root between 0 and 1 of the equation x e x = 1. SAQ 2.3
Use graphical method to find the approximate positive value of a root of the equation cos x − x 2 = 0.
37
SUMMARY
A graphical method to solve algebraic and transcendental equations is highlighted with solved examples.
KEY WORDS Polynomial Algebraic equation Transcendental equation Graphical method
38
UNIT 01-03: ITERATIVE METHOD
39-54
LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain an iterative method to solve the equation f ( x) = 0 Apply the method to find the root of the equation f ( x) = 0
INTRODUCTION In finding numerical solution of nonlinear equation f ( x) = 0, in general, we require a guess interval [a, b] in which the exact root xr of f ( x) = 0 lies. To locate this interval Theorem 1.2 is used. In this way we bracket the true root xr by the values a and b. Then a guess value x0 ,
known initial value is chosen. The improved values of the roots are obtained by the repeated applications and finally the closure estimate of the exact root is achieved. The method discussed in the previous unit belongs to this group. Such methods are convergent. On the other hand, these methods which require one single or two approximate values to the exact root. Usually the interval of concern is given. If not, one can use Theorem 1.2 can get it. These methods sometimes diverge from the exact root. But if the methods converge, then they are faster than the bracketing methods. These methods are cumbersome and also time consuming if the computations are worked out manually. However, for computer use the methods are best suited. In this unit, we discuss iterative method which belongs to the second category. The method is also known as method of direct iteration or fixed point iteration.
3.1 Working of the method to choose initial approximation The problem is to find a real root r of the equation f ( x) = 0
(3.1)
where f ( x) is a continuous function on some interval I . If I is not given, it is suggested to use Theorem 1.2 and find I . We rewrite (3.1) in the form x = g ( x)
(3.2)
| g ′( x) | ≤ k < 1, ∀ x ∈ I
(3.3)
where g ( x) is continuous on I and
39
The choice of the form (3.2) is crucial to the method because this form is not unique – one can express (3.1) in different equivalent forms (3.2). We choose that form which satisfies (3.3). This aspect is illustrated in due course of time. Then the x - coordinate of the point of intersection of the graphs of the equations y = x and y = g ( x)
give the root r of the equation f ( x) = 0. Let x0 be an approximate initial value of the exact root xr . Substituting it in the right side of (3.2), we get the first approximation x1 of r as follows: x1 = g ( x0 )
(3.4)
The successive approximations are expressed by the iterative formula xn +1 = g ( xn )
(3.5)
We are done if the sequence < xn > of approximations converge to r. This convergence does depend on the proper choice of g ( x). How to choose g(x)
Consider the equation f ( x) = x 3 + x − 1 = 0. We rewrite it in different forms (3.2): (a) x = 1 − x 3 = g ( x) (b) x( x 2 + 1) − 1 = 0 i.e. x =
1 = g ( x) x +1 2
(c) x 3 = 1 − x and then x = (1 − x)1 / 3 = g ( x) Thus for a single equation x 3 + x − 1 = 0, we obtained three different forms of g (x) : 1 − x3 ,
1 , (1 − x)1 / 3 x +1 2
For iterative method, we have to make choice to satisfy (3.3). To achieve this let us first find an interval I which contains xr . We have f (0) = −1 < 0 and f (1) = 1 > 0 Then by Theorem 1.2, the true root xr lies in I = [0,1]. Now
40
(a) g ′( x) = −3x ⇒ | g ′( x) | = 3x < k < 1, ∀ x ∈ I
This g (x) violates (3.3) and hence is not suitable for the iterative method. (b) g ′( x) = −
2x 2x 2 1 ⇒ max | g ′( x) | = max 2 = = ≤ k of approximations is guaranteed. This aspect is detailed in the following theorem.
Theorem 3.1 Let x = r be the true root of the equation f ( x) = 0 and r ∈ I . Let f ( x) = 0 be equivalent to x = g (x), where g (x) and g ′(x) are continuous on I such that | g ′( x) | ≤ k < 1, ∀ x ∈ I .
(3.3)
Then the sequence < xn > of approximations x0 , x1 ,L, xn ,L defined by (3.5) converges to r , provided that the initial approximation x0 ∈ I .
Proof. Since r is the true or exact root of the equation f ( x) = 0 i.e. x = g (x), we have r = g (r ) From (3.5), we write x1 = g ( x0 ) By subtraction, we get r − x1 = g (r ) − g ( x0 ) Using mean value theorem, we have g ( r ) − g ( x0 ) = (r − x0 ) g ′(r0 ), r0 ∈ ( x0 , r )
⇒
r − x1 = (r − x0 ) g ′(r0 ), r0 ∈ ( x0 , r ) 41
Continuing the above process, for approximations x1 , x2 ,L, we get r − x2 = (r − x1 ) g ′( r1 ), r1 ∈ ( x1 , r ) r − x3 = (r − x2 ) g ′(r2 ), r1 ∈ ( x2 , r ) M
r − xn +1 = (r − xn ) g ′(rn ), rn ∈ ( xn , r ) Multiplying the above equations, we obtain r − xn +1 = (r − x0 ) g ′(r0 ) g ′(r1 ) L g ′(rn ) | r − xn+1 | = | (r − x0 ) | | g ′(r0 ) | | g ′(r1 ) | L | g ′(rn ) |
⇒
Since all r0 , r1 ,L, rn ∈ I , by (3.3), we have | r − xn +1 | ≤ | r − x0 | k k L k = | r − r0 | k n +1 lim | r − xn +1 | ≤ | r − r0 | lim k n +1
⇒
n →∞
n→∞
≤ | r − r0 |× 0, Q k < 1 ⇒ k n +1 → 0 as n → ∞ ≤0 ⇒ ⇒
xn +1 → r The sequence of approximations x0 , x1 ,L converges to the exact root r of f ( x) = 0. QED
Remark. Geometrically g ′( x) = tan θ, where θ is an angle made by the tangent to the graph y = g (x) with the x - axis. y = g (x)
y
y
y = g (x)
Fig 3.1 θ
θ
x
(a)
x
(b)
Then | g ′( x) | < 1 ⇒ − 1 < g ′( x) < 1 i.e. − 1 < tan θ < 1. It means that tan θ can be negative i.e. θ is greater than 900 as shown in Fig 3.1(b). This leads to two cases of convergence and is demonstrated in the following geometrical interpretation of convergence of the method.
42
Geometrical interpretation of convergence Case 1: | g ′( x) | < 1 with g ′( x) > 0 In this case the bending or the concavity of the curve x = g (x) will be of Fig 3.1(a) y=x
y
y = g (x)
Fig 3.2 A
r
x0
x1
x2
x
The line y = x and the curve y = g (x) intersect at the point A. The x - coordinate of A is the exact root r of the equation f ( x) = 0.
Case 2: | g ′( x) | < 1 with g ′( x) < 0 The bending or the concavity of the curve x = g (x) will be of the curve in Fig 3.1(b).
y
y=x
y = g (x)
A
Fig 3.3
x0 x2
r
x1
x
In this case also convergence is guaranteed but the approximations x0 , x1 , x2 ,L oscillate about the exact root r of the equation f ( x) = 0.
Theorem 3.2 (Uniqueness of the root r ) The limit r to which the sequence < xn > of approximations converges is unique.
Proof. The sequence < xn > of the approximations converges to the limit r. We know that the limit of convergence, if exists, is unique. Hence r is unique.
QED
43
Theorem 3.3 (Rate of convergence) The rate of convergence of the iterative method is linear.
Proof. Let < xn > be a sequence of approximations to the exact root r of the equation f ( x) = 0. Then we have r − xn +1 = (r − xn ) g ′( rn ), xn < rn < r | r − xn +1 | = | r − xn | | g ′(rn ) |
⇒
≤ | r − xn | k , Q | g ′( x) | ≤ k < 1, ∀ x ∈ I
(3.6)
If En denotes the error associated with the approximation, we have | En | = | r − xn | and | En +1 | = | r − xn +1 | With these values (3.4) gives | E n +1 | ≤ k | E n | It is a linear relation and shows that the rate of convergence is linear.
Remark. Because of the linear convergence, this method is also called linear iterative method. Theorem 3.4 (Accuracy estimation) Let xn be the approximation to the exact root r of the equation f ( x) = 0. If ε is the given accuracy i.e. | r − xn | ≤ ε, then | xn − xn −1 | ≤
1− k ε, k < 1 k
(3.7)
Proof. Let r be the exact root of the equation x = g (x). Then r = g (r ) Since xn is an approximation to r , we write xn = g ( xn −1 ) By subtraction, ⇒
r − xn = g (r ) − g ( xn −1 ) | r − xn | = | g (r ) − g ( xn −1 ) | ≤ | r − xn −1 | | g ′(α ) |, xn −1 < α < r , by mean value theorem ≤ | r − xn −1 | k , k < 1, Q | g ′(α ) | ≤ k etc
44
≤ k | (r − xn ) + ( xn − xn −1 ) | ≤ k | r − xn | + k | xn − xn −1 | (1 − k ) | r − xn | ≤ k | xn − xn −1 |
⇒
(3.8)
Given that the accuracy is ε i.e. | r − xn | ≤ ε ⇒ Then (3.8) ⇒
− ε ≤ r − xn ≤ ε or − ε ≤ | r − xn | (1 − k )(−ε) ≤ k | xn − xn −1 |, Q k < 1 (1 − k ) ε ≥ k | xn − xn −1 |
⇒ ⇒
| xn − xn −1 | ≤
1− k ε k
QED
Remark. This result helps us when to stop the iterations for a given accuracy. The Aitken ∆2 process for accelerating convergence Depending upon the problem, some times we have to go for many iterations to obtain the desired approximation to the exact root r of the equation. This leads to a cumbersome job. The Aitken ∆2 process reduces the iterations considerably and the convergence to r gets accelerated. The formula or the algorithm for the process is given in the following theorem.
Theorem 3.5 (Aitken ∆2 process) Let xn , xn +1 , xn + 2 be three consecutive approximations to the exact root r of the equation x = g (x). Then
r = xn + 2 − where
( ∆xn +1 ) 2 , ∆2 xn
∆xn = xn +1 − xn and ∆2 xn = ∆ (∆xn ).
(3.9) (3.10)
Proof. We have ( reproduce the results from the proof of the Theorem 3.1)
r − xn +1 = k (r − xn ) and By division,
r − xn + 2 = k (r − xn +1 ) r − xn +1 r − xn = r − xn + 2 r − xn +1 45
⇒
(r − xn +1 ) 2 = ( r − xn )(r − xn +1 )
⇒
− 2r xn +1 + xn +1 = − r xn + 2 − r xn + xn xn + 2
⇒
r ( xn + 2 − 2 xn +1 + xn ) = xn xn + 2 − xn +1
⇒
2
2
2
x x −x r = n n + 2 n +1 x n + 2 − 2 x n +1 + x n =
xn + 2 ( xn + 2 − 2 xn +1 + xn ) − xn + 2 ( xn + 2 − 2 xn +1 + xn ) + xn xn + 2 − xn +1 xn + 2 − 2 xn +1 + xn 2
= xn + 2 −
xn + 2 − 2 xn + 2 xn +1 + xn +1 xn + 2 − 2 xn +1 + xn
= xn + 2 −
( xn + 2 − xn +1 ) 2 xn + 2 − 2 xn +1 + xn
2
2
(3.11)
Using (3.10), we have ∆xn +1 = xn + 2 − xn +1 and
∆2 xn = ∆ (∆xn ) = ∆ ( xn+1 − xn ) = ∆xn +1 − ∆xn = xn + 2 − xn +1 − xn +1 + xn = xn + 2 − 2 xn +1 + xn
Substituting these values in (3.11), we get (3.9).
QED
Remark
1. For computation approximation to the exact root r , we need only three consecutive approximations xn , xn +1 , xn + 2 , and three variations ∆xn , ∆2 xn , and ∆xn +1. 2. From (3.9), the impression is created that it gives the exact value of the root x = r. This is not true, it gives an approximate value of r. Therefore, it is suggested to write (3.9) in the form r ~ xn + 2 −
(∆xn +1 ) 2 . ∆2 xn
(3.9a)
Working procedure to solve problems
(a) In case the interval is not given, apply Theorem 1.2 and estimate the interval I = [a, b] which contains the exact root r of the equation f ( x) = 0. Try to get I of smaller length. 46
(b) Choose an initial approximation x0 in I . Rewrite f ( x) = 0 in the form x = g (x) such that | g ′( x) | ≤ k < 1 for all x ∈ I . (c) Use the formula xn = g ( xn −1 ) and obtain the sequence of approximations x1 , x2 ,L. Stop the iterations to the desired accuracy. (d) The number of iterations is reduced if the Aitken ∆2 process is applied. Problem 3.1
(a) Find a real root of the equation x 3 + x − 1 = 0 by the iterative method. (b) Find a real root of the equation x 3 + x − 1 = 0 by the iterative method on the interval [0,1] with an accuracy of 10 −4. Solution. Let the equation be
f ( x) = x 3 + x − 1 = 0 (a) We find the interval I in which the exact root r of the equation lies. We have f (0) = −1 < 0 and f (1) = 1 + 1 − 1 = 1 > 0 ⇒
The root r lies in [0,1]
The interval of interest can be made shorter by checking other values in [0,1]. For example, f (0.5) = 0.125 + 0.5 − 1 < 0, f (0.6) = 0.216 + 0.6 − 1 < 0, f (0.7) = 0.343 + 0.7 − 1 > 0 ⇒
The root lies in I = [0.6, 0.7].
We use this interval I in stead of [0,1]. This type of preparation helps to avoid further cumbersome computations. Choice of g(x)
We have already explain that the equation x = g (x ) is equivalent to f ( x) = 0, where g ( x) =
⇒
| g ′( x) | =
1 x +1 2
(a1)
2x ( x + 1) 2 2
Here g ′( x) ≠ 0 for 0 < x < 1. Then by Result on maxima and minima of the Unit 1, maxima and minima of g ′(x) exists only at x = 0 and x = 1. Since g ′(0) = 0, the maxima is at x = 1 and is given as follows: 47
max | g ′( x) | =
⇒
I = [ 0 , 1]
2 ×1 1 = = k 0 ⇒
The root r lies in the interval [1, 2].
We choose the initial approximation x0 = 1. Rewrite f ( x) = 0 in the form 49
x( x 2 + 2 x + 10) = 20 ⇒
x=
20 = g ( x), say x + 2 x + 10
| g ′( x) | =
Now
max | g ′( x) | =
⇒
(a1)
2
[1, 2 ]
20(2 x + 2) ( x 2 + 2 x + 10) 2 20(4 + 2) 10 = 1 x
hence the iterative method works. The rule for the method is xn =
1 (log10 xn −1 + 7) 2
Taking x0 = 3.5, we have x1 =
1 (log10 3.5 + 7) = 3.77203402 2
The successive approximations can be written in the tabular form as follows: n
xn
1 3.77203402 2 3.7882878 3 3.78922148 4 3.78927499
⇒
n
xn
5 6 7 8
3.78927806 3.78927823 3.78927824 3.78927824
r ~ 3.78927824 up to eight decimal places.
MCQ 3.1
Let the equation x = g ( x), x ∈ [0,1] be ready for the iterative method such that g ( x) =
a , x +b 2
where a and b are real numbers. Choose the false statement/s from the following: (A) (a, b) = ( −1,1) (B) (a, b) = (1, − 1) (C) (a, b) = (1,1) (D) (a, b) = (−1, − 1)
52
MCQ 3.2
The exact root r of the equation 3x − 2 + sin x = 0 is approximated to three decimal places such that r ~ 0. d1 d 2 d 3 d 4 d 5 d 6 where 0 ≤ d i ≤ 9, i = 1,L, 6. If the initial approximation is taken x0 = 0.3, then choose the correct statement from the following: (A) d1 + d 2 = d 3 (B) d1 , d 3 , d 2 are in arithmetic progression (C) d1 − d 2 = d 3 (D) d1 , d 2 , d 3 are primes SAQ 3.1
Rewrite the equation x 3 = x 2 + x − 1 in the form x = 1 +
1 1 − x x2
and then apply the iterative
method to find a positive root. SAQ 3.2
Using the method of iteration to find a positive root in the interval [0,1] of the equation x e x = 1 correct to three decimal places with an initial approximation x0 = 0.5. SAQ 3.3
Find a real root of the equation x 3 = 2 x + 5 on the interval [2, 3] with an accuracy of 10 −3.
53
SUMMARY
The method of iteration is explained to solve nonlinear equations. The noteworthiness of the Aitken acceleration process has been discussed with illustration.
KEY WORDS
Iterative method Convergence Aitken acceleration process Problem of Leonardo
54
UNIT 01-04
55-72
METHOD OF BISECTION LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain the basic concepts of bisection method for solving equations: algebraic and transcendental equations Apply the method to solve the equations
INTRODUCTION In the graphical method discussed in the second unit, the guess of the root is only possible either from the tabulated values of f (x) for a < x < b or from the graph of f ( x) = 0. In the bisection
method this uncertainty is removed and the first guess of the root is based on the rule provided by the intermediate value property (see Theorem 1.2) given in the first unit. The bisection method falls in the category of iterative methods. The basis of the working of the said method is the repeated use of the intermediate value property given in Thm 1.2. The details of the method are as follows.
4.1 Bisection method Let f ( x) be a continuous function on an interval [a, b]. We assume that the equation f ( x) = 0 has a root. Let the said root be exact and be denoted by r. Hence f (r ) = 0. In general it is not
always possible to find x = r by direct methods. In numerical methods our aim is to find the sequence of values of x which approximates r. In the bisection method we do this job. The first step is to locate the exact root r. For this calculate f (a) and f (b). Suppose they are of opposite signs: i.e. f (a ) f (b) < 0. For convenience assume that f (a ) > 0 and f (b) < 0. Since f (x) is continuos, its graph y = f (x) must cross the x -axis at some point P . This point x = r is the root or the solution of f ( x) = 0. y
y = f (x) f (a)
Fig 4.1
O
b a
P
x f (b)
OP = r 55
By the intermediate value theorem (Thm 1.2), we have r ∈ [a, b]. If f (a) and f (b) are of the same sign, the Thm 1.2 does not work and the method of bisection also fails. We rename the interval I1 = [a1 , b1 ] = [a, b]. Thus the root r ∈ I1. This is just the geometrical picture about the solution and r is an exact root yet not known. In general there is no analytical method to find r of every polynomial or transcendental equation f ( x) = 0. In numerical methods our attempt is to go closer and closer to r by successive iterations. In this direction the first step is to find an initial approximation x1 of a root r. In the bisection method the interval [a1 , b1 ] is bisected at the point P1 ( x1 , 0) i.e. x1 = Fig 4.2
a1 + b1 . 2 b1 = b
x1
a1 = a
This x1 is the first approximation to r. This approximation creates two subintervals [a1 , x1 ] and [ x1 , b1 ]. Since r ∈ [a1 , b1 ], the root r must be in one of these subintervals. There arise three possibilities: (i) f (a1 ) f ( x1 ) < 0 i.e. f (a1 ) and f ( x1 ) are of opposite signs ⇒ r ∈ [a, x1 ] (ii) f ( x1 ) f (b1 ) < 0 ⇒ r ∈ [ x1 , b1 ] (iii) f ( x1 ) = 0 ⇒ x1 = r and the problem of finding a root is complete. In general (iii) will not happen. In either of cases (i) and (ii), we label the interval I 2 = [a2 , b2 ] where the root r lies. Thus for (i) a2 = a1 , b2 = x1 and for (ii) a2 = x1 , b2 = b1 etc. The length of I 2 is
1 of the length of I1 i.e. 2 b2 − a2 = the length of I 2 =
b1 − a1 b − a = 2 2
Thus we have confined the root r to the interval I 2 . In the bisection method the earlier process of bisecting the interval I1 is repeated for I 2 and get the second approximation x2 of r : x2 =
a2 + b2 2
Continue the process of bisecting the subintervals to get a sequence {I n } of subintervals such that
56
I1 ⊃ I 2 ⊃ L ⊃ I n ⊃ L r ∈ I n , ∀ n = 1, 2,L
and the root where I n = [an , bn ] and is of length
b−a . The process of bisection be continued till we get I n 2n
of width | bn − an | as small as we please. As regard to the endpoints of these subintervals, we have a = a1 ≤ a2 ≤ L ≤ an ≤ L ≤ r and r ≤ L ≤ bn ≤ bn−1 ≤ L ≤ b2 ≤ b1 = b
By this we have successive approximations x1 , x2 , x3 , L, xn ,L to the root r. Theoretically the sequence {xk } must converge to r. This forms the content of the Theorem 4.1. Theorem 4.1 (Bisection theorem) Let the function f ( x) be continuos on [a, b] and let r be a root of f ( x) = 0 on [a, b]. If f (a ) and f (b) have opposite signs and {xn } is the sequence of midpoints generated by the bisection process given by a = a1 ≤ a2 ≤ L ≤ an ≤ L ≤ r and r ≤ L ≤ bn ≤ bn−1 ≤ L ≤ b2 ≤ b1 = b
(4.1)
then the sequence {xn } converges to the point x = r. Proof. By the bisection method a sequence of subintervals I n = [an , bn ] is obtained such that a
number xn approximate to the root r of f ( x) = 0 belongs to I n and r ∈ I n . We have xn =
Fig 4.3
an
r
xn
an + bn 2
bn
an
[I]
In Fig 4.3 [I]:
Similarly in Fig 4.3 [II]:
⇒
Now
| r − xn | ≤ | x n − a n | ≤
r
bn
1 a +b | bn − an |, Q xn = n n 2 2
| r − xn | ≤ | bn − xn | ≤ | r − xn | ≤
xn [II]
1 | bn − an | 2
1 | bn − an | ∀n 2
(4.2)
| b1 − a1 | = b − a 57
| b2 − a2 | =
b−a 1 | b1 − a1 | = 1 2 2
| b3 − a3 | =
b−a 1 | b2 − a2 | = 2 2 2
M b−a 1 | bn − an | = | bn −1 − an −1 | = n −1 2 2
Then (4.2) ⇒
| r − xn | ≤
⇒
⇒
b−a ∀n 2n b−a n →∞ 2n
0 ≤ lim | r − xn | ≤ lim n→∞
0 ≤ r − lim xn ≤ 0, Q lim
⇒
n →∞
n→∞
1 = 0, b − a = finite 2n
r − lim xn = 0 i.e. lim xn = r n→∞
n→∞
Hence the sequence {xn } converges to r etc.
QED
Remark. Since we cannot repeat the process of bisection in infinitely large number of steps, the
process be carried out in finite number of iterations. Thus there must be a rule to decide the number of bisections or iterations n such that xn approximates r within the desired accuracy i.e. the error E. It means that having given the error of accuracy, we can find n i.e. the number of
repetitive process of the bisection method. This is achieved in the next theorem. Theorem 4.2 For a given degree of accuracy E > 0, the number n of iterations satisfies the inequality
n≥
ln(b − a ) − ln E ln 2
Proof. Let n be the required number of iterations. The length of the interval I n is
the nth iteration, for E > 0 we have b−a ≤E 2n Taking logarithms, we have
58
(4.3) b−a . After 2n
ln(b − a ) − ln 2 n ≤ ln E ⇒
ln 2 n ≥ ln(b − a) − ln E
⇒
n ln 2 ≥ ln(b − a ) − ln E
⇒
n≥
ln(b − a ) − ln E ln 2
QED
Remark. In (4.3), the base of the logarithm is e. If the base is 10, then we rewrite the same as
n≥
log10 (b − a) − log10 E log10 2
(4.4)
Illustration. Let a = 0, b = 1, E = 10 −1. Then (4.4) gives
n≥
log10 1 − log10 10 −1 0 + 1log10 10 1 = = log10 2 log10 2 log10 2 n≥
⇒
1 = 3.32 0.301 n=4
⇒
Thus the number of iterations is 4 to the given accuracy E = 10 −1. Rate of convergence of an iterative method Definition. An iterative method is said to have the rate of convergence k , if there is k ≥ 1 such
that | E ( x n +1 ) | ≤ C | E ( x n ) | k
(4.5)
where C ≠ 0 is a positive finite constant. Rate of convergence of the bisection method
Let r be the exact root of the equation f ( x) = 0 and let the nth iterate be xn . By definition, | E ( xn ) | = | r − xn | and | E ( xn +1 ) | = | r − xn +1 |
(4.6)
For the bisection method, we have | r − x n +1 | ≤ ⇒
| E ( xn +1 ) | ≤
1 | r − xn | ∀ n 2
1 | E ( xn ) |, by (4.6) 2 59
| E ( x n +1 ) | ≤
⇒
Comparing above with (4.5), we have C =
1 | E ( xn ) |1 2
1 and k = 1. Thus the rate of convergence of the 2
bisection method is k = 1 i.e. the rate is linear. Remark
(a) The bisection method is simple and easy to understand. (b) Since the root lies in the interval considered, the method never fails. (c) The value of f ( xn ) is not used, only its sign positive or negative matters. (d) The method has linear convergence. (e) The method is slow and time consuming. Note. The following solved problems illustrate the working of the bisection method to evaluate
the root of the equation f ( x) = 0. We assume the following: (i) r stands for an exact root of f ( x) = 0 (ii) xn approximates r , xn , r ∈ I n = [ an , bn ], I1 = [a1 , b1 ] = [ a, b] (iii) Algorithm of the bisection method is xn =
an + bn , n = 1, 2,L 2
(4.7)
(iv) For computation a scientific calculator is used. Problem 4.1
Find an interval of unit length which contains the smallest positive root of the equation x 3 − 5 x − 2 = 0. Hence or otherwise determine the number of iterations required by the bisection method so that | error | < 10 −4. Solution. Denote
⇒ Now
f ( x) = x 3 − 5 x − 2 = 0
f (1) = 1 − 5 − 2 < 0, f ( 2) = 8 − 10 − 2 < 0, f (3) = 27 − 15 − 2 > 0 (i) f (x) is continuous on the interval [2, 3] of unit length (ii) f (2) and f (3) are of opposite signs
Then by the intermediate value property there is one root of f ( x) = 0 between 2 and 3. Hence the said root must be positive. 60
Let n be the number of iterations to achieve the accuracy of 10 −4. Then taking a = 2, b = 3, E = 10 −4 in (4.2), we get n≥ ⇒
log10 (1) − log10 10 −4 0 + 4 log10 10 4 = = = 13.29 log10 2 log10 2 log10 2
n = 14
Problem 4.2
Perform four iterations of the bisection method to find a real root of x 4 − x − 10 = 0. f ( x) = x 4 − x − 10 = 0
Solution. Denote
Since f (x) is a polynomial, it is continuous for all real values of x. Now f (1) = 1 − 1 − 10 < 0 and f ( 2) = 16 − 2 − 10 > 0 Hence by the intermediate value property, the exact root r lies between 1 and 2 i.e. r ∈ I1 = [ a1 , b1 ] = [1, 2]. Iteration 1: x1 ~ r. For n = 1 in (4.7), We have
x1 =
f ( x1 ) = f (1.5) = (1.5) 4 − 1.5 − 10 = 5.0625 − 1.5 − 10 < 0
⇒ ⇒
a1 + b1 1 + 2 = = 1.5 2 2
r ∈ I 2 = [ a2 , b2 ] = [1.5, 2]
Iteration 2: x2 ~ r
x2 =
f ( x2 ) = f (1.75) = (1.75) 4 − 1.75 − 10 = −2.3711 < 0
⇒ ⇒
a2 + b2 1.5 + 2 = = 1.75 2 2
r ∈ I 3 = [a3 , b3 ] = [1.75, 2]
Iteration 3: x3 ~ r
x3 = ⇒ ⇒
a3 + b3 1.75 + 2 = = 1.875 2 2
f ( x3 ) = f (1.875) = (1.875) 4 − 1.875 − 10 = 0.4846 > 0 r ∈ I 3 = [a4 , b4 ] = [1.75, 1.875] 61
Iteration 4: x4 ~ r
x4 =
f ( x4 ) = f (1.8125) = (1.8125) 4 − 1.8125 − 10 = −1.0202 < 0
⇒ ⇒
a4 + b4 1.75 + 1.875 = = 1.8125 2 2
r ∈ I 5 = [a5 , b5 ] = [1.8125,1.875]
The approximation to the exact root r is taken as r~ x=
1.8125 + 1.875 = 1.84375 2
The above process can be put in a tabular form, for better understanding as follows. n
an
bn
xn =
1 1 2 2 1.5 2 3 1.75 2 4 1.75 1.875
an + bn 2
1.5 1.75 1.875 1.8125
f ( an )
f (bn )
f ( xn )
r ∈ In
( −) ( −) ( −) ( −)
(+) (+) (+) (+)
( −) ( −) (+) ( −)
[ x1 , b1 ] [ x2 , b2 ] [a3 , x3 ] [ x4 , b4 ]
Then the desired approximation to the exact root r is computed as x=
1.8125 + 1.875 = 1.84375 2
We now compute the percentage error at each iteration. We have | E p ( x2 ) | = | Er ( x2 ) | × 100 =
1.75 − 1.5 ×100 = 14.2857 1.75
| E p ( x3 ) | = | Er ( x3 ) | × 100 =
1.875 − 1.75 ×100 = 6.6667 1.875
| E p ( x4 ) | = | Er ( x4 ) |×100 =
1.8125 − 1.875 × 100 = 3.4483 1.8125
| E p ( x) | = | Er ( x) |× 100 =
1.84375 − 1.8125 × 100 = 1.6949 1.84375
Problem 4.3
Using the bisection method, find an approximate root of the equation sin x =
1 , that lies between x
x = 1 and x = 1.5 (measured in radians). Carry out computations up to the 7th stage. 62
Solution. We confine to approximations to five decimal places. Given equation is
x sin x = 1 i.e. x sin x − 1 = 0 f ( x) = x sin x − 1
Denote ⇒
f (1) = 1sin 1 − 1 = 0.84147 − 1 = −0.15853 < 0
and
f (1.5) = 1.5 sin(1.5) − 1 = 1.5 (0.99749) − 1 = 1.49624 − 1 = 0.49624 > 0
⇒
The root r lies between 1 and 1.5 i.e. r ∈ I1 = [ a1 , b1 ] = [1,1.5]
Iteration 1: x1 ~ r
⇒
x1 =
a1 + b1 1 + 1.5 = = 1.25, by bisection method 2 2
⇒
f ( x1 ) = f (1.25) = 1.25 sin(1.25) − 1 = 1.25 (0.94898) − 1 = 0.18623 > 0
⇒
r ∈ I 2 = [ a2 , b2 ] = [1,1.25]
Iteration 2: x2 ~ r
⇒
x2 =
a2 + b2 1 + 1.25 = = 1.125 2 2
⇒
f ( x2 ) = f (1.125) = 1.125 sin(1.125) − 1 > 0
⇒
r ∈ I 3 = [a3 , b3 ] = [1,1.125], Q f (1) < 0
Iteration 3: x3 ~ r
⇒
x3 =
a3 + b3 1 + 1.125 = = 1.0625 2 2
⇒
f ( x3 ) = f (1.0625) = 1.0625 sin(1.0625) − 1 < 0
⇒
r ∈ I 4 = [a4 , b4 ] = [1.0625,1.125], Q f (1.125) > 0
Iteration 4: x4 ~ r ⇒
x4 =
a4 + b4 1.0625 + 1.125 = = 1.09375 2 2
⇒
f ( x4 ) = f (1.09375) = 1.09375 sin(1.09375) − 1 < 0
⇒
r ∈ I 5 = [a5 , b5 ] = [1.09375,1.125], Q f ( x2 ) > 0
Iteration 5: x5 ~ r 63
a5 + b5 1.09375 + 1.125 = = 1.109375 2 2
x5 =
⇒
⇒
f ( x5 ) = f (1.109375) = 1.109375 sin(1.1094) − 1 = −0.0066 < 0
⇒
r ∈ I 6 = [a6 , b6 ] = [1.109375,1.125], Q f ( x2 ) > 0
Iteration 6: x6 ~ r
x6 =
⇒
a6 + b6 1.109375 + 1.125 = = 1.11719 2 2
f ( x6 ) = f (1.11719) = 1.11719 sin(1.11719) − 1 > 0
⇒
Then the required approximation x = x7 to the root r lies between x6 and x5 , since f ( x5 ) < 0. It is given by x = x7 =
x5 + x6 1.109375 + 1.11719 = = 1.11328 2 2
If we stop further bisection, the maximum absolute error is | E ( x) | = | 1.11328 − 1.11719 | = 0.00391 | Er ( x ) | =
⇒
| E ( x) | 0.00391 = = 0.00351 x 1.11328 | E p ( x) | = 0.351
and
Problem 4.4
Find out the square root of 25 given x0 = 2.0 , x1 = 7.0 using bisection method. Solution. We reduce the problem of finding the square root of 25 to that of finding the root of the
equation:
25 = x. Then the resulting equation is f (x) = x 2 − 25 = 0
⇒
f ( x0 ) = f (2.0) = 4 − 25 < 0
and
f ( x1 ) = f (7) = 49 − 25 > 0
⇒
⇒
The root r of (a1) lies between 2 and 7 r ∈ I1 = [a1 , b1 ] = [ 2, 7]
We denote the i th approximation to the root by xi .
64
(a1)
Iteration 2: x2 ~ r
x2 =
a2 + b2 2 + 7 = = 4.5, by bisection method 2 2
and
f ( x2 ) = f (4.5) = (4.5) 2 − 25 < 0
⇒
r ∈ I 3 = [a3 , b3 ] = [4.5, 7]
Iteration 3: x3 ~ r
x3 =
a3 + b3 4.5 + 7 = = 5.75 2 2
⇒
f ( x3 ) = f (5.75) = (5.75) 2 − 25 > 0
⇒
r ∈ I 4 = [ a4 , b4 ] = [4.5, 5.75]
Iteration 4: x4 ~ r
x4 =
a4 + b4 4.5 + 5.75 = = 5.125 2 2
⇒
f ( x4 ) = f (5.125) = (5.125) 2 − 25 > 0
⇒
r ∈ I 5 = [a5 , b5 ] = [4.5, 5.125], Q f ( x2 ) < 0
Iteration 5: x5 ~ r
x5 =
a5 + b5 4.5 + 5.125 = = 4.8125 2 2
and
f ( x5 ) = f (4.8125) = (4.8125) 2 − 25 < 0
⇒
r ∈ I 6 = [a6 , b6 ] = [4.8125, 5.125]
Iteration 6: x6 ~ r
x6 =
a6 + b6 4.8125 + 5.125 = = 4.96875 2 2
and
f ( x6 ) = f (4.96875) = ( 4.96875) 2 − 25 < 0
⇒
r ∈ I 7 = [ a7 , b7 ] = [4.96875, 5.125]
Iteration 7: x7 ~ r
x7 =
a7 + b7 4.96875 + 5.125 = = 5.046875 2 2 65
and
f ( x7 ) = f (5.046875) = (5.046875) 2 − 25 > 0
⇒
r ∈ I 8 = [a8 , b8 ] = [4.96875, 5.046875]
Iteration 8: x8 ~ r
x8 =
a8 + b8 4.96875 + 5.046875 = = 5.0078125 2 2
and
f ( x8 ) = f (5.0078125) = (5.0078125) 2 − 25 > 0
⇒
r ∈ I 9 = [a9 , b9 ] = [4.96875, 5.0078125]
Iteration 9: x9 ~ r
x9 =
a9 + b9 1 = (4.96875 + 5.0078125) = 4.98828125 2 2
and
f ( x9 ) = f (4.988125) = (4.98828125) 2 − 25 < 0
⇒
r ∈ I10 = [a10 , b10 ] = [4.98828125, 5.0078125]
Iteration 10: x10 ~ r
x10 =
a10 + b10 1 = (4.98828125 + 5.0078125) = 4.998046875 2 2
and
f ( x10 ) = f (4.998046875) = (4.998046875) 2 − 25 < 0
⇒
r ∈ I10 = [a10 , b10 ] = [4.998046875, 5.0078125]
Iteration 11: x11 ~ r
x11 =
a11 + b11 1 = (4.998046875 + 5.0078125) = 5.0029296875 2 2
and
f ( x11 ) = f (5.0029296875) = (5.0029296875) 2 − 25 > 0
⇒
r ∈ I11 = [a11 , b11 ] = [4.998046875, 5.0029296875]
Iteration 12: x12 ~ r
x12 =
a11 + b11 1 = (4.998046875 + 5.0029296875) = 5.00048828125 2 2
and
f ( x12 ) = f (5.00048828125) = (5.00048828125) 2 − 25 > 0
⇒
r ∈ I12 = [a12 , b12 ] = [ 4.998046875, 5.00048828125]
66
Iteration 13: x13 ~ r
x13 =
a12 + b12 1 = (4.998046875 + 5.00048828125) = 4.999267578125 2 2
and
f ( x13 ) = f ( 4.999267578125) = (4.999267578125) 2 − 25 < 0
⇒
r ∈ I13 = [a13 , b13 ] = [4.999267578125, 5.00048828125]
Iteration 14: x14 ~ r
x14 =
a13 + b13 1 = (4.999267578125 + 5.00048828125) = 4.9998779296875 2 2
and
f ( x14 ) = f (4.9998779296875) = (4.9998779296875) 2 − 25 < 0
⇒
r ∈ I14 = [a14 , b14 ] = [4.9998779296875, 5.00048828125]
Iteration 15: x15 ~ r
x15 =
a14 + b14 1 = (4.9998779296875 + 5.00048828125) = 5.00018310546875 2 2
and
f ( x15 ) = f (5.00018310546875) = (5.00018310546875) 2 − 25 > 0
⇒
r ∈ I15 = [a15 , b15 ] = [4.9998779296875, 5.00018310546875]
Iteration 16: x16 ~ r
x16 = ⇒
a15 + b15 1 = ( 4.9998779296875 + 5.00018310546875) = 5.000030517578125 2 2
r ~ x16 = 5.0000 to the four decimal places
Problem 4.5 Use the bisection method to find the negative root of x 3 − 4 x + 8 = 0 to the four decimal places. Hint. The negative root of f ( x) = 0 is the positive root of f (− x) = 0. Solution. Let f ( x) = x 3 − 4 x + 8 = 0. Then the negative root of f ( x) = 0 is the positive root of
f (− x) = 0 i.e. (− x)3 − 4(− x) + 8 = 0 or x 3 − 4 x − 8 = 0 Denote
g ( x) = x 3 − 4 x − 8 = 0
(a1)
We find the positive root of g ( x) = 0. Now
g ( 2) = 8 − 8 − 8 < 0 and g (3) = 27 − 12 − 8 > 0 67
⇒
The root of (a1) lies in (2, 3).
Denoting the i th approximation to the root by xi , by bisection method we above x0 =
g ( x0 ) = g (2.5) = ( 2.5)3 − 4( 2.5) − 8 = −2.375 < 0
⇒ ⇒
2+3 = 2.5 2
The root r lies in [2.5, 3] i.e. r ∈ I1 = [ a1 , b1 ] = [2.5, 3]
Iteration 1: x1 ~ r
x1 =
a1 + b1 2.5 + 3 = = 2.75 2 2
and
g (2.75) = (2.75)3 − 4(2.75) − 8 = 1.7969 > 0
⇒
r ∈ I 2 = [ a2 , b2 ] = [2.5, 2.75]
Iteration 2: x2 ~ r
x2 =
a2 + b2 2.5 + 2.75 = = 2.625, by bisection method 2 2
g (2.625) = ( 2.625)3 − 4(2.625) − 8 = −0.421 < 0
Then ⇒
r ∈ I 3 = [a3 , b3 ] = [2.625, 2.75]
Iteration 3: x3 ~ r
x3 = Then
a3 + b3 2.625 + 2.75 = = 2.6875 2 2
g (2.6875) = (2.6875)3 − 4(2.6875) − 8 = −7.9484 < 0
⇒
r ∈ I 4 = [a4 , b4 ] = [ 2.6875, 2.75]
Iteration 4: x4 ~ r ⇒
x4 =
a4 + b4 2.6875 + 2.75 = = 2.71875, by bisection method 2 2
and
g ( 2.71875) = (2.71875)3 − 4(2.71875) − 8 = 9.3771 < 0
⇒
r ∈ I 5 = [a5 , b5 ] = [2.71875, 2.75]
Iteration 5: x5 ~ r
68
x5 =
a5 + b5 2.71875 + 2.75 = = 2.734375, by bisection method 2 2
and
g (2.734375) = ( 2.734375)3 − 4(2.734375) − 8 > 0
⇒
r ∈ I 6 = [a6 , b6 ] = [2.71875, 2.734375]
Iteration 6: x6 ~ r
x6 =
a6 + b6 2.71875 + 2.734375 = = 2.726562, by bisection method 2 2
and
g (2.726562) = (2.726562)3 − 4(2.726562) − 8 > 0
⇒
r ∈ I 7 = [a7 , b7 ] = [2.71875, 2.726562]
Iteration 7: x7 ~ r
x7 =
a7 + b7 2.71875 + 2.726562 = = 2.722656, by bisection method 2 2
and
g (2.722656) = (2.722656)3 − 4(2.722656) − 8 > 0
⇒
r ∈ I 8 = [a8 , b8 ] = [2.71875, 2.722656]
Iteration 8: x8 ~ r
x8 =
⇒
2.71875 + 2.722656 = 2.720703 2
and
g (2.720703) = (2.720703)3 − 4( 2.720703) − 8 > 0
⇒
r ∈ I 9 = [a9 , b9 ] = [2.71875, 2.720703]
Iteration 9: x9 ~ r ⇒
x9 =
a9 + b9 2.71875 + 2.720703 = = 2.719727, by bisection method 2 2
and
g ( 2.719727) = (2.719727)3 − 4(2.719727) − 8 > 0
⇒
r ∈ I10 = [a10 , b10 ] = [2.71875, 2.719727]
Iteration 10: x10 ~ r ⇒
x10 =
a10 + b10 2.71875 + 2.719727 = = 2.719238, by bisection method 2 2 69
and
g (2.719238) = ( 2.719238)3 − 4(2.719238) − 8 > 0
⇒
r ∈ I11 = [a11 , b11 ] = [2.71875, 2.719238]
Iteration 11: x11 ~ r ⇒
x11 =
a11 + b11 2.71875 + 2.719238 = = 2.718994, by bisection method 2 2
and
g (2.718994) = (2.718994)3 − 4(2.716994) − 8 > 0
⇒
r ∈ I12 = [a12 , b12 ] = [2.71875, 2.718994]
Iteration 12: x12 ~ r ⇒
x12 =
a12 + b12 2.71875 + 2.718994 = = 2.718872, by bisection method 2 2
and
g (2.718872) = (2.718872)3 − 4(2.718872) − 8 > 0
⇒
r ∈ I13 = [a13 , b13 ] = [2.71875, 2.718872]
Iteration 13: x13 ~ r ⇒
x13 =
a13 + b13 2.71875 + 2.718872 = = 2.718811, by bisection method 2 2
and
g (2.718811) = (2.718811)3 − 4(2.718811) − 8 > 0
⇒
r ∈ I14 = [a14 , b14 ] = [2.71875, 2.718811]
Iteration 14: x14 ~ r ⇒
x14 =
a14 + b14 2.71875 + 2.718811 = = 2.718781, by bisection method 2 2
and
g (2.718781) = (2.718781)3 − 4(2.718781) − 8 > 0
⇒
r ∈ I15 = [a15 , b15 ] = [2.71875, 2.718781]
Iteration 15: x15 ~ r ⇒
x15 =
a15 + b15 2.71875 + 2.718781 = = 2.718766, by bisection method 2 2
and
g ( 2.718766) = ( 2.718766) 3 − 4(2.718766) − 8 > 0
⇒
r ∈ I16 = [a16 , b16 ] = [2.71875, 2.718766]
70
Iteration 16: x16 ~ r ⇒
x16 =
a16 + b16 2.71875 + 2.718766 = = 2.718758, by bisection method 2 2
and
g ( 2.718766) = ( 2.718766) 3 − 4(2.718766) − 8 > 0
⇒
r ∈ I16 = [a16 , b16 ] = [2.71875, 2.718766]
The approximations x14 , x15 and x16 are equal to the four decimal places as such the desired root correct to the four decimal places is
x = 2.7187 ~ r Then the required negative root of the given equation is x = −2.7187. MCQ 4.1
In the bisection method the number of iterations to get an accuracy 0.001 in an interval [3, 4] is (A) 8 (B) 9 (C) 10 (D) 11 SAQ 4.1
Find the positive root of x − cos x = 0 correct to two decimal places by bisection method. SAQ 4.2
Find the root of
x 3 − x − 1 = 0 between 1 and 2 up to three places of decimals by bisection
method. SAQ 4.3
Find an interval of unit length which contains the smallest positive root of the equation x 3 + x 2 − 3 x − 3 = 0. Hence or otherwise find the root up to the accuracy of 10 −2. SAQ 4.4
Perform five iterations of the bisection method to obtain the smallest positive root of the equation x 3 − 5 x + 1 = 0. 71
SUMMARY The method of bisection is discussed for solving algebraic and transcendental equations with illustrative solved examples. The convergence of the method is also explained.
KEY WORDS Algebraic equations Transcendental equations Bisection method Convergence
72
UNIT 01-05
73-85
THE METHOD OF FALSE POSITION (OR REGULA FALSI METHOD) LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain the method of false position Apply to find the roots of the equation f ( x) = 0 numerically
INTRODUCTION From the study of the bisection method discussed in the previous unit, it is observed that its convergence is fairly slow. There are numerical methods where the convergence is faster and the method of false position is one of them. This method is explained in this unit.
5.1 About the method and its algorithm The basic problem is to solve a nonlinear equation f ( x) = 0, where f (x) is continuous on some interval. Let its graph AB insect the x - axis at the point P(r , 0). Its x -coordinate r = OP is the exact root of the equation f ( x) = 0 (in Fig 5.1, the point P is not shown). The two Figs (a) and (b) show the different concavity of the graph of the function f ( x).
y
y A
y = f (x) A
Fig 5.1
x2
O a
x1
b
r D
(a )
C
x
C
D
r
O a
x1
b
x
x2
B
y = f (x)
(b)
B
Consider the points A and B on the graph of f ( x) having their x -coordinates a and b respectively. Let I = [a, b] such that f (a ) f (b) < 0. Then from theorem 1.2, the exact root r lies in the interval I . In the bisection method, the first approximation to r is taken at the mid point of
73
I i.e.
a+b ~ r. The method of false position improves this approximation. It is taken as the x 2
coordinate of a point where the line joining the points A(a, f (a )) and B(b, f (b)) intersects the x - axis. Let this first approximation be x1 ~ r. To find x1
The equation of the straight line AB is y − f (a) =
f (b) − f (a) ( x − a) b−a
(5.1)
Since the point ( x1 , 0) lies on it, we have 0 − f (a) =
f (b) − f (a ) ( x1 − a) b−a
x1 − a = −
f (a) (b − a ) f (b) − f (a )
⇒
x1 = b −
⇒
(b − a) f (b) (b − a) f (a) or x1 = a − f (b) − f (a ) f (b) − f (a)
If we rename the interval I = [a, b] as I1 = [a1 , b1 ], then above becomes x1 = b1 −
(b1 − a1 ) f (b1 ) (b − a ) f ( a1 ) or x1 = a1 − 1 1 f (b1 ) − f (a1 ) f (b1 ) − f ( a1 )
(5.2)
This formula is helpful to write the next successive approximations x2 , x3 ,L and then the algorithm of the method. To get x2 ~ r , find f ( x1 ). There will be three possibilities: (i) f ( x1 ) = 0. In this case x1 = r and the problem of finding the root is completed. (ii) f ( x1 ) < 0. Then the next approximation x2 lies in the interval [a, x1 ]. (iii) f ( x1 ) > 0. In this case x2 lies in the interval [ x1 , b]. The case (ii) corresponds to the Fig 5.1(a) and the case (iii) to the Fig 5.1(b). In both the cases to get x2 , geometrically draw a perpendicular to the x -axis from the point ( x1 , 0) to intersect the graph of f (x) in the point C ( x1 , f ( x1 )). Join AC. The x - coordinate of the point of intersection of AC and the x - axis is our candidate x2 . Continuing the process we construct a sequence of approximations x1 , x2 ,L, xn ,L such that it converges to r i.e. lim xn = r.
n→∞
To get the rule or the algorithm of the method, we just follow (5.1) and write it as xn = bn − were I n = [an , bn ].
74
(bn − an ) f (bn ) (b − an ) f (an ) or xn = an − n , f (bn ) − f (an ) f (bn ) − f (an )
(5.3)
Here are some of the interesting aspects of the method. Its beauty lies in the pattern of approximations:
a
r
x4
x3
x2
x1
b
or a
x1
x2
x3
x4
r
b
Analytically it means that Either | x1 | ≥ | x2 | ≥ | x3 | ≥ L or | x1 | ≤ | x2 | ≤ | x3 | ≤ L From geometrical illustration in the Fig 5.1, the above is obvious. It then implies that one end of each of the intervals I n remains fixed either left end a of the right end b.
About the convergence of the method As pointed earlier, the algorithm (5.3) of the method gives a sequence < xn > of approximations that converges to the exact solution r of the equation f ( x) = 0. However, it may happen that xn → r without bn − an → 0 as n → ∞.
5.2 Illustrative problems In solving the problems it is assumed that (i) exact root of f ( x) = 0 is r (ii) I n = [an , bn ], I1 = [a1 , b1 ] = [a, b] (iii) xn is an approximate value of r in I n (iv) algorithm for computation is given by (5.3) (v) in general computations are up to six decimal places.
Problem 5.1 Find the positive root of x 3 − x − 2 = 0 by false position method in five iterations.
Solution. Let
f ( x ) = x 3 − x − 2.
⇒
f (0) = −2 < 0, f (1) = 1 − 1 − 2 = −2 < 0 and f ( 2) = 23 − 2 − 2 = 4 > 0
⇒
The root r of f ( x) = 0 lies in I1 = [a1 , b1 ] = [1, 2] 75
Taking n = 1, 2,L in (5.3), we get the following successive approximations.
Approximation 1: x1 ~ r. Here a1 = 1, b1 = 2. x1 = b1 −
(b1 − a1 ) f (b1 ) f (b1 ) − f (a1 )
= 2−
(2 − 1) f (2) f (2) − f (1)
=2−
1× 4 4 − (−2)
=
8 6
= 1.333333 Then
f ( x1 ) = f (1.333333) = (1.333333)3 − (1.333333) − 2 = − 0.962964 < 0
Since f (1.333333) < 0 and f (2) > 0, r ∈ I 2 = [a2 , b2 ] = [1.333333, 2]. It seems that the right end of the interval [a, b] is fixed.
Approximation 2: x2 ~ r x2 = b2 −
= 2−
(b2 − a2 ) f (b2 ) f (b2 ) − f (a2 ) (2 − 1.333333) f (2) f (2) − f (1.333333)
= 1.462686 ⇒
f ( x2 ) = f (1.462686) = (1.462686)3 − (1.462686) − 2 = −0.333342 < 0
⇒
r ∈ I 3 = [a3 , b3 ] = [1.462686, 2]
Approximation 3: x3 ~ r x3 = b3 −
= 2−
(b3 − a3 ) f (b3 ) f (b3 ) − f (a3 ) (2 − 1.462686) f (2) f (2) − f (1.462686)
= 1.504028 ⇒ 76
f ( x3 ) = f (1.504028) = (1.504028)3 − (1.504028) − 2 = −0.101766 < 0
Since f (1.504028) < 0 and f (2) > 0, r ∈ I 4 = [a4 , b4 ] = [1.504028, 2].
Approximation 4: x4 ~ r x4 = b4 −
= 2−
(b4 − a4 ) f (b4 ) f (b4 ) − f (a4 ) (2 − 1.504028) f ( 2) f (2) − f (1.5040)
= 1.516333 f ( x4 ) = f (1.516333) = (1.516333)3 − (1.516333) − 2 = −0.02988 < 0
⇒
Since f (1.516333) < 0 and f (2) > 0, r ∈ I 5 = [a5 , b5 ] = [1.516333, 2].
Approximation 5: x5 ~ r x5 = b5 −
= 2−
(b5 − a5 ) f (b5 ) f (b5 ) − f (a5 ) (2 − 1.51633) f (2) f (2) − f (1.516333)
= 1.519919 Hence performing five iterations, the approximation x5 ~ r is given by x5 = 1.519919. The construction of the approximations can be geometrically expressed as follows: x1 (1.333333) → x2 (1.462686) → x3 (1.504028) → x4 (1.516333) → x5 (1.519919) → r.
Problem 5.2
Perform four iterations of the regula falsi method to find a real root of the equation x 2 − x − 10 = 0.
Compute the percentage error at each iteration. Compare the results with thoat of bisection method. Solution. Let ⇒ ⇒
f ( x) = x 4 − x − 10 = 0. f (1) = 1 − 1 − 10 = −10 < 0 and f ( 2) = 16 − 2 − 10 = 4 > 0
The exact root r of f ( x) = 0 lies in I1 = [a1 , b1 ] = [1, 2].
Taking n = 1, 2,L in (5.3), we have the following successive approximations. 77
Approximation 1: x1 ~ r. Here a1 = 1, b1 = 2. x1 = b1 −
= 2−
(b1 − a1 ) f (b1 ) f (b1 ) − f (a1 ) (2 − 1) f (2) f (2) − f (1)
= 1.714286
Then
f ( x1 ) = f (1.714286) = (1.714286) 4 − (1.714286) − 2 = − 3.077879 < 0
⇒
r ∈ I 2 = [ a2 , b2 ] = [1.714286, 2]
Here the right end of [a, b = 2] is fixed. Approximation 2: x2 ~ r x2 = b2 −
= 2−
(b2 − a2 ) f (b2 ) f (b2 ) − f (a2 ) (2 − 1.714286) f (2) f (2) − f (1.714286)
= 1.838531 ⇒
f ( x2 ) = f (1.838531) = (1.838531) 4 − (1.838531) − 10 = −0.412804 < 0
⇒
r ∈ I 3 = [a3 , b3 ] = [1.838531, 2]
Approximation 3: x3 ~ r x3 = b3 −
= 2−
(b3 − a3 ) f (b3 ) f (b3 ) − f (a3 ) (2 − 1.838531) f (2) f (2) − f (1.838531)
= 1.853636 ⇒
f ( x3 ) = f (1.853636) = (1.853636) 4 − (1.853636) − 10 = −0.047771 < 0
⇒
r ∈ I 4 = [ a4 , b4 ] = [1.853636, 2]
Approximation 4: x4 ~ r x4 = b4 −
78
(b4 − a4 ) f (b4 ) f (b4 ) − f (a4 )
= 2−
(2 − 1.853636) f (2) f (2) − f (1.853636)
= 1.855363
Hence the desired approximation is x4 = 1.855363. Comparison with the bisection method
This problem has been solved by the bisection method: see Problem 4.2 of the Unit 4. To compare the approximations, the information is given in a tabular form: x1
x2
x3
x4
Bisection method 1.5 1.75 1.875 1.8125 Regula falsi method 1.714286 1.838531 1.853636 1.855363
Comparison of the percentage errors E p ( xn ) =
xn − xn −1 × 100 xn
E p ( x2 ) E p ( x3 ) E p ( x4 ) Bisection method
14.29
6.67
3.45
Regula falsi method
6.76
0.81
0.09
The comparative study indicates that the regula falsi method is more accurate and faster than the bisection method.
Problem 5.3 Find a positive root of x e x = 2 by the method of false position limited to five iterations.
Solution. Let f ( x) = x e x − 2. Now ⇒
f (0) = −2 < 0 and f (1) = e − 2 = 2.7183 − 2 = 0.7183 > 0 The root r ∈ I1 == [a1 , b1 ] = [0,1]
Approximation 1: x1 ~ r x1 = b1 −
(b1 − a1 ) f (b1 ) 1× f (1) =1− = 0.735759 f (b1 ) − f (a1 ) f (1) − f (0)
⇒
f ( x1 ) = f (0.735759) = (0.735759) e 0.735759 − 2 = −0.464423 < 0
⇒
r ∈ I 2 = [ a2 , b2 ] = [0.735759,1] 79
Approximation 2: x2 ~ r x2 = b2 −
(b2 − a2 ) f (b2 ) (1 − 0.735759) f (1) =1− = 0.839521 f (b2 ) − f (a2 ) f (1) − f (0.735759)
f ( x2 ) = f (0.839521) = (0.839521) e 0.839521 − 2 = −0.056293 < 0
⇒
Since f (0.839521) < 0 and f (1) > 0, r ∈ I 3 = [a3 , b3 ] = [0.839521,1].
Approximation 3: x3 ~ r x3 = b3 −
(b3 − a3 ) f (b3 ) (1 − 0.839521) f (1) =1− = 0.851184 f (b3 ) − f (a3 ) f (1) − f (0.839521)
⇒
f ( x3 ) = f (0.851184) = (0.851184) e 0.851184 − 2 = −0.006171
⇒
r ∈ I 4 = [a4 , b4 ] = [0.851184,1].
Approximation 4: x4 ~ r x4 = b4 −
(b4 − a4 ) f (b4 ) (1 − 0.851184) f (1) =1− = 0.852452 f (b4 ) − f (a4 ) f (1) − f (0.851184)
⇒
f ( x4 ) = f (0.852452) = (0.852452) e 0.852452 − 2 = −0.000667 < 0
⇒
r ∈ I 5 = [a5 , b5 ] = [0.852452,1]
Approximation 5: x5 ~ r x5 = b5 −
(b5 − a5 ) f (b5 ) (1 − 0.852452) f (1) = 1− = 0.852589 f (b5 ) − f (a5 ) f (1) − f (0.852452)
Hence the approximate root is x = 0.852589.
Problem 5.4 The equation x 6 − x 4 − x 3 − 1 = 0 has one real root between 1.4 and 1.5. Using false position method find the root correct to four decimal places.
Solution. Let f ( x) = x 6 − x 4 − x 3 − 1. Given that its the exact root r ∈ [1.4,1.5] i.e. r ∈ I1 = [ a1 , b1 ] = [1.4,1.5]. ⇒
f ( a1 ) = f (1.4) = 1.46 − 1.4 4 − 1.43 − 1 = −0.056064
and
f (b1 ) = f (1.5) = 1.56 − 1.54 − 1.53 − 1 = 1.953125 > 0
80
Approximation 1: x1 ~ r x1 = b1 −
(b1 − a1 ) f (b1 ) (1.5 − 1.4) f (1.5) = 1 .5 − = 1.40279 f (b1 ) − f (a1 ) f (1.5) − f (1.4)
⇒
f ( x1 ) = f (1.40279) = 1.40279 6 − 1.40279 4 − 1.402793 − 1 = −0.012735
⇒
r ∈ I 2 = [a2 , b2 ] = [1.40279,1.5]
Approximation 2: x2 ~ r (b2 − a2 ) f (b2 ) (1.5 − 1.40279) f (1.5) = 1 .5 − = 1.40342 f (b2 ) − f (a2 ) f (1.5) − f (2.40279)
x2 = b2 − ⇒
f ( x2 ) = f (1.40342) = 1.403426 − 1.40342 4 − 1.403423 − 1 = −0.002861
⇒
r ∈ I 3 = [a3 , b3 ] = [1.40342,1.5]
Approximation 3: x3 ~ r x3 = b3 −
(b3 − a3 ) f (b3 ) (1.5 − 1.40342) f (1.5) = 1 .5 − = 1.403561 f (b3 ) − f (a3 ) f (1.5) − f (1.40342)
⇒
f ( x3 ) = f (1.403561) = 1.4035616 − 1.4035614 − 1.4035613 − 1 = −0.000646
⇒
r ∈ I 4 = [ a4 , b4 ] = [1.403561,1.5]
Approximation 4: x4 ~ r x4 = b4 −
(b4 − a4 ) f (b4 ) (1.5 − 1.403561) f (1.5) = 1 .5 − = 1.403593 f (b4 ) − f (a4 ) f (1.5) − f (1.403561)
⇒
f ( x4 ) = f (1.403593) = 1.403593 − 1.4035934 − 1.4035933 − 1 = −0.000143
⇒
r ∈ I 5 = [ a5 , b5 ] = [1.403593,1.5]
Since in the consecutive approximations x3 and x4 the four digits after the decimal point do not change, we assign the approximation x = 1.4035 ~ r correct to the four decimal places.
Problem 5.5 Find an approximate root of x log10 x − 1.1 = 0 by regula falsi method correct to the four decimal places.
Solution. Let f ( x) = x log10 x − 1.1 Then
f (1) = 1log10 1 − 1.1 = 0 − 1.1 = −1.1 < 0 81
f ( 2) = 2 log10 2 − 1.1 = 0.6021 − 1.1 = −0.49794 < 0 f (3) = 3 log10 3 − 1.1 = 0.331364 > 0 ⇒
The root r ∈ I1 = [a1 , b1 ] = [ 2, 3]
Approximation 1: x1 ~ r x1 = b1 −
(b1 − a1 ) f (b1 ) (3 − 2) f (3) = 3− = 2.600431 f (b1 ) − f (a1 ) f (3) − f (2)
⇒
f ( x1 ) = f (2.600431) = (2.600431) log10 2.600431 − 1.1 = −0.020703
⇒
r ∈ I 2 = [ a2 , b2 ] = [2.600431, 3]
Approximation 2: x2 ~ r x2 = b2 − ⇒
(b2 − a2 ) f (b2 ) (3 − 2.600431) f (3) = 3− = 2.623927 f (b2 ) − f (a2 ) f (3) − f (2.600431)
f ( x2 ) = f (2.623927) = (2.623927) log 210 2.623927 − 1.1 = −0.000701
⇒
r ∈ I 3 = [a3 , b3 ] = [2.623927, 3]
Approximation 3: x3 ~ r x3 = b3 −
(b3 − a3 ) f (b3 ) (3 − 2.623927) f (3) = 3− = 2.624721 f (b3 ) − f (a3 ) f (3) − f (2.623927)
⇒
f ( x3 ) = f (2.624721) = (2.624721) log10 2.624721 − 1.1 = −0.000024
⇒
r ∈ I 4 = [ a4 , b4 ] = [2.624721, 3]
Approximation 4: x4 ~ r x4 = b4 −
(b4 − a4 ) f (b4 ) (3 − 2.624721) f (3) = 2.624748 = 3− f (b4 ) − f (a4 ) f (3) − f (2.624721)
Since in the consecutive approximations x3 and x4 , the four digits after the decimal point do not change, we assign the approximation x = 2.6247 ~ r correct to the four decimal places.
Problem 5.6 By using the method of false position, find an approximate root of the equation x sin x = 1, that lies between x = 1 and x = 1.5 (measured in radians).
Solution. Given equation is 82
x sin x = 1 i.e. x sin x − 1 = 0 f ( x) = x sin x − 1
Denote ⇒
f (1) = 1sin 1 − 1 = −0.158529 < 0
and
f (1.5) = 1.5 sin(1.5) − 1 = 0.496242 > 0
⇒
The root r lies between 1 and 1.5 i.e. r ∈ I1 = [ a1 , b1 ] = [1,1.5]
Approximation 1: x1 ~ r x1 = b1 −
⇒
(b1 − a1 ) f (b1 ) (1.5 − 1) f (1.5) = 1 .5 − = 1.121057 f (b1 ) − f ( a1 ) f (1.5) − f (1)
⇒
f ( x1 ) = (1.121057) sin(1.121057) − 1 = 0.00958 > 0
⇒
r ∈ I 2 = [a2 , b2 ] = [1, x1 ] = [1,1.121057]
Approximation 2: x2 ~ r ⇒
x2 = b2 −
(b2 − a2 ) f (b2 ) (1.121057 − 1) f (1.121057) = 1.121057 − = 1.114158 f (b2 ) − f (a2 ) f (1.121057) − f (1)
Here the left hand end point of the interval [a, b] = [1, bn ] is fixed. ⇒
f ( x2 ) = f (1.114158) = (1.114158) sin(1.114158) − 1 = 0.0000012 > 0
⇒
r ∈ I 3 = [a3 , b3 ] = [1, x2 ] = [1,1.114158]
Approximation 3: x3 ~ r ⇒
x3 = b3 −
(b3 − a3 ) f (b3 ) (1.114158 − 1) f (1.114158) = 1.114158 − = 1.114157 f (b3 ) − f ( a3 ) f (1.114158) − f (1)
Noting x2 and x3 , correct to the five places of decimal points, r ~ x = 1.11415.
MCQ 5.1 The equation f ( x) = 0 has the exact root r ∈ [a, b]. Using the method of false position, the first approximation x1 ~ r ∈ I1 = [a1 , b1 ] = [ a1 , b], a ≠ a1. Also
I n −1 = [an −1 , bn −1 ]
Choose the true statement/s from the following
83
(A) a1 < an −1 , ∀ n ≥ 2 (B) b < bn −1 , ∀ n ≥ 2 (C) b = bn −1 , ∀ n ≥ 2 (D) a1 > an −1 , ∀ n ≥ 2
SAQ 5.1 Solve for a positive root of x 3 − x − 1 = 0 by regula falsi method.
SAQ 5.2 Solve the equation x tan x + 1 = 0 by the method of false position correct to three decimal places.
SAQ 5.3 Solve for a positive root of x 2 − ln x − 12 = 0 by the false position method.
84
SUMMARY The method entitled regula falsi or false position is explained. Its algorithm is established. It is shown that the said method is superior to the method of bisection.
KEY WORDS False position Regula falsi Algorithm Convergence
85
UNIT 02-01: THE SECANT OR THE CHORD METHOD
87-97
LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain a secant method Apply it to obtain the solution of nonlinear equations
INTRODUCTION The numerical methods studied so far start with two estimates a and b of the exact root r of the equation f ( x) = 0 with the help of the intermediate property f ( a) f (b) < 0 so that r lies in the
interval (a, b). At each state of successive approximations or estimates the root is bracketed by two numbers an and bn i.e. r ∈ (an , bn ), ∀ n = 1, 2,L . Because of this arrangement, convergence
of the sequence of estimates to r is assured. In this unit we study a different type of method which again starts with two estimates but does not use the intermediate property. This method is known as a secant or chord method. Since the root r is not bracketed, some times the convergence of the estimates is not attained. However the method has its own merit. The rule or the algorithm of the secant method is same as that of regula falsi method.
1.1 Algorithm for the secant method Let the given equation be f ( x) = 0. The graph of f ( x) is shown in Fig 1.1. Choose the initial estimates of the exact root as x = x1 and x = x2 . Thus A( x1 , f ( x1 )) and B( x2 , f ( x2 )) lie on the graph of y = f ( x). Then the equation of the secant passing through the points A and B is
y
D
y = f ( x)
C
E
Fig 1.1
x3
F
x2
x1 x
x4 B A
87
f ( x1 ) − f ( x2 ) ( x − x2 ) x1 − x2
y − f ( x2 ) =
(1.1)
The secant meets the x -axis at the point C ( x3 , 0). Then (1.1) gives 0 − f ( x2 ) =
⇒
⇒
f ( x1 ) − f ( x2 ) ( x3 − x2 ) x1 − x2
x3 − x2 =
− ( x1 − x2 ) f ( x2 ) f ( x1 ) − f ( x2 )
x3 = x2 −
( x2 − x1 ) f ( x2 ) f ( x2 ) − f ( x1 )
(1.2)
The rule (1.2) gives the first iteration specifying the next estimate x3 . Now we have three estimates: x1 , x2 and x3 . For the second iteration we choose x2 and x3 as initial estimates. Let D be the point, with x - coordinate x3 , on the curve. Join the points B and D of the graph. The secant BD intersects the x - axis at the point E ( x4 , 0). The value x = x4 is the next estimate of the root and is given by an analogous rule in (1.2): x4 = x3 −
( x3 − x2 ) f ( x3 ) f ( x3 ) − f ( x2 )
Continuing the process the successive iterations result into a sequence < xn > of estimates and the algorithm to that effect can be written by generalizing (1.2) etc in the form x n + 2 = x n +1 −
( xn +1 − xn ) f ( xn +1 ) , n = 1, 2,L f ( x n +1 ) − f ( x n )
(1.3)
The above algorithm is same as that of the method of false position. However, the secant method differs in choosing the initial estimates. The initial estimates x1 and x2 do not bracket the exact root r of the equation f ( x) = 0 i.e. r ∉ [ x2 , x1 ] where as in the method of false position the initial two estimates do bracket the root. Due to non-bracketing the root r , the sequence < xn > sometimes may not converge to r. In the method of false position the convergence is assured.
1.2 Convergence of secant method Let r be the exact root of the equation f ( x) = 0. Then f (r ) = 0
(1.4)
If En is the error associated with the estimate xn , then En = r − xn
88
(1.5)
We know that if there is k ≥ 1 such that | En +1 | ≤ A | En |k , for each n = 1, 2,L
(1.6)
for some positive constant A, then k is called the order or the rate of convergence of the iterative method. Now we discuss the convergence rate i.e. the value of k for the secant method. Rewriting the algorithm (1.3) for the secant method, xn +1 = xn −
( xn − xn −1 ) f ( xn ) f ( xn ) − f ( xn −1 )
(1.7)
By definition of error, we write En +1 = r − xn +1 , En = r − xn and En −1 = r − xn −1
⇒
xn +1 = r − En +1 , xn = r − En and xn −1 = r − En −1
Substituting these values in (1.7), we get r − En+1 = r − En −
En +1 = En −
⇒
(r − En − r + En−1 ) f (r − En ) [ f (r − En ) − f (r − En−1 )]
( En − En −1 ) f (r − En ) [ f (r − En ) − f (r − En −1 )]
(1.8)
Writing the Taylor’s expansion for f (r − En ) and f (r − En −1 ) about r , we have
f ( r − En ) = f (r ) − En f ′(r ) + f ( r − En −1 ) = f ( r ) − En −1 f ′(r ) +
and
1 2 En f ′′( r ) + L 2 1 2 En −1 f ′′(r ) + L 2
Since the errors are so small that the higher order terms in errors are ignored. With the above expressions, (1.8) takes the form
En +1 = En −
2 ( En − En −1 ) [ f (r ) − En f ′(r ) + (1 / 2) En f ′′(r )] 2 2 [ f (r ) − En f ′( r ) + (1 / 2) En f ′′(r )] − [ f (r ) − En −1 f ′(r ) + (1 / 2) En −1 f ′′(r )]
= En −
2 ( En − En −1 ) [ f (r ) − En f ′(r ) + (1 / 2) En f ′′(r )] 2 2 − ( En − En −1 ) f ′(r ) + (1 / 2)( En − En −1 ) f ′′(r )
= En −
[− En f ′(r ) + (1 / 2) En f ′′(r )] , by (1.4) and diving by ( En − En −1 ) − f ′(r ) + (1 / 2)( En + En −1 ) f ′′( r )]
2
89
= En −
2 f ′(r )[ En − (1 / 2) En f ′′(r ) / f ′( r )] f ′(r )[1 − (1 / 2)( En + En −1 ) f ′′(r ) / f ′(r )]
1 2 f ′′(r ) 1 f ′′(r ) 1 − ( En + En −1 ) = En − En − En 2 f ′(r ) 2 f ′(r )
−1
f ′′(r ) 1 2 f ′′(r ) 1 1 + ( En + En −1 ) , by binomial expansion = En − En − En ′ f ( r ) 2 f ′(r ) 2
=−
f ′′(r ) En En −1 + higher order terms in error to be ignored 2 f ′(r )
= C1 En En −1 , C1 = −
f ′′( r ) = constant 2 f ′(r )
(1.9)
Let the order or rate of the convergence be k . Then by definition, we have (1.6). | En | = C2 | En −1 |1 / k , C2 =
⇒
1 = constant A1 / k
With this value in (1.9), we obtain | En +1 | = | C1 C2 | | En −1 |1+ (1 / k ) = K | En −1 |1+ (1 / k ) , K = positive constant Since the order of convergence is k , by definition, above gives 1+
1 = k i.e. k 2 − k − 1 = 0 k k=
⇒
1 (1 ± 5 ) 2
Since k > 0, we choose k=
1 (1 + 5 ) = 1.168 2
Hence the rate of convergence of the secant method is 1.168. Working procedure of the method
(a) Initially x1 and x2 are given. From the equation f ( x) = 0 compute f ( x1 ) and f ( x2 ). (b) For the first iteration, take estimate x3 and by formula (1.3 ) write x3 = x2 −
90
( x2 − x1 ) f ( x2 ) f ( x2 ) − f ( x1 )
to determine x3 . Now we have three approximations or estimates x1 , x2 and x3 . Find f ( x3 ). (c) For the second iteration, choose initial estimates x2 and x3 . Find x4 from (1.3): x4 = x3 −
( x3 − x2 ) f ( x3 ) f ( x3 ) − f ( x2 )
Now the estimates are x2 , x3 and x4 . Calculate f ( x4 ). (d) For the third iteration, choose initial estimates x3 and x4 . Write x5 from (1.3): x5 = x4 −
( x4 − x3 ) f ( x4 ) . f ( x4 ) − f ( x3 )
(e) Continue the process of getting x6 , x7 ,L and terminate the iterations when the successive iterations produce no change after the given number of decimal places. Problem 1.1
Use the secant method to estimate the root of the equation e − x − x = 0 having given the initial estimates x1 = 0 and x2 = 1. Carry out four iterations. Solution. Let f ( x) = e − x − x = 0. Iteration 1
x1 = 0 ⇒
f ( x1 ) = f (0) = 1
x2 = 1 ⇒
f ( x2 ) = f (1) = e −1 − 1 = − 0.632121
Using the formula (1.3) of the method, we compute x3 : x3 = x2 −
=1−
( x2 − x1 ) f ( x2 ) f ( x2 ) − f ( x1 )
(1 − 0) (−0.632121) − 0.632121 − 1
= 0.612699 ⇒
f ( x3 ) = f (0.612699) = e −0.612699 − 0.612699 = − 0.070813
Iteration 2
Initial estimates are x2 = 1 and x3 = 0.612699 91
x4 = x3 −
Now
( x3 − x2 ) f ( x3 ) f ( x3 ) − f ( x2 )
= 0.612699 −
(0.612699 − 1)(− 0.70813) − 0.070813 + 0.632121
= 0.563838
f ( x4 ) = f (0.563838) = e −0.563838 − (0.563838) = 0.005183
⇒ Iteration 3
Initial iterations are x3 = 0.612699 and x4 = 0.563838. We have x5 = x4 −
( x4 − x3 ) f ( x4 ) f ( x4 ) − f ( x3 )
= 0.563838 −
(0.563838 − 0.612699)(0.005183) 0.005183 + 0.070813
= 0.56717
f ( x5 ) = f (0.56717) = e −0.56717 − 0.56717 = − 0.000042
⇒ Iteration 4
Initial estimates are x4 = 0.563838 and x5 = 0.56717. The next guess is written from (1.3): x6 = x5 −
( x5 − x4 ) f ( x5 ) f ( x5 ) − f ( x4 )
= 0.56712 −
(0.56717 − 0.563838)(− 0.000042) − 0.000042 − 0.005183
= 0.567093
Thus the required estimate is x = 0.567093. Problem 1.2
Find the root of x log10 x − 1.1 = 0 by the secant method in four iterations. The initial estimates are x1 = 2 and x2 = 3. Compare with the regula falsi method. Solution. Let f ( x) = x log10 x − 1.1 = 0. Iteration 1
x1 = 2 ⇒ f ( x1 ) = f (2) = 2 log10 2 − 1.1 = − 0.49794 92
x2 = 3 ⇒
f ( x2 ) = f (3) = 3 log10 3 − 1.1 = 0.331364
Using the formula (1.3), we have the next estimate x3 = x2 −
= 3−
( x2 − x1 ) f ( x2 ) f ( x2 ) − f ( x1 )
(3 − 2) (0.331364) 0.331364 + 0.49794
= 2.600431 ⇒
f ( x3 ) = f (2.600431) = 2.600431log10 ( 2.600431) − 1.1 = − 0.020703
Iteration 2
Initial estimates are x2 = 3 and x3 = 2.600431 x4 = x3 −
Now
( x3 − x2 ) f ( x3 ) f ( x3 ) − f ( x2 )
= 2.600431 −
( 2.600431 − 3)(− 0.020703) − 0.020703 − 0.331364
= 2.623927 ⇒
f ( x4 ) = f (2.623927) = 2.623927 log10 (2.623927) − 1.1 = −0.000701
Iteration 3
Initial iterations are x3 = 2.600431 and x4 = 2.623927. The next guess is x5 = x4 −
( x4 − x3 ) f ( x4 ) f ( x4 ) − f ( x3 )
= 2.623927 −
(2.623927 − 2.600431)(−0.000701) − 0.000701 + 0.020703
= 2.62475 ⇒
f ( x5 ) = f (2.62475) = 2.62475 log10 (2.62475) − 1.1 = 0.000001
Iteration 4
Initial estimates are x4 = 2.623927 and x5 = 2.62475. 93
x6 = x5 −
Then
( x5 − x4 ) f ( x5 ) f ( x5 ) − f ( x4 )
= 2.62475 −
(2.62475 − 2.623927)( 0.000001) 0.000001 + 0.000701
= 2.624749
Thus the required estimate is x = 2.624749. Comparison with the method of false position. This problem is solved by the method of false position (see Problem 5.5 on page 79). The initial estimates and the algorithm of these two methods are same. The iterations 1 and 2 are same but the iterations 3 and 4 differ. Problem 1.3
Find the positive root of x 3 − x − 2 = 0 by the secant method in five iterations. The initial estimates are x1 = 1, x2 = 2. Solution. Let f ( x) = x 3 − x − 2 = 0. Iteration 1
x1 = 1 ⇒
f ( x1 ) = f (1) = 1 − 1 − 2 = −2
x2 = 2 ⇒
f ( x 2 ) = f ( 2) = 8 − 2 − 2 = 4
Using the formula (1.3),
x3 = x2 −
= 2−
( x2 − x1 ) f ( x2 ) f ( x2 ) − f ( x1 )
(2 − 1) (4) 4+2
= 1.333333
f ( x3 ) = f (1.333333) = (1.333333)3 − 1.333333 − 2 = − 0.962964
⇒ Iteration 2
Initial estimates are x2 = 2 and x3 = 1.333333 Now
x4 = x3 −
( x3 − x2 ) f ( x3 ) f ( x3 ) − f ( x2 )
= 1.333333 −
94
(1.333333 − 2)(− 0.962964) = 1.462686 − 0.962964 − 4
⇒
f ( x4 ) = f (1.462686) = 1.4626863 − 1.462686 − 2 = −0.333342
Iteration 3
Initial iterations are x3 = 1.333333 and x4 = 1.462686. The next estimate is x5 = x4 −
( x4 − x3 ) f ( x4 ) f ( x4 ) − f ( x3 )
= 1.462686 −
(1.462686 − 1.333333)(−0.333342) − 0.333342 + 0.962964
= 1.53117 ⇒
f ( x5 ) = f (1.53117) = 1.53117 3 − 1.53117 − 2 = 0.05863
Iteration 4
Initial estimates are x4 = 1.462686 and x5 = 1.53117. We have x6 = x5 −
( x5 − x4 ) f ( x5 ) f ( x5 ) − f ( x4 )
= 1.53117 −
(1.53117 − 1.462686)( 0.05863) 0.05863 + 0.333342
= 1.520926 ⇒
f ( x6 ) = 1.5209263 − 1.520926 − 2 = − 0.002696
Iteration 5
Initial estimates are x5 = 1.53117 and x6 = 1.520926. We write x7 = x6 −
( x6 − x5 ) f ( x6 ) f ( x6 ) − f ( x5 )
= 1.520926 −
(1.520926 − 1.53117)(− 0.002696) − 0.002696 − 0.05863
= 1.521374
Thus the required estimate is x = 1.521374. Remark. Refer to Problem 5.1 on page 71 by the method of false position. MCQ 1.1
The successive estimates x3 , x4 , x5 , x6 of the secant method are applied to solve the equation 95
x 3 − 5 x + 1 = 0 with the initial guess x1 = 0 and x2 = 1. Then (A) x6 < x5 < x4 < x3 (B) x6 < x5 < x3 < x4 (C) x4 < x6 < x5 < x3 (D) x4 < x5 < x6 < x3 MCQ 1.2
Let k be the order of convergence of the secant method and let m, n be positive real numbers such that n > m. If A is a positive constant and | En | = A | Em |α , then (A) α = n − m (B) α > n − m (C) α < n − m (D) α = n + m SAQ 1.1
Choosing the initial estimates x1 = 0 and x2 = 1, solve the equation x e x − cos x = 0 correct to four decimal places by the secant method. SAQ 1.2
Using the secant method find the real root of the equation 3 x − 1 = cos x correct to three decimal places. Given the initial estimates x1 = 0 and x2 = 0.5. SAQ 1.3
Use four iterations of the secant method with the initial estimates x1 = 1 and x2 = 3 to determine the first positive root of the equation sin x + cos(1 + x 2 ) = 1.
96
SUMMARY
The secant or the chord method is explained by deducing its algorithm. The difference between the secant and the false position methods is highlighted.
KEY WORDS
Secant Chord Algorithm Convergence
97
UNIT 02-02: THE NEWTON – RAPHSON METHOD
99-114
LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain a Newton-Raphson method Apply it to obtain the solution of nonlinear equations
INTRODUCTION The Newton-Raphson method is considered to be one of the fastest methods to get the best estimate of the root of a nonlinear equation. The method is also called Newton’s method of tangents. The method starts with one initial approximation x0 . The choice of x0 is crucial to the
method to achieve convergence of a sequence of estimate roots to the exact root of the equation. The wrong choice of x0 may lead to divergence. This is one of the demerits of the method. The algorithm and the other convergence details are explained in this unit.
2.1 Method and its algorithm Let r be the exact root of the nonlinear equation f ( x) = 0. Then f (r ) = 0
(2.1)
It is assumed that the function f (x) is differentiable. Theorem 2.1 (Algorithm of the method) The rule of the Newton-Raphson method to obtain the successive iterations to approximate r by a sequence < xn > is
xn = xn −1 −
f ( xn −1 ) , n =1, 2,L f ′( xn −1 )
(2.2a)
where each f ′( xn−1 ) ≠ 0. Proof. Let x0 be the initial guess to r. Suppose that h is the correction to x0 such that
r = x0 + h.
The number h can be positive or negative. Noting above the equation (2.1) becomes f ( x0 + h) = 0 99
We write the Taylor’s expansion of the function f ( x0 + h) about x0 : f ( x0 ) + h f ′( x0 ) +
1 2 h n ( n) h f ′′( x0 ) + L + f ( x0 ) + L = 0 2 n!
Since the correction h is small, its higher powers can be ignored and then keeping the first two terms in the above, we write f ( x0 ) + h f ′( x0 ) = 0 ⇒
h=−
f ( x0 ) , f ′( x0 ) ≠ 0 f ′( x0 )
Knowing the correction, the next approximation to x0 can be written as x1 = x0 + h = x0 −
f ( x0 ) f ′( x0 )
Continuing the process, the successive approximations are x2 = x1 −
f ( x1 ) , f ′( x1 ) ≠ 0 f ′( x1 )
x3 = x2 −
f ( x2 ) , f ′( x2 ) ≠ 0 f ′( x2 )
M
xn = xn −1 −
f ( xn −1 ) , f ′( xn −1 ) ≠ 0 f ′( xn −1 )
and so on. Taking n =1, 2,L, above equation (2.2a) becomes the rule to compute the estimates x1 , x2 ,L, xn ,L to r and thus we get algorithm in the form (2.2a).
QED
Remark
(i) As pointed out in the beginning, the initial choice of x0 is important to save the convergence of the estimates xn to r. (ii) The formula (2.2a) can also be written in the form xn +1 = xn − where each f ′( xn ) ≠ 0.
100
f ( xn ) , n = 0, 1, 2,L f ′( xn )
(2.2b)
Geometrical interpretation of the rule (2.2) Consider the approximations xn −1 and xn to the exact root r of the equation f ( x) = 0. Draw the graph of the function f (x) and let xn −1 be the x - coordinate of a point A of the graph. Assume that the tangent to the graph at A intersects the x - axis at the point B ( xn , 0). The xn becomes the x - coordinate of the point C on the graph as shown in Fig 2.1 (a,b). y = f (x) y
y = f (x)
A( xn −1 , f ( xn −1 ) )
y
A( xn −1 , f ( xn −1 ) )
C
C
Fig 2.1 θ
O
D
B
θ
x
O
D
(a)
B
x
(b)
Since AB is tangent at A, we have
tan θ = f ′( A) =
DA BD
(2.3)
For Fig 2.1(a), we have f ′( xn−1 ) =
⇒
f ( xn−1 ) DA = , Q xn−1 = x - coordinate of A etc OD − OB xn−1 − xn xn −1 − xn =
tan (π − ∠DBA) = f ′( A)
For Fig 2.1(b), (2.3) ⇒ ⇒
f ( xn −1 ) f ( xn −1 ) or xn = xn −1 − f ′( xn −1 ) f ′( xn −1 )
− tan ∠DBA = f ′( A) = f ′( xn −1 )
⇒
⇒
⇒
−
−
DA = f ′( xn −1 ) DB
f ( xn −1 ) − f ( xn −1 ) = f ′( xn −1 ) OB − OD −
f ( xn −1 ) = f ′( xn −1 ) xn − xn −1 101
xn = xn −1 −
i.e.
f ( xn −1 ) f ′( xn −1 )
This follows the interpretation of the rule in (2.2). Moreover, the rule (2.2) is deduced from the tangents drawn to the graph of f (x) at the points whose x - coordinates are the approximations to the root r. The basic concept involved is that the arc length AC is approximates by the length AB of the tangent.
Theorem 2.2 (Condition of convergence) Let r be the exact root of the equation f ( x) = 0. The sequence < xn > of approximations converge to r if | f ( x) f ′′( x) | < | f ′( x) |2
(2.4)
Proof. The rule (2.2) of the Newton-Raphson method can be written as
Taking
xn +1 = xn −
f ( xn ) f ′( xn )
g ( xn ) = xn −
f ( xn ) f ′( xn )
where xn is the n th approximation of r. It takes the iteration form x n +! = g ( x n )
g ( x) = x −
⇒
f ( x) f ′( x)
(2.5)
where x is the estimation of r. The condition of convergence of the sequence of approximations is | g ′( x) | < 1, by (3.3) on page 39 Using (2.5), above gives 1−
f f ′′ 0 and f (0.4) = − 0.641592 653 < 0 0.3
The exact value π −1 = r ∈ [0.3, 0.4].
Since | f (0.3) | < | f (0.4) |, the root r lies nearer to 0.3, we choose the initial estimate x0 = 0.3. The formula (2.2b) for the method becomes
xn +1 = xn −
⇒
(1 / xn ) − π = xn (2 − π xn ), n = 0,1, 2,L 2 − 1 / xn
x1 = x0 ( 2 − π x0 ) = 0.3 (2 − 0.3 π) = 0.317 256 661 x2 = x1 (2 − π x1 ) = 0.318 306 401 x3 = x2 (2 − π x2 ) = 0.318 309 886 x4 = 0.318 309 886
⇒
π −1 ~ 0.318 309 886 correct to nine decimal places
Problem 2.6
Show that the Newton-Raphson iteration for determining a square root of A has the form
A 1 xn +1 = xn + . xn 2 Hence or otherwise find Solution. Let
110
3 correct to 12 decimal places.
A = x i.e. x 2 − A = 0. Denote
(a1)
f ( x) = x 2 − A
(a2)
f ′( x) = 2 x
(a3)
⇒
The Newton-Raphson iteration formula (2.2b) gives
xn +1 = xn −
= xn −
2
f ( xn ) x −A = xn − n , by (a1) and (a2) f ′( xn ) 2 xn 1 A xn + 2 2 xn
1 A = xn + 2 xn This completes the first part. Let us use this result to find
3. Let A = 3. Then
f ( x) = x 2 − 3 f (1) = 1 − 3 = −2 < 0 and f (2) = 4 − 3 = 1 > 0
⇒ ⇒
3 ∈[1, 2]
Since | f (2) | < | f (1) |, the root
3 lies nearer to 2. We choose the initial estimate of
3 as
x0 = 1.7. The iteration formula of the method can be derived in the form: 1 3 xn +1 = xn + , n = 0,1, 2,L xn 2 ⇒
1 3 1 3 x1 = x0 + = 1.7 + = 1.732 3523 941176 2 1.7 x0 2 1 3 x2 = x1 + = 1.732 050 833 916 x1 2 1 3 x3 = x2 + = 1.732 050 807 5689 x2 2 x4 =
⇒
1 3 x3 + = 1.732 050 807 5689 x3 2
3 ~ 1.732 050 808 correct to 9 decimal places
111
Problem 2.7
Show that the Newton-Raphson iteration to determine a k th root of A is x n +1 =
1 A (k − 1) xn + k −1 , n = 0,1, 2,L k xn
(a1)
Hence apply the formula to find a cube root of 5 correct to six decimal places. Solution. Let the k th root of A be x i.e.
k
A = x.
⇒
xk = A
Let
f ( x) = x k − A
(a2)
⇒
f ′( x) = k x k −1
(a3)
The iteration formula is xn +1 = xn −
xn +1 = xn −
⇒
= ⇒
f ( xn ) f ′( xn )
k
xn − A , by (a1) and (a2) k −1 k xn
1 A k xn − xn + k −1 k xn
(a1)
To find the cube root of 5, put A = 5 and k = 3. Then (a2) gives f ( x) = x 3 − 5 and f ′( x) = 3x 2
(a4)
f (1) = 1 − 5 = −4 < 0 and f ( 2) = 8 − 5 = 3 > 0
⇒ ⇒
r = 3 5 ∈ [1, 2]
Now
| f (2) | < | f (1) | ⇒ r is nearer to 2. Let x0 = 1.7. Taking A = 5 and k = 3 in the
iteration formula (a1), we get 1 5 xn +1 = 2 xn + 2 , n = 0,1, 2,L 3 xn ⇒
112
1 5 1 5 x1 = 2 x0 + 2 = 2(1.7) + 2 = 1.710 034 602 3 1.7 x0 3
x2 =
1 5 2 x1 + 2 = 1.709 975 949 3 x1
1 5 x3 = 2 x2 + 2 = 1.709 975 947 3 x2 1 5 x4 = 2 x3 + 2 = 1.709 975 947 3 x3 ⇒
r = 3 5 ~ 1.709 975 947
MCQ 2.3
The iteration formula of the method of Newton – Raphson is given by x n +1 = Then
xn (1 − ln xn ) . 1 + xn
(A) f ( x) = x + ln x (B) f ( x) = x − ln x (C) f ( x) = 1 + ln x (D) f ( x) = x + 2 ln x
SAQ 2.2
Use the iteration of the Newton-Raphson method to find e −1 correct to ten decimal places. SAQ 2.3
Determine the cube root of 27 by the iterative method of Newton-Raphson. SAQ 2.4
Use the iteration of the Newton-Raphson method to find
and
(a)
1 23
(b)
4
7.
113
SUMMARY The iterative method of Newton – Raphson is discussed to solve nonlinear equation f ( x) = 0. The formula governing iterations of the method is derived. The order of convergence of the method is shown to be quadratic.
KEY WORDS
Newton-Raphson method Iteration formula Order of convergence Quadratic convergence
114
UNIT 02-03: SYSTEM OF LINEAR ALGEBRAIC EQUATIONS
115-148
LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain a system of linear algebraic equations and its matrix formulation Apply the method of Gauss elimination to solve a linear system of equations
INTRODUCTION In the earlier pages of the book we have studied a single nonlinear equation f ( x) = 0 and its
solution. Now we deal with linear algebraic equations which form a system
f1 ( x1 , x2 ,L, xn ) = 0 f 2 ( x1 , x2 , L , xn ) = 0 M
f m ( x1 , x2 ,L, xn ) = 0 These are m - equations in n -unknowns x1 , x2 ,L, xn . Since the system is linear the functions
f1 , f 2 ,L, f m are linear. Then the above system assumes the general form a11 x1 + a12 x2 + L + a1n xn = b1 a21 x1 + a22 x2 + L + a2 n xn = b2
(3.1)
M
am1 x1 + am 2 x2 + L + amn xn = bm where the a' s and the b' s are constants.
Directly or indirectly systems of linear equations have concern with a large number of areas. Because of this fact there is considerable research to attempt to find their numerical solutions. In fact for smaller m = n ≤ 3, the system (3.1) is studied at high school level to get its solution. Our main objective in to study the system for m = n i.e. the number of equations is equal to the number of unknowns. Since the use of matrix algebra is inevitable in the study, the brief survey to that effect is appended as follows.
115
3.1 Matrix in brief Matrix is one of the powerful and elegant tools in mathematics to deal with various practical problems. Consider the rectangular orderly arrangement of numbers or functions. An array of this type may be given by the symbol a11 a A = 21 M am1
a12 a22 am 2
L a1n L a2 n . L amn
The quantities aij , i = 1, 2 ,L, m , j = 1, L, n are numbers or functions and are called elements or members of the array A. Such an array, subject to certain rules of operation, (addition,
multiplication etc) is called a matrix. The matrices are denoted by [ ] or ( ). The elements aij may be scalars or functions or whatever is meaningful in this context. The elements of A which are in a horizontal line constitute a row of the matrix A and those in a vertical line a column of the matrix. An element aij occurs at the intersection of the i th row and j th column.
Order of a matrix. A matrix A with m rows and n columns is called a matrix of order (m, n) or m × n matrix. For convenience and brevity we denote the matrix A = [aij ]m×n or [aij ]( m, n ) . It means that A is a matrix of elements aij and is of order m × n .
2 3 i 0 Illustration. A = 1 − 6 7 − 3 is a 3 × 4 matrix 5 11 9 0
0 1 0 B = 1 0 0 is a 3 × 3 matrix 2 − 5 6 1 2 C = is a 4 × 1 matrix − 2 0 D = [0 0 4 1 0] is a 1× 5 matrix E = [3] is a 1× 1 matrix
116
0 0 0 F= is a 2 × 3 matrix 0 0 0
Zero or null matrix. A zero matrix is a matrix whose all the elements are zero i.e. A = [aij ] is a zero matrix if aij = 0 ∀ i, j .
Illustration. [0 0 0 0],
0 0 0 0 0 0 0, 0 0 0 are zero matrices but 0 0 is not a zero 0 1 0 0 0 0 0
matrix since there is one non-zero aij i.e. a22 ≠ 0.
Square matrix. A matrix in which the number of rows is equal to the number of columns is a square matrix. Thus a square matrix is of the form n × n . We call it an n -square matrix or a square matrix of order n. For a square matrix the elements a11 , a22 , L, ann are called the diagonal elements and
their sum: n
a11 + a22 + L + ann = ∑ aii i =1
the trace of the matrix.
Illustration.
0 0 [3] is a 1-square matrix, is a 2 – square matrix 0 1
and
0 1 0 1 0 0 is a 3-square matrix. 2 − 5 6
Diagonal matrix. A square matrix whose all non-diagonal elements are zero is called a diagonal matrix. Thus A = [aij ] is diagonal if A is a square matrix and aij = 0 , i ≠ j . In such a
case we write A = diag [a11 , a22 , L , ann ] .
Illustration.
0 0 0 2 0 0 − 1 , 0 − 3 0 are diagonal matrices. 0 0 1 / 2
Unit or identity matrix. An n -square diagonal matrix whose all diagonal elements are 1 is called an identity matrix or a unit matrix. Thus A = [aij ] is a unit matrix if 117
aij = 0, i ≠ j and a11 = a22 = L = ann = 1.
An identity matrix is denoted by I n or simply by I . 1 0 0 1 0 Illustration. I1 = [1], I 2 = , I 3 = 0 1 0 are identity matrices. 0 1 0 0 1
Row matrix. A matrix which has one row is a row matrix. Illustration. [ x] , [1 2 0] , [0 x y z 2 − 1] are row matrices.
Column matrix. A matrix which has one column is a column matrix. 2 1 Illustration. [ x] , , 4 are column matrices. 0 − 9
Triangular matrices Upper triangular matrix. A square matrix A = [aij ] is called an upper triangular matrix if all
the elements below the diagonal are zero i.e. aij = 0 for i > j. Lower triangular matrix. A square matrix A is a lower triangular matrix if all the elements
above the diagonal are zero i.e. aij = 0 for i < j .
6 1 0 0 0 Illustration. A = 4 2 0 is lower triangular and B = 0 −1 7 3 0
−1 0 1 7 3 5 is upper triangular. 0 −1 3 0 0 4
Tridiagonal matrix. A matrix A = [aij ] is tridiagonal if
aij = 0 for | i − j | > 1. This gives the
form a11 a12 a 21 a22 0 a32 A= M M 0 0 0 0
118
0 a23 a33 M 0 0
0 0 a34 M
L L L M
an −1, n − 2 0
an −1, n −1 an , n −1
an −1, n ann
0 0 0 M
The transpose of a matrix. The matrix of order m × n obtained by interchanging the rows and columns of an n × m matrix A is called the transpose of A and is denoted by A′ or At . Hence if A = [aij ]m×n , A′ = [a′ji ]n×m , where aij′ = a ji . Note that A′′ = ( A′)′ = A .
The transpose of an identity matrix is itself the identity matrix. 2 6 1 0 2 0 − 3 1 0 Illustration. A = 0 1 . Then A′ = , I = , I′ = = I. 6 1 7 0 1 0 1 − 3 7
Scalar multiplication Let k be any scalar and A = [aij ] be any m × n matrix. We call kA as multiplying a matrix A by a scalar k and is defined as kA = [k aij ] .
Hence to obtain kA just multiply every element of A by k . 2 − 3 6 − 9 Illustration. A = . Then 3 A = . − 1 4 − 3 12 Remark
(i) We do not distinguish between kA and A k . (ii) We write − A = (−1) A i.e. the negative of an m × n matrix A = [aij ] is defined to be − A = [−aij ] . Thus the negative of A is obtained by changing the sign of every element of A.
Then A + (− B) = A − B. −i i 3 2 − 3 − 2 Illustration. A = ⇒ −A= . 3 4 i 1 + 2 i − 3 − 4 i − 1 − 2i
Multiplication of matrices Let A = [aij ] be an m × p matrix and let B = [bij ] be an p × n matrix. The product AB is the m × n matrix C = [cij ] defined by p
cij = ∑ aik bkj = ai1 b1 j + ai 2 b2 j + L + aip b pj k =1
119
The cij is the result of multiplication of the corresponding elements of the i th row of A and of the j th column of B : i th row of A = [ai1 ai 2 ai 3 L aip ] b1 j b 2j j th column of B = . M b pj ai1 their product: b
ai 2 b
L aip b .
b1 j
b2 j
L b pj
When the product AB is defined, we say that A is conformable to B for multiplication. Note that AB does not necessarily define BA. Thus A is conformable to B for multiplication does not necessarily imply that B is conformable to A for multiplication. The conformability is guaranteed both ways only in case of square matrices of the same order. Illustration
0 (i) A = [3, 2, − 1] , B = − 1 . A is 1 × 3 , B is 3 × 1 . Then AB is a 1×1 matrix. Here BA is also 3
defined. ⇒
AB = [3 ⋅ 0 + 2 ⋅ −1 + −1 ⋅ 3] = [−5] .
0 0 0 0 ⋅ 3 0 ⋅ 2 0 ⋅ −1 0 BA = − 1 [3, 2, − 1] = − 1⋅ 3 − 1 ⋅ 2 − 1 ⋅ −1 = − 3 − 2 1 3 3 ⋅ 3 3 ⋅ 2 3 ⋅ −1 9 6 − 3 Thus BA is a 3 × 3 matrix. It is obvious that AB ≠ BA . 1 2 0 − 1 and B = (ii) For A = we have − 1 1 3 2 1 2 0 − 1 1 ⋅ 0 + 2 ⋅ 3 1 ⋅ −1 + 2 ⋅ 2 6 3 AB = ⋅ = = − 1 1 3 2 − 1 ⋅ 0 + 1 ⋅ 3 − 1 ⋅ −1 + 1 ⋅ 2 3 3 0 − 1 1 − 1 1 − 8 BA = ⋅ = ≠ AB . 3 2 − 1 8 1 13
120
If A, B, C are conformable for the indicated products, we have (i) AB ≠ BA in general (ii) AB = 0 does not necessarily imply A = 0 or B = 0 . (iii) AB = AC does not necessarily imply B = C even if A ≠ 0. (iv) A2 = I does not necessarily imply A = + I or A = − I . Illustration.
1 0 0 0 0 0 1 0 A= , B= , C= , D= 2 0 3 1 4 − 1 0 − 1 0 0 AB = i.e. AB = 0 but A ≠ 0 , B ≠ 0 0 0 0 0 AC = ⇒ AB = AC and A ≠ 0 . But B ≠ C 0 0 1 0 D2 = = I . But D ≠ I or D ≠ − I 0 1
Transpose of the product. If A and B be two m × n and n × p matrices respectively, then ( AB)′ = B′A′.
Orthogonal matrix. A square matrix A is orthogonal if A A′ = I . cos θ 0 sin θ Illustration. A = 0 1 0 . − sin θ 0 cos θ cos θ 0 sin θ Here A A′ = 0 1 0 − sin θ 0 cos θ
cos θ 0 − sin θ 0 1 0 sin θ 0 cos θ
cos 2 θ + 0 + sin 2 θ 0 − cos θ sin θ + sin θ cos θ 0 1 0 = 2 2 − sin θ cos θ + cos θ sin θ 0 sin cos θ + θ 1 0 0 = 0 1 0 0 0 1 =I
Hence the matrix A is orthogonal. 121
The determinant of a square matrix Associated with every n-square matrix A = [aij ] , there is a scalar called its determinant denoted by det A or | A | and we write
det A = | A | =
a11
a12
L a1n L a2 n
a21 M
a22
an1
an 2 L ann
.
1 2 1 2 Illustration. A = . Then | A | = = 1 ⋅ 3 − (2)(−2) = 7 . −2 3 − 2 3
Singular matrix. A square matrix A is said to be singular if | A | = 0. Non singular matrix. A square matrix A is said to be nonsingular if | A | ≠ 0. Illustration
1 2 0 1 2 0 (i) A = 2 4 0 , | A | = 2 4 0 = 2(4 − 4) = 0 . 7 − 6 2 7 −6 2 ⇒
A is singular
cos θ sin θ 2 2 (ii) A = , | A | = cos θ + sin θ = 1 ≠ 0 . − θ θ sin cos ⇒
A is nonsingular
To compute the value of the determinant for an n × n matrix, we first give some preliminaries as follows.
Minor. Associated with each element aij of the n × n matrix A = [aij ] is a minor, denoted by M ij . This minor is a number which is the value of the determinant of the submatrix formed by deleting the i th row and the j th column of the matrix A .
Cofactor. The cofactor associated with the element aij is defined by Aij = (−1) i + j M ij . Thus a cofactor is a signed minor.
122
Illustration
(i)
1 2 a11 A= = 3 4 a21
a12 a22
M 11 = a22 = 4, A11 = (−1)1+1 M 11 = 4; M 12 = a21 = 3, A12 = (−1)1+2 M12 = −3 M 21 = a12 = 2, A21 = (−1)1+ 2 M 21 = −2; M 22 = a11 = 1, A22 = (−1)2+2 M 22 = 1
(ii)
1 2 − 1 a11 A = 3 4 0 = a21 − 2 6 1 a31 M 11 = minor of 1 =
and
4 0 6 1
a12 a22 a32
a13 a23 a33
=4
A11 = (−1)1+1 M 11 = 4
Similarly M 12 =
M 21 =
M 23 =
M 32 =
3
0
−2 1 2 −1 6
= 8, A21 = −8; M 22 =
1 1
2
−2 6 1 −1 3
0
3
= 3, A12 = (−1)1+ 2 M12 = −3; M13 = 1
−1
−2
1
= 10, A23 = −10; M 31 =
= 3, A32 = −3; M 33 =
−2 6
1 2 3 4
0
= 26, A13 = 26
= −1, A22 = −1
2 −1 4
4
= 4, A31 = 4
= −2, A33 = −2
To compute the value of determinant With the help of cofactors, we can calculate the determinant of any n × n matrix A = [aij ] . For this select any row(column) and the associated cofactors of this row(column). Consider the row i or the column j . Then the rule is n
for the row i : | A | = ∑ aij Aij = ai1 Ai1 + ai 2 Ai 2 + L + ain Ain j =1
and
n
for the column j : | A | = ∑ aij Aij = a1 j A1 j + a2 j A2 j + L + anj Anj . i =1
The adjoint and inverse of a matrix Let A = [aij ] be an n -square matrix and Aij be the cofactor of aij . We define 123
A11 A Adjoint A = adj A = [ Aij ]′ = 12 M A1n
An1 L An 2 L Ann
A21 L A22 A2 n
Thus adj A is the transpose of the cofactor matrix.
1 2 − 1 Illustration. Consider A = 3 4 0 . − 2 6 1
We have
4 6 2 adj A = − 6 2 4
0 1 −1 1 −1 0
−
3
0
−2 1 1 −1 −2 1 1 −1 − 3 0
′ 4 ′ −2 6 4 − 3 26 1 2 − = − 8 − 1 − 10 −2 6 4 − 3 − 2 1 2 3 4 3
4 4 −8 = − 3 − 1 − 3 26 − 10 − 2 a b Remark. For a 2 × 2 matrix A = , we have c d d − b adj A = . − c a
The inverse of a matrix Let A and B be two square matrices such that AB = BA = I . Then B is called the inverse of A and is expressed as B = A−1. Similarly A is called the inverse of B and is written as A = B −1. Another definition. Let A be any non-singular matrix. Then
A −1 =
adj A | A|
cos θ sin θ cos θ − sin θ Illustration. (i) A = , B= − sin θ cos θ sin θ cos θ ⇒
124
− cos θ sin θ + sin θ cos θ 1 0 cos 2 θ + sin 2 θ AB = = =I sin 2 θ + cos 2 θ − sin θ cos θ + cos θ sin θ 0 1
1 0 BA = =I 0 1
Also ⇒
AB = BA = I
⇒
A −1 = B, B −1 = A
2 1 (ii) A = , | A | = 10 + 3 = 13 ≠ 0 . Hence A is non-singular and A−1 exists. − 3 5 5 − 1 adj A 1 5 − 1 adj A = and then A−1 = = . | A | 13 3 2 3 2
Now
Remark
(i) When A−1 exists, we say that A is invertible. Non-square matrices are not invertible. (ii) Every invertible matrix has a unique inverse. (iii) The necessary and sufficient condition for a square matrix A to possess an inverse is that A is non-singular. This means that a singular matrix does not possess an inverse i.e. the singular matrices are not invertible. Some authors opine that every non-square matrix is singular.
Inverse of a diagonal matrix Let A = [aij ] be n -square diagonal matrix with | A | ≠ 0 . Then its inverse exists and we write
A = diag [a11 , a22 , L, ann ] . Now | A | = a11 a22 L ann ≠ 0 aii ≠ 0 , ∀ i = 1, 2 ,L, n .
⇒
Then
A11 | A | 0 adj A A−1 = = | A| L 0
1 0 a 11 A22 L 0 0 = | A| L L L L Ann 0 0 0 | A | 0
L
0 1 a22 L 0
0 0 0 L L 1 L ann L
Illustration
3 0 0 1 / 3 0 0 −1 For A = 0 2 0 , A = 0 1 / 2 0 0 0 1 0 0 1 125
Inverse of the product of matrices Let A and B be two non-singular matrices of order n. The product AB is defined and also is non-singular. Then its inverse ( AB) −1 exists and we have ( AB)−1 = B−1 A−1.
Inverse of orthogonal matrices By definition, a square matrix A is orthogonal if A A′ = I . This means A′ = A−1 . ⇒
A is orthogonal ⇔ A−1 = A′
The rank of a matrix Let A be any non-zero m × n matrix. Any matrix obtained from A by deleting some rows and columns is called a sub matrix of A. The matrix A is itself a sub matrix of A. The determinant of a square sub matrix is called a minor of the matrix A. 1 2 − 1 Illustration. Consider A = . The sub matrices are 3 0 4 [1], [2], [−1], [3], [0], [4] [1 2], [1 − 1], [ 2, − 1], [3, 0], [3, 4], [0, 4], [1, 2 − 1], [3 0 4] 1 2 − 1 1 2 1 −1 2 − 1 1 2 − 1 3 , 0 , 4 , 3 0 , 3 4 , 0 4 , 3 0 4 . Out of these the square sub matrices are: 1-square matrices: [1], [2], [−1], [3], [0], [4] 1 2 1 − 1 2 − 1 2-square matrices: , , 3 0 3 4 0 4 The determinants of these matrices give the minors of A . They are 1-square minors or minors of order 1: 1, 2, –1, 3, 0, 4 2-square minors or minors of order 2: – 6, 7, 8.
Rank A non-zero matrix A is said to have rank r if at least one of its r -square minors is different from zero while every (r + 1) -square minor, if any, is zero. We denote rank of A by ρ( A) = r.
126
Illustration. In the above illustration, ρ( A) = 2 because there exists a 2-square minor of A
which is non-zero. As a matter of fact here all 2-square minors are non-zero. Since there is no (2+1) - square minor, the question of its consideration does not arise. Remark
(i) The rank of a zero matrix is 0. (ii) The rank of a n -square nonsingular matrix is n . Thus if the rank of a square matrix is equal to its order, the matrix is non-singular. (iii) The rank of I n is n . (iv) The rank of a m × n matrix ≤ min (m, n) . 4 − 2 6 (v) Consider A = 1 − 3 − 2 . Here | A | = 0 , each 2-square minor of A is zero. A is not a 3 − 9 − 6 zero matrix. Hence rank ρ( A) = 1. With this background material we proceed to discuss the main issue of the unit.
3.2 Representation of (3.1) in matrix form The role of matrix in studying the linear systems (3.1) is remarkable. The system (3.1) can be conveniently expressed in an equivalent matrix form
i.e.
Here
A = [aij ]m× n
Ax = B
(3.2a)
a11 a12 L a1n x1 b1 a 21 a22 L a2 n x2 = b2 M M M M M M am1 am 2 L amn xn bm
(3.2b)
a11 a12 L a1n a a22 L a2 n = 21 , x= M M M M am1 am 2 L amn
b1 x1 x 2 , B = b2 M M bm xn
(3.2c)
The matrix A is called the coefficient matrix. The matrix defined by a11 a12 L a1n a a22 L a2 n 21 [ A, B] = M M M M am1 am 2 L amn
b1 b2 M bm
is called the augmented matrix. 127
Homogeneous system If b1 = b2 = L = bm = 0, then the system (3.1) is said to be homogeneous. In this case the column matrix B is a zero column matrix and (3.2b) gets the form Ax = 0 where the right side is not the usual zero but the zero column matrix. A homogeneous system has a trivial solution i.e. x1 = x2 = L = xn = 0 or x = 0 = zero column matrix.
Non-homogeneous system If not all bi are zero, the system (3.1) or (3.2) is non-homogeneous.
Consistency of the non-homogeneous system The system of equations (3.1) is said to be consistent if it has one or more solutions. Otherwise it is said to be inconsistent. In terms of rank we say that system is consistent ⇔ ρ( A) = ρ([ A, B]) system is inconsistent ⇔ ρ( A) ≠ ρ([ A, B]) Remark. For a consistent system there exists at least one solution. Problem 3.1
Discuss the consistency of the following systems: (a) 2 x + 6 y = −11, 6 x + 20 y − 6 z = −3, 6 y − 18 z = −1 i 1 − i x − 1 0 (b) − i 0 i y = 0 1 − i − i 0 z 1 Solution. (a) The system of equation is given by
2 x + 6 y + 0 z = −11 6 x + 20 y − 6 z = −3 0 x + 6 y − 18 z = −1 The coefficient matrix A and the augmented matrix [ A, B ] are given by
128
0 0 − 11 2 6 2 6 A = 6 20 − 6 and [ A, B] = 6 20 − 6 − 3 0 6 − 18 0 6 − 18 − 1 Here there is a 2-minor
2
6
6 20
= 40 − 36 ≠ 0 of the matrix A. Also | A | = 2(−360 + 36) + 6(0 + 108) = 0
⇒
ρ( A) = 2
In case of [ A, B ], consider a 3 -minor 2 6 − 11 6 20 − 3 = 2(−20 + 198) + 6(0 + 6) − 11(396 − 0) ≠ 0 0 66 − 1 ⇒
ρ( [ A, B ] ) = 3 and thus ρ( A) ≠ ρ( [ A, B ]).
Hence the system in (a) is inconsistent. i 1 − i 0 A= −i 0 i 1 − i − i 0
(b) Here
and
i 1 − i − 1 0 [ A, B] = − i 0 i 0 1 − i − i 0 1 0
⇒
i 0
A= −i 1− i − i
1− i i 0
= 0 + i [i (1 − i )] + (1 − i )(i 2 ) = i 2 − i 3 + i 2 − i 3 = −2 + 2i, Qi 2 = 1 ≠0 ⇒
ρ( A) = 3
In case of the matrix [ A, B ], the | A | itself forms a 3-minor which is nonzero. Since there is no 4 - minor, ρ( [ A, B ]) = 3. ⇒
ρ( A) = ρ( [ A, B ])
Hence the system (b) is consistent.
129
Different cases of (3.1) or (3.2) Case (i): m > n i.e. the number of equations is more than the number of unknowns
In this case the solution may not exist and hence is of little interest. For example, consider a system of three equations in two unknowns: x1 + x2 = 3 2 x1 − x2 = 0 x1 − x2 = 2
and
The first two equations give x1 = 1, x2 = 2. Substituting these values in the last equation, we have 1− 2 = 2 This is absurd. Thus there are no values of x1 and x2 which satisfy these three equations simultaneously. Case (ii): m < n
In this case the system (3.1) has infinitely many solutions. For example, x1 + x2 = 3 We have one equations in two unknowns. This equation has infinitely many solutions: x1 = n, x2 = 3 − n, n ∈ R. Some of its solutions are x1 = 0, x2 = 3 ; x1 = 1, x2 = 2 ; x1 = −1, x2 = 4,L
Case (iii): m = n This case has special importance. Here if the matrix A is nonsingular i.e. | A | ≠ 0, then the system (3.1) has a unique solution.
Illustration. Consider the system of two equations in two unknowns: x1 + x2 = 3 2 x1 − x2 = 0 In matrix form we write 1 1 x1 3 2 − 1 x = 0 2
130
1 1 1 1 Here A = = − 1 − 2 = −3 ≠ 0. Hence the system has a unique and then | A | = 2 −1 2 − 1 solution. It is easy to note that x1 = 1 and x2 = 2 are the unique solutions of the given equations.
MCQ 3.1 Consider the statements: (a) m > n ⇒ always the system (3.1) has no solution. (b) m > n ⇒ sometimes the system (3.1) has no solution Choose the true statement from the following: (A) Only (a) is true. (B) Only (b) is true. (C) (a) has no unique truth value (D) (b) has no unique truth value.
3.3 Methods of solving (3.1) or (3.2) for m = n Since the system (3.1) for m = n has special significance, hereafter we consider the system of equations with n equations in n variables: a11 x1 + a12 x2 + L + a1n xn = b1 a21 x1 + a22 x2 + L + a2 n xn = b2
(3.3a)
M
an1 x1 + an 2 x2 + L + ann xn = bn a11 a12 L a1n x1 b1 a 21 a22 L a2 n x2 = b2 M M M M M M an1 a2 n M ann xn bn
or
(3.3b)
There are various numerical methods for solving non-homogenous system (3.3). They can be classified in two categories: (i) direct methods and
(ii) iterative methods.
131
Direct methods The direct methods include (a) Gauss elimination method (b) Gauss – Jordon method (c) matrix inversion method (d) the LU decomposition methods due to Crout and Cholesky.
Iterative methods Under iterative methods we study (a) Jacobi’s method and
(b) Gauss – Seidel method.
Before we go for these methods, the system (3.3) for n ≤ 3 is considered and its solution is obtained without the use of computer. These simple methods include the graphical method, Cramer rule and the elimination of the unknowns.
3.4 Graphical method to solve (3.2) for n ≤ 3 It is very convenient to use graphical method to solve a system of two linear equations of the form
and
a11 x1 + a12 x2 = b1
(3.4a)
a21 x1 + a22 x2 = b2
(3.4b)
Each of these equations represent a straight line in the x1 x2 - plane. If these lines are not parallel, they intersect in a point P and the coordinates ( x1 = α, x2 = β) of P is the solution of the system (3.4) as shown in Fig 3.1. x2 a11 x1 + a12 x2 = b1 P(α, β) Fig 3.1 x1 a21 x1 + a22 x2 = b2 132
Case n = 3 A linear equation in three variables represents a plane in three dimensional space. Graphically to solve a system of linear equations in three variables we have to draw three planes and find the coordinates ( x1 , x2 , x3 ) of their point of intersection. The method is not convenient and hence is not recommended.
Problem 3.2 Use the graphical method to solve the linear equations 2 x1 + 3x2 = 7 and 3 x1 − 2 x2 = 4
Solution. Draw the lines in the x1 x2 - plane as shown in Fig 3.2. To plot a line just get two points on it and join them. To find these two points put x1 = 0 and obtain x2 . Next put x2 = 0 and get x1. In the present case (0, 7 / 3) and (7 / 2, 0) are the points on the first line. Similarly (0, − 2) and (4 / 3, 0) are the points on the second line. These points are shown in Fig 3.2. The lines intersect in the point P whose coordinates are (2,1). Hence the solution of the system is x1 = 2, x2 = 1. x2
Fig 3.2
2 x1 + 3x2 = 7
P(2,1)
1
x1
2 3x1 − 2 x2 = 4
Singular systems of two linear equations Two parallel lines do not intersect and in such a situation there is no point of intersection. This means the solution does not exist. Moreover in case of two coincident lines, they intersect each other at infinite number of points and as such there are infinitely many solutions. In these two cases the systems are said to be singular.
MCQ 3.2 Consider the statements: (a) The system 0.2 x1 − 0.03 x2 = 1.95 and − 10 x1 + 1.5 x2 = 2.01 133
has finite number of solutions. (b) The system 0.01 x1 + 1.2 x2 = 7.01 and x1 + 120 x2 = 701 has infinitely many solutions Choose the true statement/s from the following: (A) Both (a) and (b) are true. (B) Both (a) and (b) are false. (C) Only (a) is true. (D) Only (b) is true.
SAQ 3.1 Using graphical method, solve the following systems of linear equations. (a) − 3 x1 + 4 x2 = 8 and 2 x1 − 3 x2 = −6 (b)
1 5 x1 − x2 = 1 and − 2 x1 + 15 x2 = 6 3 2
(c)
7 14 x1 − x2 = 2 and 6 x1 = 20 x2 − 17 5 3
3.5 Cramer’s rule Consider a linear system (3.3). Its solution xi , i = 1, 2,L, n is given by the following rule, known as Cramer’s rule.
Rule.
xi =
| Bi | , i = 1, 2,L, n | A|
(3.5)
where | A | is the determinant of the matrix A and | Bi | is the determinant of the matrix obtained by replacing the i th column of A by the column matrix B. Theoretically the method is general for use. However, the computation of determinants of higher orders n is manually cumbersome. For n ≤ 4, the method is best suited for solving linear equations. The working of the method is illustrated in the following solved problems for n = 2 and n = 3.
Problem 3.3 With the help of Cramer’s rule solve the equations 3 x1 − x2 = 8 and − 2 x1 + 3 x3 = −3.
134
Solution. The system of equations can be written as
Ax = B x 8 3 − 1 , x = 1 , B = A= − 3 − 2 3 x2
where
| A| =
⇒
3 −1 =9−2=7 −2 3
The solution is given by
x1 = Here
| B1 | |B | and x2 = 2 | A| | A|
(a1)
B1 = matrix A whose first column is replaced by B 8 − 1 = − 3 3
and
B2 = matrix A whose second column is replaced by B
8 3 = − 2 − 3
⇒
| B1 | =
Then (a1) ⇒
8 −1 3 8 = 24 − 3 = 21 and | B2 | = = − 9 + 16 = 7 −3 3 −2 −3 x1 =
21 7 = 3 and x2 = = 1 7 7
Problem 3.4
Using Cramer’s rule solve the equations x1 + 2 x2 − x3 = 2
2 x1 − x2 + 2 x3 = 6 x1 + x2 + 3x3 = 12 Solution. The matrix form of the given system is
Ax = B
where
1 2 − 1 x1 2 A = 2 − 1 2 , x = x2 , B = 6 1 1 3 x3 12 135
1 ⇒
2
| A | = det A = 2 − 1 1
1
−1 2 = 1(−3 − 2) + 2(2 − 6) − 1(2 + 1) = −16 3
The solution is given by xi =
Here
| Bi | , i = 1, 2, 3 | A|
B1 = matrix obtained from A by replacing its 1st column by B
2 2 − 1 = 6 − 1 2 12 1 3 B2 = matrix obtained from A by replacing its 2nd column by B
1 2 − 1 = 2 6 2 1 12 3 and
B3 = matrix obtained from A by replacing its 3rd column by B
1 2 2 = 2 − 1 6 1 1 12
⇒
2 2 −1 | B1 | = 6 − 1 2 = 2(−3 − 2) + 2(24 − 18) − 1(6 + 12) = −16 12 1 3 1 2 −1 | B2 | = 2 6 2 = 1(18 − 24) + 2( 2 − 6) − 1(24 − 6) = −32 1 12 3 1 2 2 | B3 | = 2 − 1 6 = 1(−12 − 6) + 2(6 − 24) + 2(2 + 1) = −48 1 1 12
Then (a1) ⇒
x1 =
| B | − 48 | B | − 32 | B1 | − 16 = 1, x2 = 2 = = 2 and x3 = 3 = =3 = | A | − 16 | A | − 16 | A | − 16
SAQ 3.2
Using Cramer’s rule solve the following systems. (a) 5 x1 + 4 x2 = 0.3 and − 2 x1 + 3 y = 0.8 136
(a1)
(b) x1 + x2 − x3 = 4,
1 x1 − 3x2 − 4 x3 = 2, − 3x1 + 5 x2 + 2 x3 = −3 2
3.6 Elimination of unknowns Consider the system of equations a11 x1 + a12 x2 = b1
(3.6a)
a21 x1 + a22 x2 = b2
(3.6b)
The plan is to eliminate x1 and get the value of x2 . Then substitute the value of x2 in any one of the above equations and obtain x1. To eliminate x1 , in these two equations we make the coefficients of x1 equal. For this multiply the first equation by a21 and the second equation by a11 to get a11a21 x1 + a12 a21 x2 = b1a21 a21a11 x1 + a22 a11 x2 = b2 a11
and By subtraction, ⇒
(a12 a21 − a22 a11 ) x2 = b1a21 − b2 a11 x2 =
b1a21 − b2 a11 b a −b a = 2 11 1 21 a12 a21 − a22 a11 a11a22 − a12 a21
(3.7a)
Substituting this value in (3.6a) and simplifying, we get x1 =
b1a22 − b2 a12 a11a22 − a12 a21
(3.7b)
The solutions in (3.7) follow directly from the Cramer’s rule. This method is commonly used at high school level to solve two equations in two unknowns. For larger system the method becomes tedious to implement manually and hence is not recommended.
3.7 Vector and matrix norms The study of error analysis of the system Ax = B, which is discussed in the next section, involves the concepts of a vector nom and a matrix norm. Basically a norm is a real valued function and the usual notation for it is || x || to mean a norm of x. Since norm is a function, sometimes we denote it by
N ( x) = || x || A norm gives a measure of the size or length of a mathematical entity. 137
Vector norms
The norm of a vector x, denoted by || x ||, is a real number which satisfies the following axioms: (n1) || x || ≥ 0 and || x || = 0 ⇔ x = 0 (n2) || c x || = | c | || x ||, for any complex number c (n3) || x + y || ≤ || x || + || y || Remark. The condition (n3) is termed as triangle inequality.
For any vector x = ( x1 , x2 ,L, xn ), there are three norms and are defined as follows. One norm n
|| x ||1 = | x1 | + | x2 | + L + | xn | = ∑ | xi |
(3.8a)
i =1
Two norm or Euclidean norm n
|| x ||2 = ( | x1 |2 + | x2 |2 + L + | xn |2 )1 / 2 = ∑ | xi |2 i =1
(3.8b)
Maximum (or uniform) norm
|| x ||∞ = max ( | x1 |, | x2 |, L, | xn | ) = max | xi | 1≤ i ≤ n
Problem 3.5
For the vector x = (1, 0, − 1, 1 − i 3 ), compute || x ||1 , || x ||2 and || x ||∞ . Hint. Here i = − 1 , | a ± ib | = a 2 + b 2 Solution. Let x = ( x1 , x2 , x3 , x4 ) = (1, 0, − 1, 1 − i 3 ). Then x1 = 1, x2 = 0, x3 = −1, x4 = 1 − i 3 By definition, we have || x ||1 = | x1 | + | x2 | + | x3 | + | x4 | = | 1 | + | 0 | + | −1 | + | 1 − i 3 | = 1 + 0 + 1 + 1 + 3 =4 || x ||2 = (| x1 |2 + | x2 |2 + | x3 |2 + | x4 |2 )1 / 2 = [| 1 |2 + | 0 |2 + | −1 |2 + | 1 − i 3 |2 ]1 / 2
138
(3.8c)
= [1 + 0 + 1 + 4]1 / 2 = 6 || x ||∞ = max ( | x1 |, | x2 |, | x3 |, | x4 | ) = max (1, 0,1, 2) = 2
MCQ 3.3 Let x = (eiθ , e − iθ ). Then (A) || x ||2 is a geometric mean of || x ||1 and || x ||∞ (B) || x ||2 is an arithmetic mean of || x ||1 and || x ||∞ (C) || x ||1 = 2 || x ||∞ (D) || x ||1 < || x ||2 < || x ||∞
SAQ 3.3 Show that the vector norms || x ||1 , || x ||2 and || x ||∞ satisfy the axioms (n1) to (n3).
Matrix norms We know that a set of n -square matrices form a vector space under appropriate addition and scalar multiplication operations. It is thus implied a matrix norm should satisfy the axioms (n1) to (n3) of vector norms. In addition we have a norm condition related to the product of two matrices
n - square matrices. To define matrix norms, consider two n -square matrices A and B for which A + B and AB are defined. We define norm of A as a non-negative number, denoted by || A || which satisfies the following conditions: (m1) || A || ≥ 0 and || A || = 0 ⇔ A = 0 (m2) || c A || = | c | || A ||, c = scalar (m3) || A + B || ≤ || A || + || B || (m4) || AB | ≤ || A || || B || Corresponding to vector norms, we define matrix norms for a n - square matrix A = [ aij ] as follows.
Column-sum norm n
|| A ||1 = max ∑ | aij | 1≤ j ≤ n i =1
(3.9a) 139
Euclidean norm 1/ 2
n || A ||e = ∑ | aij |2 i , j =1
(3.9b)
Row-sum norm n
|| A ||∞ = max ∑ | aij |
(3.9c)
1≤ i ≤ n j =1
Remark. For a matrix the 2-norm and the Euclidean norm are same as is true for a vector. The matrix 2-norm is related to eigenvalues of A.
Matrix condition number We define the matrix condition number K ( A) of a square matrix A by K ( A) = || A || || A−1 ||
The value of the number depends upon the norm being used for the matrix. Since there are three types of matrix norms, we have three condition numbers for a matrix. Since K ( A) = || A || || A−1 || ≥ || A A−1 || = || I || ≥ 1
the condition number is bounded below by one. Problem 3.6 2 − 1 For the matrix A = compute || A ||1 , || A ||e , || A ||∞ . 0 3 2
Solution. || A ||1 = max ∑ | aij | = max [ | a1 j | + | a2 j | ] = max [ | a11 | + | a21 |, | a12 | + | a22 | ] j
j
i =1
= max [ 2 + 0, 1 + 3] = max [ 2, 4] =4 2 2 || A ||e = ∑ ∑ | aij i =1 j =1
1/ 2 2
|
1/ 2
2 = ∑ ( | ai1 |2 + | ai 2 |2 ) i =1
= [ | a11 |2 + | a12 |2 + | a21 |2 + | a22 |2 ] 1 / 2 140
= [ (2) 2 + (−1) 2 + (0) 2 + (3) 2 ]1 / 2 = 14 2
|| A ||∞ = max ∑ | aij | = max [ | a11 | + | a12 |, | a21 | + | a22 | ] 1≤ i ≤ 2 j =1
= max [ 2 + 1, 0 + 3] = max [3, 3] =3
Problem 3.7 Determine the matrix number K ( A) for the matrix 2 − 1 A= 0 3
by using three types of norms of a matrix.
Solution. Here | A | = 6 ≠ 0. Hence A is nonsingular and A−1 exists: A−1 =
1 3 1 6 0 2
By definition of matrix norms, we have || A ||1 = 4, see Problem 3.6
(a) and
⇒
|| A−1 || 1 =
1 1 1 1 max [ | 3 | + | 0 |, | 1 | + | 2 | ] = max [3, 3] = × 3 = 6 6 6 2 K ( A)1 = || A ||1 || A−1 ||1 = 4 ×
1 =2 2
(b)
|| A ||e = 14 , see Problem 3.6
and
14 1 || A−1 ||e = [ | 3 / 6 |2 + | 1 / 6 |2 + | 0 |2 + | 2 / 6 |2 ]1 / 2 = [ 9 + 1 + 4]1 / 2 = 6 6
⇒
K ( A) e = || A ||∞ || A−1 ||∞ = 14 ×
14 7 = 6 3
(c)
|| A ||∞ = 3, see Problem 3.6
and
1 1 1 2 || A−1 || = max [ | 3 | + | 1 |, | 0 | + | 2 | ] = max [ 4, 2] = × 4 = 6 6 6 3 141
K ( A) ∞ = || A ||∞ || A−1 ||∞ = 3 ×
⇒
2 =2 3
MCQ 3.4 Consider the statements: (a) A is a nonzero n - square symmetric matrix ⇒ K ( A)1 = K ( A) ∞ . (b) K ( A)1 = K ( A) ∞ ⇒ A is a nonzero n - square symmetric matrix. Choose the true statement from the following. (A) Both (a) and (b) are true. (B) Both (a) and (b) are false. (C) Only (a) is true. (D) Only (b) is true.
Problem 3.8 Solve the system by matrix inversion: x1 + 2 x2 = 3
− x1 + x2 = 1
Solution. The system, in matrix form is Ax = B
1 2 x1 3 − 1 1 x = 1 2
i.e.
| A| =
Here
⇒
142
2
−1 1
= 1+ 2 = 3 ≠ 0
x = A −1 B
Then (a1) ⇒ ⇒
1
x1 x = 2
1 1 − 2 3 1 3 − 2 1 1 1 / 3 = = = 3 1 1 1 3 3 + 1 3 4 4 / 3 x1 =
1 4 = 0.33, x2 = = 1.33 3 3
(a1)
SAQ 3.4 Find the matrix condition number of the system 2 − 3 x1 1.3 4 1 x = 4.7 2
SAQ 3.5 1.21 1.1 1 Determine three norms of the matrix 0.04 0.2 1 and the matrix condition number. 9 3 1
3.8 Error analysis for the system Ax = B in (3.3) Consider a system (3.3) of order n of linear equations which is uniquely solvable. Here the matrix A is nonsingular. The small changes in the elements of the matrix A causes changes in A. Similar is the case with B. Let δA and δB be the perturbations in these matrices. Here it is to
be noted that δA and δB are the matrices of the orders indicated by A and B respectively. The cumulative effect of these perturbations gives the error whose estimation is given in the following theorem.
Theorem 3.1 Let the system of linear equations be given by Ax = B
(3.10)
where A is a n-square nonsingular matrix. Let δA and δB be perturbations of A and B such that
|| δA ||
0 ⇒ y is minimum at x = a .
(2.9b)
The above procedure is for a function which is known explicitly. The question is whether we can study maxima and minima of a function given in terms of tabular values. The answer is provided by the discussion carried so far in this unit. We know how to find the derivatives of a function given in terms of a tabular dada, by interpolating the function by a polynomial. Thus if the function f (x) is given by the values x: x0 y = f ( x ) : y0
x1 L xn y1 L yn
(2.10)
we can find its derivatives y ′( x), y ′′( x), L. Then we say that the study of maximum or minimum values of the function y = f (x ) defined by (2.10) is also governed by (2.9). In the previous unit, the first derivative of the function at any point x = x0 + rh is given by (see (1.5a) ) h y ′( x) = ∆y0 +
+
2r − 1 2 3r 2 − 6r + 2 3 4r 3 − 18r 2 + 22r − 6 4 ∆ y0 + ∆ y0 + ∆ y0 2 6 24 5r 4 − 40r 3 + 105r 2 − 100r + 24 5 ∆ y0 + L 120
where h is the length of equally spaced intervals. 384
For maxima or minima, we have y ′( x) = 0. Then keeping up to third differences, above equation gives
∆y0 + ⇒
2r − 1 2 3r 2 − 6r + 2 3 ∆ y0 + ∆ y0 = 0 2 6
(3 ∆3 y0 ) r 2 + 6( ∆2 y0 − ∆3 y0 ) r + (6 ∆y0 − 3 ∆2 y0 + 2 ∆3 y0 ) = 0
(2.11).
This is a quadratic equation in r. From the difference table, the values of ∆y0 , ∆2 y0 , ∆3 y0 are known and then we can find the roots of the equation. Then having known the values of r , from (2.9), one can identify the maximum and minimum values, if they exist. Problem 2.5
Find the maxima and minima of the function y = f (x ) specified by the following data: 0 1 2 −1 x: . y = f ( x) : − 12 − 7 4 33 Solution. Since the values of x are equally spaced, we use the NG forward formula for which we
construct the difference table: x
y
−1
− 12
∆y
∆2 y
∆3 y
5 0
−7
6 12
11 1
4
18 29
2
33
In the present case the formula becomes y ( x) = y0 + r ∆y0 +
r (r − 1) 2 r (r − 1)(r − 2) 3 ∆ y0 + ∆ y0 2 6
where h = 1 and r =
x − x0 x + 1 = = x + 1. h 1
⇒
y ( x) = −12 + ( x + 1)(5) +
( x + 1) x ( x + 1) x( x − 1) ( 6) + (12) 2 6 385
= −12 + 5( x + 1) + 3x( x + 1) + 2 x( x 2 − 1) = 2 x3 + 3x 2 + 6 x − 7
(a1)
y′( x) = 6 x 2 + 6 x + 6 = 6( x 2 + x + 1)
⇒
The maxima and minima of y (x) are given by y′( x) = 0 i.e x 2 + x + 1 = 0 This equation has no real roots (: b 2 − 4ac = 1 − 4 < 0) and hence the function has neither maxima nor minima. Problem 2.6
Discuss maxima and minima of the function y = f (x) specified by the values:
−2 0 2 4 x: . y = f ( x) : − 1 1 3 53 Solution. The values of x are equally spaced with interval length h = 2. Hence we use NG
forward formula to find the polynomial. The difference table is x
y
−2
−1
∆y
∆2 y
∆3 y
2 0
1
0 48
2 2
3
48 50
4
53
The formula has the form y ( x) = y0 + r ∆y0 + where h = 2 and r =
⇒ 386
r (r − 1) 2 r (r − 1)(r − 2) 3 ∆ y0 + ∆ y0 2 6
x − x0 x + 2 = . 2 h y ( x) = −1 +
1 x+2 x x−2 x+2 ( 2) + 0 + ⋅ ⋅ (48) 2 6 2 2 2
= −1 + x + 2 + x( x 2 − 4) = x3 − 3x + 1 y′( x) = 3 x 2 − 3 = 3( x 2 − 1)
⇒
For maxima and minima, y′( x) = 0 i.e. x2 − 1 = 0
⇒
x = −1, 1
Now y′′( x) = 6 x and then y′′(−1) = −6 = negative and y′′(1) = 6 = positive
⇒
y (x) is maximum at x = −1 and is minimum at x = 1
Then form (a1), we have ymax = y (−1) = (−1)3 − 3(−1) + 1 = 3 ymin = y (1) = 13 − 3(1) + 1 = −1
and MCQ 2.4
Let the function y = f (x) be given by the values x: 1 2 7 8 . y = f ( x) : 4 5 5 4 Choose the statement/s from the following: (A) f (x) has minima in [1, 2]. (B) f (x) has both maxima and minima in [1, 8]. (C) f (x) has maxima in [1, 2]. (D) f (x) has maxima in [1, 8]. Problem 2.7
Find the maxima and minima of the function y = f (x ) which is given by the following values:
−1 0 1 x: 3 4 . y = f ( x) : − 4 3 − 4 12 131
(a1)
Solution. Since the values of x are not equally spaced, we use Newton interpolation formula: 387
y ( x) = y ( x0 ) + ( x − x0 ) y ( x0 , x1 ) + ( x − x0 )( x − x1 ) y ( x0 , x1 , x2 )
+ ( x − x0 )( x − x1 )( x − x2 ) y ( x0 , x1 , x2 , x3 ) + ( x − x0 )( x − x1 )( x − x2 )( x − x3 ) y ( x0 , x1 , x2 , x3 , x4 ) + L
(a2)
The difference table is x
y
−1
−4
1dd
2dd
3dd
4dd
3+ 4 =7 0 +1 0
−7−7 = −7 1+1
3
5+7 =3 3 +1
−4−3 = −7 1− 0
1
12 + 4 =8 3 −1
3
8−3 =1 4 +1
8+7 =5 3−0
−4
37 − 5 =8 4−0
119 − 8 = 37 4 −1
12 131 − 12 = 119 4−3
4
131
Substituting the values of the divided differences from the table and (a1), the equation (a2) gives the interpolating polynomial y ( x) = −4 + ( x + 1)(7) + ( x + 1) ( x) (−7) + ( x + 1) ( x)( x − 1)(3)
+ ( x + 1)( x)( x − 1)( x − 3)(1) = 3 + 7 x − 7( x 2 + x) + 3 x( x 2 − 1) + ( x 2 − 1)( x 2 − 3x) = x4 − 8x2 + 3 ⇒
y′( x) = 4 x 3 − 16 x = 4 x( x 2 − 4)
and
y′′( x) = 12 x 2 − 16
For maxima or minima, we have y′( x) = 0 i.e. 4 x( x 2 − 4) = 0 388
(a3)
⇒
x = 0, 2, − 2 y′′(0) = −16 < 0 ⇒ x = 0 gives maxima of f (x)
Now
y′′(2) = 48 − 16 > 0 and y′′(−2) < 0 ⇒ x = ± 2 gives minima of f (x). Then the maximum and minimum values of y (x) can be obtained from (a3): ymax = y (0) = 0 − 0 + 3 = 3 ymin = y (±2) = (±2) 4 − 8(±2) 2 + 3 = −13
and MCQ 2.5
Let the function y = f (x) be given by the values: f ( −1) = −12, f (1) = 6, f (2) = 42, f (3) = 144. Then (A) f (x) has neither maxima nor minima in (−1, 3). (B) f (x) has maxima in (−1, 3). (C) f (x) has minima in (−1, 3). (D) max f ( x) = 144 and min f ( x) = −12 in (−1, 3). SAQ 2.4
Find the maximum and the minimum values of the function y = f (x) which is given by the following values: x: 0 1 2 3 4 5 . y = f ( x) : 0 0.25 0 2.25 10 56.25 SAQ 2.5
Find the maxima and minima of the function y = f (x ) which is specified by the following data: 4 −1 1 2 3 x: . y = f ( x) : 0 0 − 9 16 135 SAQ 2.6
Using Lagrange interpolation formula, for equally spaced values of x, show that y′′′( x0 ) =
1 [−5 y0 + 18 y1 − 24 y2 + 14 y3 − 3 y4 ]. 2h 3 389
SUMMARY
The study of numerical differentiation of the previous unit is continued with reference to unequal spacing of the values of x. Consequently to find the derivatives, Newton’s divided difference formula and Lagrange interpolation formula are used. The problem of maxima and minima for a function specified by tabular values is also discussed.
KEY WORDS
Newton’s divided difference formula Lagrange formula Maxima Minima
390
UNIT 04-03: NUMERICAL INTEGRATION
391-414
LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain Numerical integration and the methods of evaluation
Apply to the methods to the problems to evaluate the definite integrals
INTRODUCTION From integral calculus if a function y = f (x) satisfies the condition of Riemann integrability,
then we say that f (x) is Riemann integrable and the definite integral b
I = ∫ f ( x) dx
(3.1)
a
gives an area bounded by (i) the function f (x) (ii) the x - axis and
(iii) the two ordinates x = a and x = b. y = f ( x)
y
Fig 3.1
A O
a
b
x
However, the evaluation of the definite integral is possible only if the function f (x) is in the standard form or can be brought to this form. In general, evaluation is not possible for any f (x ). In such a situation the use of approximate methods of numerical analysis is made. Here enters numerical integration and can be defined as a primary tool used to find approximate answer for definite integrals that cannot be solved analytically. In numerical integration we take help of interpolation and use Newton – Gregory forward formula and Lagrange formula to deduce various formulae for numerical integration. This way we find an approximate bounded area given by (3.1). In calculus or in numerical integration this method of finding area is also called quadrature. In this unit our aim is to evaluate the definite integrals of the form (3.1), by
interpolation, when the function f ( x) which is specified by n + 1 values in a tabular form:
391
x:
a = x0
y = f ( x) :
y0
x1 L xn = b y1 L
yn
.
(3.2)
Here it is presumed that the function f ( x) is Riemann integration on [a, b] and values of x are equally spaced i.e. xi − xi −1 = h, i = 1, 2,L, n
(3.3)
In quadrature or numerical integration the values x0 , x1 ,L, xn are called the quadrature nodes. Now we deduce Newton – Cotes quadrature general formula. Note. Here after we write Newton’s rule or Newton rule interchangeably.
3.1 Newton – Cotes quadrature formula Here we suppose that the function y = f (x) is given by the tabular values in (3.2) such that x is equally spaced as in (3.3). We also assume that the function is Riemann integrable on [a, b]. We denote x0 = a and xn = b. Noting (3.3), it implies that the interval [ x0 , xn ] is divided into n equal parts at x = x0 , x1 = x0 + h, x2 = x2 + 2h, L, xn = x0 + nh etc. From Newton-Gregory forward interpolation formula, we write y ( x ) = f ( x ) = y 0 + r ∆y 0 +
r (r − 1) 2 r (r − 1)(r − 2) 3 ∆ y0 + ∆ y0 2! 3!
+
r (r − 1)(r − 2)(r − 3) 4 r (r − 1)(r − 2)(r − 3)(r − 4) 5 ∆ y0 + ∆ y0 4! 5!
+
r (r − 1)(r − 2)(r − 3)(r − 4)(r − 5) 6 ∆ y0 + L 6!
(3.4)
Since f (x) is integrable, we integrate above with respect to x within the limits a to b i.e. x0 to x0 + nh : x0 + nh x 0 + nh r (r − 1) 2 r ( r − 1)(r − 2) 3 ∆ y0 + ∆ y0 I = ∫ f ( x) dx = ∫ y0 + r ∆y0 + 2! 3! x0 x0
+
r (r − 1)(r − 2)(r − 3) 4 r ( r − 1)(r − 2)(r − 3)(r − 4) 5 ∆ y0 + ∆ y0 4! 5!
+
r (r − 1)(r − 2)(r − 3)(r − 4)(r − 5) 6 ∆ y0 + L dx 6!
Substitute x = x0 + rh. Then dx = h dr and the limits for r become r = 0 to r = n. Then above transforms to 392
n
I = h ∫ f ( x0 + rh) dr 0
n r ( r − 1) 2 r (r − 1)(r − 2) 3 r (r − 1)(r − 2)(r − 3) 4 = ∫ y0 + r ∆y0 + ∆ y0 + ∆ y0 + ∆ y0 2! 3! 4! 0
+
r (r − 1)(r − 2)(r − 3)(r − 4) 5 r ( r − 1)(r − 2)(r − 3)(r − 4)(r − 5) 6 ∆ y0 + ∆ y0 + L h dr 5! 6!
In the above y0 , ∆y0 , ∆2 y0 ,L are constants. Integrating term by term on the right side and denoting the integrals by I 0 , I1 , L , we have I = I 0 + I1 + I 2 + I 3 + I 4 + I 5 + I 6 + L
Here
n
n
0
0
(3.5)
I 0 = ∫ y0 h dr = h y0 ∫ dr = hy0 [r ]0n = hn y0 n
n 1 1 I1 = h ∫ r ∆y0 dr = h ∆y0 r 2 = hn 2 ∆y0 0 2 0 2 n
n r3 r2 1 n 1 1 h ∫ r (r − 1) ∆2 y0 dr = h ∆2 y0 ∫ (r 2 − r ) dr = h ∆2 y0 − 2 0 2 2 2 0 0 3
I2 =
=
1 2 hn (2n − 3) ∆2 y0 12
I3 = =
1 n h ∫ r (r − 1)(r − 2) ∆3 y0 dr 6 0 1 3 n 3 h ∆ y0 ∫ ( r − 3r 2 + 2r ) dr 6 0 n
r4 1 = h ∆3 y0 − r 3 + r 2 6 4 0 =
1 h n 2 (n − 2) 2 ∆3 y0 24
I4 =
1 n h ∫ r (r − 1)(r − 2) (r − 3) ∆4 y0 dr 24 0
=
n 1 h ∆4 y0 ∫ (r 4 − 6r 3 + 11r 2 − 6r ) dr 24 0 n
r 5 6r 4 11r 3 6r 2 1 = + − h ∆4 y0 − 24 4 3 2 0 5
393
=
n5 nr 4 11n3 6n 2 1 h ∆4 y0 − + − 24 4 3 2 5
=
1 h n 2 (6n 3 − 45n 2 + 110n − 90) ∆4 y0 720 h 5 n 4 ∆ y0 ∫ (r − 6r 3 + 11r 2 − 6r )(r − 4) dr 5! 0
I5 =
=
1 5 n 5 h ∆ y0 ∫ ( r − 10r 4 + 35r 3 − 50r 2 + 24r ) dr 5! 0 n
r 6 10r 5 35r 4 50r 3 24r 2 1 = h ∆5 y0 − + − + 5! 5 4 3 2 0 6 =
1 hn 2 ∆5 y0 [ 2n 4 − 24n3 + 9n 2 − 200n + 144] 5!× 12
I6 =
=
h 6 n 5 ∆ y0 ∫ ( r − 10r 4 + 35r 3 − 50r 2 + 24r )(r − 5) dr 6! 0 1 6 n 6 h ∆ y0 ∫ (r − 15r 5 + 85r 4 − 225r 3 + 274r 2 − 120r ) dr 6! 0 n
n 7 15r 6 85r 5 225r 4 274r 3 120r 2 1 = h ∆6 y0 − + − + − 6! 6 5 4 3 2 0 7 =
n 5 5n 4 1 225n 2 274n h n 2 ∆6 y0 − + 17 n3 − + − 60 6! 2 4 3 7
and so on. With the above values in (3.5), we write b
x 0 + nh
a
x0
I = ∫ f ( x) dx = ∫ f ( x) dx 1 ( 2n − 3) 2 ( n − 2) 2 3 6n3 − 45n 2 + 110n − 90 4 = hny0 + hn 2 ∆y0 + ∆ y0 + ∆ y0 + ∆ y0 12 24 720 2
+ hn 2 +
2n 4 − 24n3 + 9n 2 − 200n + 144 5 ∆ y0 1440
hn 2 n5 5n 4 225n 2 274n + 17 n3 − + − 60 ∆6 y0 + L − 6! 7 2 4 3
This is the closed Newton – Cotes quadrature formula. 394
(3.6)
Notation. We denote exact values by equality sign ( = ) and the approximate values by (~). Thus b
I = ∫ y ( x) dx = A means that A is the exact value of the integral I a
and
I ~ A means that A is the approximate or estimated value of the integral I .
Remark. In deriving Newton – Cotes formula, use of Newton-Gregory forward formula is
made. There is one more interpolation formula due to Lagrange. This can also be considered for obtaining the Newton – Cotes formula. We achieve this as follows.
Deduction of Newton – Cotes formula from Lagrange interpolation rule Consider that the function y = f (x) given by (3.2) is such that the values of x are equispaced i.e. satisfy (3.3). The Lagrange interpolation formula is n
y ( x) = f ( x) ~ l0 ( x) y0 + l1 ( x) y1 + L + ln ( x) y n = ∑ li ( x) yi , i =0
(3.7)
where l' s are Lagrange coefficient polynomials and are specified by li ( x) =
or
li ( x) =
⇒
( x − x0 )( x − x1 )L ( x − xi −1 )( x − xi +1 )L ( x − xn ) , i = 0,1,L, n ( xi − x0 )( xi − x1 )L( xi − xi −1 )( xi − xi +1 )L( xi − xn )
1 ( x − x0 )( x − x1 )L( x − xi −1 )( x − xi )( x − xi +1 )L( x − xn ) , i = 0,1,L, n ( x − xi ) ( xi − x0 )( xi − x1 )L( xi − xi −1 )( xi − xi +1 )L( xi − xn )
li ( x) =
1 ( x − x0 )( x − x1 )L ( x − xn ) , i = 0,1,L, n ( x − xi ) ( xi − x0 )( xi − x1 )L( xi − xi −1 )( xi − xi +1 )L( xi − xn )
Substituting these values in (3.7) and then integrating with respect to x, we get x0 + nh
x0 + nh n
∫ f ( x) dx ~ ∫ ∑
x0 i = 0
x0
( x − x0 )( x − x1 )L( x − xn ) 1 yi dx (3.8) ( x − xi ) ( xi − x0 )( xi − x1 )L( xi − xi −1 )( xi − xi +1 )L ( xi − xn )
From (3.3), we have xi − x j = (i − j ) h, i, j = 0,1,L, n ⇒
xi − x0 = (i − 0)h = ih, xi − x1 = (i − 1)h,L, xi − xi −1 = (i − i + 1)h = 1h, xi − xi +1 = −ih,L
Put x = x0 + rh. Then dx = h dr and the new limits are from r = 0 to r = n. Also we have x − x0 = rh, x − x1 = x − ( x0 + h) = ( x − x0 ) − h = rh − h = ( r − 1)h x − x2 = (r − 2)h,L, x − xi = (r − i )h,L With these values, equation (3.8) transforms to 395
x0 + nh
n
n
∫ f ( x) dx ~ ∫ ∑
x0
0 i =0
n
n
~ h∫ ∑
0 i =0
n
1 (rh)(r − 1)hL(r − n)h h yi dr (r − i )h (ih)(i − 1)h L(1h)(−1h)(−2h)L (−(n − i ))h 1 h n +1 ( r )(r − 1)L(r − n) yi dr (r − i )h i +1[ (i )(i − 1)L(1)] h n −i [(1)(2)L(n − i )(−1) n −i
n
~ h ∫ ∑ yi 0 i =0
n
n
~ h ∫ ∑ yi 0 i =0
(−1) n −i r (r − 1)L( r − n) dr (r − i )[ i (i − 1)L1][(1)(2)L( n − i )](−1) 2 ( n −i ) (−1) n −i r (r − 1)L (r − n) dr (r − i ) i !( n − i )!
n ( −1) n −i n r ( r − 1) L ( r − n) ~h∑ dr yi ∫ r −i i = 0 i !( n − i ) ! 0 n
~ h ∑ ci y i , i =0
where
ci =
(−1) n − i n r (r − 1)L( r − n) dr ∫ i !(n − i )! 0 r −i
(3.9a)
Thus the Newton – Cotes quadrature formula is given by xn
xn
n
x0
x0
i =0
∫ f ( x) dx = ∫ y ( x) dx ~ h ∑ ci yi
(3.9b)
where ci are given by (3.9a). The quantities ci are called Cotes numbers.
3.2 The first four closed quadrature formulae from Newton – Cotes formula We obtain the quadrature formulae corresponding to the values n = 1, 2, 3 and 4 in Newton Cotes formula (3.6) and (3.9). It is understood that yi = y ( xi ), i = 0,1,L, n. (3.2a). The trapezoidal rule or quadrature formula
This rule is deduced from (3.6) for n = 1. When n = 1, the values in (3.1) are only two: x : x0
x1
y : y0
y1
i.e. we have a polynomial of degree one through two points ( x0 , y0 ) and ( x1 , y1 ). In this case we have only one ∆y0 and other higher order ∆y0 do not exist. Then the formula (3.6) becomes
396
x1 1 I = ∫ f ( x) dx ~ h y0 + h ∆y0 2 x0
~
h (2 y0 + ∆y0 ) 2
~
h (2 y0 + y1 − y0 ), Q ∆y0 = y1 − y0 2 x1
⇒
∫ f ( x) dx ~
x0
h ( y0 + y1 ) 2
(3.10)
Geometrical interpretation of (3.10)
Consider the trapezium ABCD as shown in Fig 3.2 where the sides AD = y0 and BC = y1 are parallel and AB = h. D C Fig 3.2 B
A We know that the area of this trapezium is AB h ( AD + BC ) = ( y0 + y1 ) 2 2
Hence the right side in (3.10) is the area of the trapezium whose parallel sides are of lengths y0 and y1 at distance h apart. Because of this the rule is termed as trapezium rule. In case of (3.6), the left side gives the exact area bounded by y = f (x), the x -axis and the ordinates x = x0 , x1. On the other hand, the right side gives the approximate value of this area. The difference between the two is the error. This is illustrated in Fig 3.3.
y
E
D
y = f (x)
C Fig 3.3 O
A a
B b
x
397
Here y = f (x) is a given function and x0 = a, x1 = b, y0 = AD, y1 = BC .
The function is
approximated by a linear polynomial i.e. straight line CD passing through D ( x0 , y0 ) and C ( x1 , y1 ). The shaded region is the integral in (3.6) and the area ABCDA is the right side of the (3.6). The difference between them is the error area CDEC bounded by CD and the curve y = f (x). The area CDEC can be positive or negative depending upon the concave nature of the curve. Here it is positive. Remark. The trapezium formula (3.6) is the simplest quadrature formula. It is easy for
computing numerical integration. The error, which will be discussed later on, is significant. About the step size. If the end points of the interval [ x0 , xn ] = [a, b] are held fixed, then for the
tapezoidal rule, the step size h = xn − x0 . Problem 3.1
Derive the trapezium rule from Lagrange form of Newton – Cotes formula. Solution. The Newton – Cotes formula in Lagrange form is given by the equations (3.9). For
n = 1, it gives x1
1
x0
i =0
∫ f ( x) dx ~ ∑ h ci yi = h(c0 y0 + c1 y1 )
ci =
where
(a1)
(−1)1−i 1 r (r − 1) dr , i = 0,1 ∫ i !(1 − i )! 0 r − i 1
⇒
1 r2 ( −1)1− 0 1 r (r − 1) 1 c0 = dr = − ∫ (r − 1)dr = − − r = ∫ 0!(1 − 0)! 0 r − 0 0 2 0 2 1
and
1 r2 (−1)1−1 1 r (r − 1) 1 c1 = dr = ∫ r dr = = ∫ 1!(1 − 1)! 0 r − 1 0 2 0 2
Substituting these values in (a1), we get 1 h 1 ∫ f ( x) dx ~ h y0 + y1 = ( y0 + y1 ) 2 2 x0 2 x1
This is the trapezoidal rule (3.10).
398
(3.2b) Simpson’s one-third quadrature rule This is derived from Newton-Cotes formula for n = 2. In this case the function y = f (x) will be given by n + 1 = 2 + 1 = 3 values in (3.2): x : x0
x1
x2
y : y0
y1
y2
This leads to two forward differences from the difference table: ∆y0 and ∆2 y0 . Other higher order differences do not exist. With this background, now Newton-Cotes formula for n = 2 ⇒ I=
x0 + 2 h
∫ f ( x) dx
x0
(4 − 3) 2 1 ~ h(2) y0 + h(2) 2 ∆y0 + ∆ y0 12 2 ~ 2hy0 +
4h [6 ∆y0 + ∆2 y0 ) 12
h ~ 2hy0 + [6( y1 − y0 ) + ( E − 1) 2 y0 )], Q ∆ = E − 1 3 h ~ 2hy0 + [6( y1 − y0 ) + ( E 2 − 2 E + 1) y0 )] 3 h ~ 2hy0 + [6( y1 − y0 ) + y0 + 2 − 2 y0+1 + y0 ], Q E i y0 = y0+i 3 h ~ [6 y0 + 4 y1 + y 2 − 5 y0 ] 3 ⇒
x2
x2 h ∫ f ( x) dx = ∫ y dx ~ [ y0 + 4 y1 + y 2 ] 3 x0 x0
(3.11)
This is the Simpson’s one-third quadrature formula. Remark. The Simpson’s one-third rule is obtained from (3.6) for n = 2. In this case the
interpolating polynomial is of degree 2. Hence the formula is applicable only if the number of subintervals is even or multiple of 2. Then a minimum number of ordinates is 3. It means that if the interval of integration is given as [a, b], divide it into two subintervals of step size
h=
b−a . 2
Illustration. Suppose the given interval is [0, 3]. Then 399
3−0 = 1.5 2
h= and the subintervals are [0, 1.5] and [1.5, 3]. Problem 3.2 2
2
Evaluate the integral ∫ e x dx by 0
(a) trapezoidal rule and
(b) Simpson’s one-third rule.
Solution. Given that 2
y = f ( x) = e x on [ x0 , xn ] = [0, 2]. (a) Here [ x0 , x1 ] = [0, 2], step size h = 2 − 0 = 2. Then 2
y0 = y (0) = e0 = 1 and y1 = y (2) = e 2 = e 4 = (2.7183) 4 = 54.5970 By the trapezoidal rule 2
2
x ∫ e dx ~
0
h ( y0 + y1 ) 2
~ 1(1 + 54.5970) = 55.5970
(a1)
(b) For the Simpson one-third method, we divide the given interval into two equal intervals by taking the step size h=
2−0 = 1. 2
Two intervals are [0,1] and [1, 2]. We find the values of y at the nodes x = 0, 1, 2 : y0 = y (0) = 1 y1 = y (1) = e1 = e = 2.7183 y 2 = y (2) = e 4 = 54.5982
and
By Simpson’s one – third rule, we have 2
2
x ∫ e dx ~
0
h 1 ( y0 + 4 y1 + y2 ) = [1 + 4( 2.7183) + 54.5970] = 22.1567 3 3
Compare the values in (a1) and (a2). They differ significantly. 400
(a2)
Problem 3.3 Deduce the Simpson’s one-third quadrature rule from Lagrange interpolation formula (3.9). Consider the values
x : x0
x1
x2
y : y0
y1
y2
where the values of x are equi-spaced with step size h. The Newton – Cotes formula (3.9)
becomes x2
2
x0
i =0
∫ f ( x)dx ~ h ∑ ci yi = h(c0 y0 + c1 y1 + c2 y2 )
(a1)
The Cotes numbers are given by (3.9a): ci =
(−1) n − i n r (r − 1)L (r − n) dr , i = 0, 1, 2 ∫ i !(n − i )! 0 r −i
Here n = 2. Then we have 2
⇒
(−1) 2 − 0 2 r (r − 1)(r − 2) 12 1 r 3 3r 2 1 c0 = dr = ∫ (r 2 − 3r + 2) dr = − + 2r = ∫ r −0 0!(2 − 0)! 0 20 2 3 2 0 3 2 (−1) 2 −1 2 r (r − 1)(r − 2) c1 = dr = − ∫ (r 2 − 2r ) dr = − ∫ 1!(2 − 1)! 0 r −1 0
2
r 3 2r 2 4 − = 2 0 3 3 2
c2 =
(−1) 2 − 2 2 r (r − 1)(r − 2) 12 2 1 r3 r2 1 ( ) dr r r dr = − = ∫ ∫ − = 2!(2 − 2)! 0 20 2 3 2 0 3 r−2
Substituting these values in (a1), we get 4 1 1 1 ∫ f ( x)dx ~ 1 y0 + y1 + y2 = ( y0 + 4 y1 + y 2 ) 3 3 3 x0 3
x2
which is the Simpson one-third rule.
3.2c Simpson’s three-eighth quadrature rule This rule is obtained from Newton – Cotes formula for n = 3. Since n = 3, we get n + 1 = 4 values in (3.2) with ∆y0 , ∆2 y0 and ∆3 y0 . The higher order differences ∆4 y0 , ∆5 y0 ,L do not exist. Then the Newton – Cotes formula for n = 3 gives
401
x0 + 3 h
3 3 2 1 3 ∫ f ( x) dx ~ 3h y0 + ∆y0 + ∆ y0 + ∆ y0 2 4 8 x0
⇒
~
3h [8 y0 + 12∆y0 + 6 ∆2 y0 + ∆3 y0 ] 8
~
3h [8 y0 + 12( y1 − y0 ) + 6( E − 1) 2 y0 + ( E − 1) 3 y0 ], Q ∆ = E − 1 8
~
3h [8 y0 + 12( y1 − y0 ) + 6( E 2 − 2 E + 1) y0 + ( E 3 − 3E 2 + 3E − 1) y0 ] 8
~
3h [8 y0 + 12( y1 − y0 ) + 6( y 2 − 2 y1 + y0 ) + ( y3 − 3 y 2 + 3 y1 − y0 )], Q E i y0 = yi 8 x0 + 3 h
x3
x0
x0
∫ f ( x) dx = ∫ f ( x) dx ~
3h [ y0 + 3 y1 + 3 y 2 + y3 ] 8
(3.12)
Above (3.12) is the Simpson three-eighth quadrature rule. Remark. For Simpson three-eighth rule, the polynomial is of degree 3. Thus the rule is applicable
only if the number of subintervals is a multiple of 3. It means that a minimum number of the ordinates be 4. Hence if the given interval for integration is [a, b], then break it into three equal sub- intervals with step size h=
b−a . 3
Problem 3.4 3
Evaluate ∫
0
1 dx by using Simpson three-eighth rule. 1 + x2
Solution. Here interval is [0, 3]. We break it into three sub-intervals of step size
h=
3−0 = 1. 3
Then the values of x are x0 = 0, x1 = x0 + h = 1, x2 = x0 + 2h = 2 and x3 = x0 + 3h = 3. The
corresponding values of y = y ( x) =
1 are as follows: 1 + x2 y0 = y ( x0 ) =
y1 = y ( x1 ) = y (1) = 402
1 =1 1+ 0 1 1 = = 0.5 2 2 1+1
y2 = y ( x2 ) = y (2) =
1 1 = = 0.2 2 5 1+ 2
y3 = y ( x3 ) = y (3) =
1 1 = = 0.1 2 1 + 3 10
With these values the Simpson three-eight rule (3.12) gives 3
∫
0
3(1) 3 1 dx ~ [1 + 3(0.5) + 3(0.2) + 0.1] = (3.2) = 1.2 2 8 8 1+ x
SAQ 3.1
Deduce the Simpson three-eighth rule using Lagrange form of Newton – Cotes formula.
3.2d Boole’s quadrature rule The Boole’s quadrature rule is obtained from Newton-Cotes formula for n = 4. With n = 4, the number of values in (3.2) is 5 and then from difference table, we get ∆y0 , L, ∆4 y0 . The differences beyond ∆4 y0 do not exist. Then the Newton – Cotes formula takes the form b
x0 + 4 h
a
x0
I = ∫ f ( x) dx = ∫ f ( x) dx 1 5 4 6( 4) 3 − 45(4) 2 + 110(4) − 90 4 ∆ y0 ~ 4hy0 + 16h ∆y0 + ∆2 y0 + ∆3 y0 + 12 24 720 2 5 2 7 ~ 4h y0 + 2∆y0 + ∆2 y0 + ∆3 y0 + ∆4 y0 3 3 90 ~
4h [ 90 y0 + 180( y1 − y0 ) + 150( E − 1) 2 y0 + 60( E − 1) 3 y0 + 7( E − 1) 4 y0 ] 90
~
4h [ 90 y0 + 180( y1 − y0 ) + 150( E 2 − 2 E + 1) y0 + 60( E 3 − 3E 2 + 3E − 1) y0 90 + 7( E 4 − 4 E 3 + 6 E 2 − 4 E + 1) y0 ]
~
4h [ 90 y0 + 180( y1 − y0 ) + 150( y 2 − 2 y1 + y0 ) + 60( y3 − 3 y 2 + 3 y1 − y0 ) 90 + 7( y4 − 4 y3 + 6 y2 − 4 y1 + y0 )]
⇒
x4
x0 + 4 h
x0
x0
∫ f ( x) dx = ∫ f ( x) dx ~
2h [ 7 y0 + 32 y1 + 12 y 2 + 32 y3 + 7 y 4 ] 45
(3.13)
This is the Boole’s quadrature formula.
403
Remark. In this case the polynomial is of degree 4. Hence while applying the rule, the number of
subintervals should be a multiple of 4. It implies that a minimum number of ordinates required is 5. Thus if the given interval is [a, b], then divide it into 4 equal subintervals with step size h=
b−a 4
and get the values of x : x0 , x1 = x0 + h, x2 = x0 + 2h, x3 = x0 + 3h, x4 = x0 + 4h etc. Problem 3.5 4
Evaluate ∫
0
1 dx by using Boole’s rule. 1 + x2
Solution. Here interval is [0, 4]. We break it into four sub-intervals of step size
h=
4−0 = 1. 4
Then the values of x are x0 = 0, x1 = x0 + h = 1, x2 = x0 + 2h = 2, x3 = x0 + 3h = 3 and x4 = x0 + 4h = 4. The corresponding values of y = y ( x) =
1 are as follows: 1 + x2
y0 = y ( x0 ) =
1 =1 1+ 0
y1 = y ( x1 ) = y (1) =
1 1 = = 0 .5 1 + 12 2
y2 = y ( x2 ) = y (2) =
1 1 = = 0.2 2 5 1+ 2
y3 = y ( x3 ) = y (3) = y4 = y ( x4 ) = y (4) =
1 1 = = 0.1 2 1 + 3 10
1 1 = = 0.0588 1 + 42 17
With these values the Simpson three-eight rule (3.13) gives 4
∫
0
1 2(1) dx ~ [ 7(1) + 32(0.5) + 12(0.2) + 32(0.1) + 7(0.0588)] = 1.2894 2 45 1+ x
3.2e Weddle’s quadrature rule The Weddle’s rule is considered to be more accurate than any of the four rules studied so far. It can be obtained from the Newton – Cotes formula for n = 6. In this case the number of nodes 404
being n + 1 = 6 + 1 = 7, we have the differences ∆y0 ,L, ∆6 y0 . Beyond these differences do not exist. Then the Newton – Cotes formula has the form x0 + 6 h
I = ∫ f ( x) dx x0
1 (12 − 3) 2 ( 6 − 2) 2 3 6(6) 3 − 45(6) 2 + 110(6) − 90 4 ~ 6hy0 + 36h ∆y0 + ∆ y0 + ∆ y0 + ∆ y0 12 24 720 2
+ h(36) +
2(6) 4 − 24(6)3 + 105(6) 2 − 200(6) + 144 5 ∆ y0 1440
36h (6)5 5(6) 4 225(6) 2 274(6) − + 17(6)3 − + − 60 ∆6 y0 6! 7 2 4 3
9 16 3 1296 − 1620 + 660 − 90 4 1 ∆ y0 + ∆ y0 ~ 6hy0 + 36h ∆y0 + ∆2 y0 + 12 24 720 2 + h(36) +
2592 − 5184 + 3780 − 1200 + 144 5 ∆ y0 1440
36h 7776 6480 8100 1644 − + 3672 − + − 60 ∆6 y0 6! 7 2 4 3
~ 6h y0 + 18h ∆y0 + 27 h ∆2 y0 + 24h ∆3 y0 +
123 4 33 41 h ∆ y0 + h ∆5 y0 + h ∆6 y0 10 10 140
When h and ∆6 y0 are sufficiently small, the term
41h 6 42h 6 ∆ y0 can be replaced by ∆ y0 140 140
because in this case the | error | =
41h 6 42h 6 1 6 ∆ y0 − ∆ y0 = ∆ y0 140 140 140
is negligible. Then after the replacement, we get x0 + 6 h
2 3 ∫ f ( x) dx ~ 6h y0 + 18h ∆y0 + 27 h ∆ y0 + 24h ∆ y0 +
x0
~
123 4 33 42 h ∆ y0 + h ∆5 y0 + h ∆6 y0 10 10 140
3h [20 y0 + 60 ∆y0 + 90 ∆2 y0 + 80 ∆3 y0 + 41 ∆4 y0 + 11 ∆5 y0 + ∆6 y0 ] 10
Writing ∆ = E − 1, above becomes x0 + 6 h
∫ f ( x) dx ~
x0
3h [ 20 y0 + 60 ( y1 − y0 ) + 90 ( E − 1) 2 y0 + 80 ( E − 1) 3 y0 10 + 41( E − 1) 4 y0 + 11( E − 1)5 y0 + ( E − 1)6 y0 ] 405
~
3h [−40 y0 + 60 y1 + 90( E 2 − 2 E + 1) y0 + 80( E 3 − 3E 2 + 3E − 1) y0 10 + 41( E 4 − 4 E 3 + 6 E 2 − 4 E + 1) y0 + 11( E 5 − 5 E 4 + 10 E 3 − 10 E 2 + 5E − 1) y0 + ( E 6 − 6 E 5 + 15 E 4 − 20 E 3 + 15 E 2 − 6 E + 1) y0 ]
~
3h [−40 y0 + 60 y1 + 90( y 2 − 2 y1 + y0 ) + 80( y3 − 3 y 2 + 3 y1 − y0 ) 10 + 41( y4 − 4 y3 + 6 y2 − 4 y1 + y0 ) + 11( y5 − 5 y4 + 10 y3 − 10 y2 + 5 y1 − y0 ) + ( y6 − 6 y5 + 15 y4 − 20 y3 + 15 y2 − 6 y1 + y0 )], Q E i y0 = yi
~
3h ( y0 + 5 y1 + y 2 + 6 y3 + y 4 + 5 y5 + y6 ) 10
(3.14)
This is the Weddle’s quadrature formula. Remark. In this case the polynomial y (x) is of degree six and hence the formula becomes
operative only if the number n of sub-intervals is a multiple of 6. Obviously a minimum number of ordinates required is 7. Hence if the interval of integration is [a, b], then break it into six equal sub-intervals each of step size h=
b−a . 6
Problem 3.6 6
Evaluate ∫
0
1 dx by using Weddle’s rule. 1 + x2
Solution. Here interval is [0, 6]. Since Weddle’s rule is applicable only when a minimum number
of subintervals is 6, we divide this interval into 6 equal sub-intervals each of step size h=
6−0 = 1. 6
Then the values of x are x0 = 0, x1 = x0 + h = 1, x2 = x0 + 2h = 2, x3 = x0 + 3h = 3 , x4 = x0 + 4h = 4, x5 = x0 + 5h = 5 and x6 = x0 + 6h = 6. The corresponding values of y = y ( x) =
1 are as follows: 1 + x2
y0 = y ( x0 ) =
406
1 =1 1+ 0
y1 = y ( x1 ) = y (1) =
and
1 1 = = 0 .5 2 2 1+1
y2 = y ( x2 ) = y (2) =
1 1 = = 0.2 2 5 1+ 2
y3 = y ( x3 ) = y (3) =
1 1 = = 0.1 2 1 + 3 10
y4 = y ( x4 ) = y (4) =
1 1 = = 0.0588 1 + 42 17
y5 =
1 1 = = 0.0385 2 26 1+ 5
y6 =
1 1 = = 0.0270 2 37 1+ 6
Substituting these values in (3.14), we get 6
∫
0
1 3(1) dx ~ [1 + 5(0.5) + (0.2) + 6(0.1) + (0.0588) + 5(0.0385) + (0.0270)] 2 10 1+ x ~ 1.3735
The exact value of the integral is 6
∫
0
1 dx = [tan −1 x]60 = tan −1 6 − tan −1 0 = tan −1 6 2 1+ x
Problem 3.7
Consider integration of the function y ( x) =
1 1+ x
(a1)
over the fixed interval [0, 6]. Apply the various quadrature formulae (3.10) to (3.14). Hint. The calculations are correct to four decimal places. Solution. The problem is to evaluate the integral 6
dx 0 1+ x 6
I = ∫ y ( x) dx = ∫ 0
(a2)
by applying the five quadrature methods studied above. Its exact solution is easy to compute and hence we first do that.
407
Exact solution. We have
dx = [ln(1 + x)]60 = ln(1 + 6) − ln(1 + 0) = ln 7 − ln1 = 1.9459 − 0 = 1.9459 0 1+ x 6
I =∫
(a3)
(a) Trapezoidal rule
Here x0 = 0, x1 = 6. The step size is h = 6 − 0 = 6. Then (a1) ⇒ y0 = y ( x0 ) = y (0) = y1 = y ( x1 ) = y (6) =
and
1 =1 1+ 0
1 1 = = 0.1429 1+ 6 7
The trapezoidal rule is I~
6 h ( y0 + y1 ) = (1 + 0.1429) = 2(1.1429) = 2.2858 2 3
(b) Simpson’s one-third rule
Since for this rule the number of subintervals of equal length must be even, we divide the interval [0, 6] into two equal subintervals of step size h=
6−0 =3 2
Then the nodes i.e. the values of x are x0 = 0, x1 = x0 + h = 0 + 3 = 3, x2 = x0 + 2h = 0 + 6 = 6 Corresponding values of y are obtained from (a1): y0 = y ( x0 ) = y (0) = 1 , see case (a) y1 = y ( x1 ) = y (3) = y 2 = y ( x 2 ) = y ( 6) =
1 1 = = 0.25 1+ 3 4
1 = 0.1429, see case (a) 7
The Simpson one-third rule is I~
3 h ( y0 + 4 y1 + y 2 ) = [1 + 4(0.25) + 0.1429] = 2.1429 3 3
(c) Simpson’s three-eighth rule
The rule is applicable if the number of subintervals of equal length be multiple of three. For this we divide the interval [0, 6] into three equal subintervals of step size 408
h=
6−0 =2 3
Then the quadrature nodes are x0 = 0, x1 = x0 + h = 0 + 2 = 2, x2 = x0 + 2h = 0 + 4 = 4, x3 = x0 + 3h = 0 + 6 = 6 Corresponding values of y are obtained from (a1): y0 = y ( x0 ) = y (0) = 1 , see case (a) y1 = y ( x1 ) = y (2) =
1 1 = = 0.3333 1+ 2 3
y 2 = y ( x 2 ) = y ( 4) = y3 = y ( x3 ) = y (6) =
1 1 = = 0.2 1+ 4 5
1 = 0.1429, see case (a) 7
The Simpson’s three – eighth rule is I~
3h 6 3 ( y0 + 3 y1 + 3 y2 + y3 ) = [1 + 3(0.3333) + 3(0.2) + 0.1429] = (2.7428) = 2.0571 8 8 4
(d) Boole’s rule
For this rule the number of subintervals of equal length be multiple of four. Hence we divide the interval [0, 6] into four equal subintervals of step size h=
6−0 3 = = 1.5 4 2
Then the nodes are x0 = 0, x1 = x0 + h = 1.5, x2 = x0 + 2h = 3, x3 = x0 + 3h = 4.5, x4 = x0 + 4h = 6 Corresponding values of y are obtained from (a1): y0 = y ( x0 ) = y (0) = 1 , see case (a) y1 = y ( x1 ) = y (1.5) =
1 1 = = 0.4 1 + 1.5 2.5
y2 = y ( x2 ) = y (3) = y3 = y ( x3 ) = y ( 4.5) = y 4 = y ( x 4 ) = y ( 6) =
1 1 = = 0.25 1+ 3 4
1 1 = = 0.1818 1 + 4.5 5.5
1 = 0.1429, see case (a) 7 409
The Boole’s rule is I~
2h (7 y0 + 32 y1 + 12 y2 + 32 y3 + 7 y 4 ) 45
~
3 [7(1) + 32(0.4) + 12(0.25) + 32(0.1818) + 7(0.1429)] 45
~
1 (29.6179) 15
~ 1.9745 (e) Weddle’s rule
For this rule the number of subintervals of equal length be multiple of six. Hence we divide the interval [0, 6] into six equal subintervals of step size h=
6−0 =1 6
Then the nodes are x0 = 0, x1 = x0 + h = 1, x2 = x0 + 2h = 2, x3 = x0 + 3h = 3, x4 = x0 + 4h = 4, x5 = x0 + 5h = 5 x6 = x0 + 6 h = 6 Corresponding values of y are obtained from (a1): y0 = y ( x0 ) = y (0) = 1 , see case (a) y1 = y ( x1 ) = y (1) =
The Weddle’s rule is
410
1 1 = = 0 .5 1+1 2
y 2 = y ( x 2 ) = y ( 2) =
1 = 0.3333, see case (c) 3
y3 = y ( x3 ) = y (3) =
1 = 0.25, see case (d) 4
y 4 = y ( x 4 ) = y ( 4) =
1 = 0.2, see case (c) 5
y5 = y ( x5 ) = y (5) =
1 1 = = 0.1667 1+ 5 6
y 6 = y ( x 6 ) = y ( 6) =
1 = 0.1429, see case (a) 7
I~
3h ( y0 + 5 y1 + y 2 + 6 y3 + y 4 + 5 y5 + y6 ) 10
~
3 [1 + 5(0.5) + 0.3333 + 6(0.25) + 0.2 + 5(0.1667) + 0.1429] 10
~
3 (6.5097) 10
~ 1.9529 For comparison sake we put the above computations in the tabular form as follows: Rule
I
Error
Exact
1.9459
0
Trapezoidal
2.2858
0.3399
Simpson 1/3
2.1429
0.197
Simpson 3/8
2.0571
0.1112
Boole
1.9745
0.0286
Weddle
1.9529
0.007
From the study it implies that the methods of Boole and Weddle are more accurate as compared to others and the Weddle’s method is the best amongst all. Problem 3.7 3
Evaluate ∫
0
dx by Simpson three-eighth quadrature formula. 1 + x3
Solution. Here we divide the interval [0, 3] into three subintervals of step size
h=
3−0 =1 3
Then the quadrature nodes are x0 = 0, x1 = 1, x2 = 2, x3 = 3 Denoting y =
1 , we have 1 + x3 411
y 0 = y ( x 0 ) = y ( 0) = y1 = y ( x1 ) = y (1) = y 2 = y ( x 2 ) = y ( 2) = y3 = y ( x3 ) = y (3) =
1 =1 1+ 0
1 1 = = 0 .5 3 2 1+1
1 1 = = 0.1111 3 9 1+ 2
1 1 = = 0.0357 3 28 1+ 3
Simpson’s three-eighth rule is 3
∫ y ( x) dx ~
0
3h 3 ( y0 + 3 y1 + 3 y2 + y3 ) = [1 + 1.5 + 0.3333 + 0.0357] = 1.0759 8 8
Problem 3.8 π/ 2
Use Boole’s five point formula to evaluate ∫
sin x dx.
0
Solution. The given interval [0, π / 2] is subdivided into four with step size
h=
( π / 2) − 0 π = 4 8
The quadrature five nodes are x0 = 0, x1 = 0 + h =
3π π π π , x2 = 0 + 2h = , x3 = 0 + 3h = , x4 = 0 + 4h = 8 4 8 2
Let y ( x) = sin x . Then y0 = y ( x0 ) = y (0) = sin 0 = 0
y1 = y ( x1 ) = y (π / 8) = sin( π / 8) = 0.6186 y 2 = y ( x2 ) = y (π / 4) = sin(π / 4) = 0.8409 y3 = y ( x3 ) = y (3π / 8) = sin(3π / 8) = 0.9612 y 4 = y ( x4 ) = y (π / 2) = sin(π / 2) = 1 Boole’s quadrature rule is π/ 2
∫
0
412
sin x dx ~
2h [7 y0 + 32 y1 + 12 y 2 + 32 y3 + 7 y 4 ] 45
~
π [7(0) + 32(0.6186) + 12(0.8409) + 32(0.9612) + 7(1)] 180
~
π [ 67.6444] 180
~ 1.1806 MCQ 3.1 1
Consider that ∫
0
by exact method α dx . = 2 1+ x β by trapezoidal method
Choose the true statement from the following: (A) α < β (B) α > β (C) α ≤
π 4
(D) β ≤ 1 MCQ 3.2
On the fixed interval [ x0 , xn ], we have d = the number of quadrature nodes for Weddle’s method and
b = the number of quadrature nodes for Boole’s method.
Consider the statements: (i) Weddle’s method is more accurate than Boole’s method (ii) d > b Choose the correct statement from the following: (A) Both (i) and (ii) are true and (ii) is the reason for (i). (B) Both (i) and (ii) are true and (ii) is not the reason for (i). (C) Only (i) is true. (D) Only (ii) is true. SAQ 3.2
Deduce Boole’s quadrature formula from Lagrange interpolation formula. 413
SAQ 3.3
dx by Simpson three-eighth rule and Boole’s rule. x + x +1
1
Evaluate ∫
3
0
SAQ 3.4 2.48
Estimate ∫ ln x dx by Boole’s rule and Weddle’s rule. 2
SAQ 3.5
Find the value of the integral
π/8
∫
cos x dx by trapezoidal and Simpson one-third rule.
0
SUMMARY
The role of interpolating polynomial is worked out with reference to the process of integration. The general formula, called Newton – Cotes rule for numerical integration is deduced. Its Lagrange form is obtained. It is further shown that the five quadrature formulae: trapezoidal rule, Simpson’s one-third rule, Simpson’s three-eighth rule, Booole’s rule and Weddle’s rule are deduced from Newton-Cotes formula. Various problems are solved to illustrate the role of these formula in numerical integration.
KEY WORDS
Numerical integration Newton-Cotes formula Lagrange interpolation rule Trapezoidal rule Simpson’s one-third rule Simpson’s three-eighth rule Boole’s rule Weddle’s rule
414
UNIT 04-04: NUMERICAL INTEGRATION CONTINUED (COMPOSITE QUADRATURE RULES)
415-438
LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain Composite quadrature rules: trapezoidal, Simpson one-third, Simpson three-eighth, Boole, Weddle to estimate the integrals
Apply the these rules to estimate the definite integrals
INTRODUCTION In the previous unit, the concept of numerical integration to estimate the definite integral was introduced and explained. Thereafter, Newton-Cotes quadrature formula was established for estimating the definite integrals. It was shown that from this seminal formula, the rules of numerical integration comprising trapezoidal rule, Simpson’s one-third rule, Simpson’s threeeighth rule, Boole’s rule and Weddle’s rule follow as special cases. In all these exercises, it was presumed that the interval of integration [a, b] = [ x0 , xn ] is fixed. Therefore, all the above said
rules were confined to a fixed interval. Hence if the integrand is specified by n + 1 quadrature
nodes x, the working of these rules was not answered. This unfinished job is fulfilled by the concept of composite quadrature rules, starting from composite trapezoidal rule to composite Weddle’s rule. Basically composite rules are meant for quadrature rules when the data is provided in terms of n + 1 nodes or n subintervals. The background for composite rule is that the function y = f (x), which is the integrand for numerical integration, is given by the following n + 1 values: x: x0 y = f ( x) : y0
x1 L xn y1 L y n
(4.1a)
where the values of x are equally spaced with step size h=
xn − x0 . n
(4.1b)
Thus the interval [ x0 , xn ] is subdivided into n subintervals of width h. The quadrature nodes are xi = x0 + i h, i = 0,1,L, n
(4.2)
To make the composite rules compatible, the corresponding values of n are adjusted. This process of choosing n for a rule is explained while discussing the rule concerned. Various problems are solved to illustrate the application of the rules. 415
4.1 Composite trapezoidal quadrature rule We know that the trapezoidal rule is applicable to a single interval with two nodes: x0 and x1. Now we have n + 1 nodes: x0 , x1 , L, xn −1 , xn and n subintervals: [ x0 , x1 ], [ x1 , x2 ], L, [ xn −1 , xn ]. For details see Fig 4.1. Hence the trapezoidal rule is applicable to each of the above n subintervals. Then we have interval [ x0 , x1 ] ⇒
interval [ x1 , x2 ] ⇒
interval [ x2 , x3 ] ⇒
x1
∫ f ( x) dx ~
x0
x2
∫ f ( x) dx ~
x1 x3
∫ f ( x) dx ~
x2
h ( y0 + y1 ) 2 h ( y1 + y 2 ) 2 h ( y 2 + y3 ) 2
M
interval [ xn −1 , xn ] ⇒
xn
∫ f ( x) dx ~
xn−1
h ( y n −1 + y n ) 2
Adding all integrals, we get x1
x2
xn
x0
x1
xn−1
∫ f ( x) dx + ∫ f ( x) dx + L + ∫ f ( x) dx =
h h h ( y0 + y1 ) + ( y1 + y 2 ) + L + ( y n −1 + y n ) 2 2 2
h ~ [( y0 + y1 ) + ( y1 + y2 ) + ( y2 + y3 ) + L + ( yn − 2 + y n −1 ) + ( y n −1 + y n )] 2 ⇒
xn
h ∫ f ( x) dx ~ [( y0 + y1 ) + ( y1 + y 2 ) + ( y 2 + y3 ) + L + ( y n − 2 + y n −1 ) + ( y n −1 + yn )] 2 x0 h ~ [( y0 + y n ) + 2( y1 + y 2 + L + y n −1 )] 2
This is the formula for composite trapezoidal quadrature rule. Remark. The formula (4.3) can be conveniently remembered as
416
(4.3)
xn
∫ f ( x) dx
x0
h ~ [ (sum of the first and the last ordinates) + 2( sum of the remaining ordinates )] 2
(4.3)
Geometrical interpretation Pn −1
y
P1
Fig 4.1 y0
y1
t1 O
y = f (x)
P2
P0
t2
x0
Pn
y n −1
y2
x1
tn x2
xn −1
yn x
xn
Here we have a series of trapeziums: trapezium 1: formed by the interval [ x0 , x1 ] , y0 , y1 , P0 P1 , t1 = area =
h ( y0 + y1 ) 2
trapezium 2: formed by the interval [ x1 , x2 ] , y1 , y 2 , P1 P2 , t 2 = area =
h ( y1 + y 2 ) 2
M trapezium n: formed by the interval [ xn −1 , xn ], y n −1 , y n , Pn −1 Pn , t n = area =
h ( y n −1 + yn ) 2
Sum of the area of n trapeziums is given by T = t1 + t 2 + L + t n h = [ ( y0 + y1 ) + ( y1 + y 2 ) + L + ( y n −1 + y n )] 2 h = [ ( y0 + y1 ) + 2( y 2 + y3 + L + y n −1 )] 2 We know, from calculus, that the area bounded by the curve y = f (x), the x - axis, the two ordinates x = x0 and x = xn is given by xn
A = ∫ f ( x) dx x0
From Fig 4.1, we observe that the area A is approximated by the area T . This is the content of the composite trapezoidal rule.
417
Problem 4.1 1
Evaluate ∫
0
dx using composite trapezoidal rule taking h = 0.2. 1 + x2
Solution. Here we have
y ( x) =
1 , x0 = 0, xn = 1, h = 0.2 1 + x2
We know that the step size is given by h=
⇒
0.2 =
xn − x0 n
1− 0 1 i.e. n = =5 n 0 .2
Then the nodes are x0 = 0, x1 = 0 + h = 0.2, x2 = 0 + 2h = 0.4, x3 = 0 + 3h = 0.6, x4 = 0 + 4h = 0.8 x5 = 0 + 5h = 1.0
and
Corresponding values of the ordinates are
y0 =
1 1 = =1 2 1+ 0 1 + ( x0 )
y1 =
1 1 1 = = = 0.9615 2 2 1 + 0.04 1 + ( x1 ) 1 + ( 0 .2 )
y2 =
1 1 1 = = = 0.8621 2 2 1 + 0.16 1 + ( x2 ) 1 + (0.4)
y3 =
1 1 1 = = = 0.7353 2 2 1 + 0.36 1 + ( x3 ) 1 + ( 0 .6 )
y4 =
1 1 1 = = = 0.6098 2 2 1 + 0.64 1 + ( x4 ) 1 + (0.8) y5 =
1 1 1 = = = 0 .5 2 2 1 + 1 1 + ( x5 ) 1+1
By composite trapezium rule, we have 1
∫
0
dx h ~ [( y0 + y5 ) + 2( y1 + y 2 + y3 + y 4 )] 2 2 1+ x ~
418
0 .2 [(1 + 0.5) + 2(0.9615 + 0.8621 + 0.7353 + 0.6098)] 2
~ 0.1[1.5 + 2(3.1687)] ~ 0.7837 The exact value of the integral is 1
∫
0
dx π = [tan −1 x]10 = tan −1 1 − tan −1 0 = − 0 = 0.7854 2 4 1+ x
Then the error is 0.7854 − 7837 = 0.0017 MCQ 4.1 2
Consider the integral I = ∫ x 4 dx. Let 0
At = estimated value of I by the trapezoidal rule with four subintervals and
AE = exact value of I .
Then (a) At < AE (b) At > AE (c) | AE − At | > 1 (d) 0.5 < | AE − At | < 1 SAQ 4.1 4
Evaluate ∫ x sec x dx using eight intervals by composite trapezoidal rule. 0
4.2 Composite Simpson’s one-third rule Let the function y = f (x) be given by (4.1). The number n of subintervals are [ x0 , x1 ], [ x1 , x2 ], [ x2 , x3 ], [ x3 , x4 ], L, [ x xn−2 , xn −1 ], [ xn −1 , xn ]
(4.4)
For the Simpson quadrature rule [ see (3.11) of the unit 3]: x2
∫ f ( x) dx ~
x0
h ( y0 + 4 y1 + y 2 ) 3
(4.5)
there are two subdivisions [ x0 , x1 ] and [ x1 , x2 ]. If this rule is to be made applicable for n subintervals in (4.1), then
n must be a multiple of 2 i.e. n must be even. Let n be an even 419
integer i.e. n = 2m for some positive integer m. Then the rule (4.5) is applicable to the subintervals in (4.3) for n = 2m :
[ x0 , x1 ], [ x1 , x2 ], [ x2 , x3 ], [ x3 , x4 ], L, [ x x2 m−2 , x2 m −1 ], [ x2 m −1 , x2 m ] Writing the formula (4.5) for these subintervals, we have x4
intervals [ x2 , x3 ] and [ x3 , x4 ] : ∫ f ( x) dx ~ x2 x6
intervals [ x4 , x5 ] and [ x5 , x6 ] : ∫ f ( x) dx ~ x4
h ( y 2 + 4 y3 + y 4 ) 3 h ( y 4 + 4 y5 + y 6 ) 3
(4.6)
M
intervals [ x2 m − 2 , x2 m −1 ] and [ x2 m −1 , x2 m ] :
x2 m
∫ f ( x) dx ~
x2 m−2
h ( y 2 m − 2 + 4 y 2 m −1 + y 2 m ) 3
Adding (4.5) and (4.6), we get x1
x2
x3
x4
x2 m−1
x2 m
x0
x1
x2
x3
x2 m− 2
x2 m−1
∫ f ( x) dx + ∫ f ( x) dx + ∫ f ( x) dx + ∫ f ( x) dx + L + ∫ f ( x) dx + ∫ f ( x) dx
~
⇒
h [( y0 + 4 y1 + y 2 ) + ( y 2 + 4 y3 + y 4 ) + L + ( y 2 m − 2 + 4 y2 m −1 + y 2 m )] 3
x2 m
h ∫ f ( x) dx ~ [( y0 + 4 y1 + y 2 ) + ( y 2 + 4 y3 + y 4 ) + L + ( y 2 m − 2 + 4 y 2 m −1 + y 2 m )] 3 x0 h ~ [( y0 + y 2 m ) + 2( y 2 + y4 + L y 2 m − 2 ) + 4( y1 + y3 + L + y 2 m −1 )] 3 xn
h ∫ f ( x) dx ~ [( y0 + y n ) + 2( y 2 + y 4 + L y n − 2 ) + 4( y1 + y3 + L + y n −1 )] 3 x0
⇒
(4.7)
This is the required composite Simpson’s one-third qudrature rule. This can be remembered in the form xn
h ∫ f ( x) dx ~ [(sum of the first and the last ordinates) 3 x0 + 2(sum of the other even ordinates) + 4(some of other odd ordinates)] (4.8)
Remark. In fact y 2 , y 4 , L are placed at odd places and hence one may treat them as odd
ordinates. With this convention, it creates confusion. To avoid this we go by the suffix convention: k is even ⇒ y k is even 420
Problem 4.2
The table below shows the temperature f (t ) as a function of time: 0 1 2 3 4 5 6 7 8 . y = f (t ) : 70 81 83 87 90 80 75 72 71 t
8
Use Simpson one-third rule evaluate ∫ f (t ) dt. 0
Solution. Here n = 8 = even and hence Simpson rule is applicable. We have
x0 = 0, h = 1, x8 = 8
The ordinates are y0 = 70, y1 = 81, y 2 = 83, y3 = 87, y 4 = 90, y5 = 80, y6 = 75, y7 = 72, y8 = 71
Then using the formula (4.7), we have 1 ∫ f (t ) dt ~ [(70 + 71) + 2(83 + 90 + 75) + 4(81 + 87 + 80 + 72)] 3 0
8
~ 639 MCQ 4.2
Using Simpson one-third rule for the following tabular data: x : − 3 − 2 −1 1 2 y:
0
2
4
6 8
one obtains the values 2
8
−3
0
I = ∫ y ( x) dx ~ 16 and J = ∫ x( y ) dy ~ −
14 3
Choose the true statement/s from the following: (A) Simpson one-third rule is not applicable to find I . (B) Simpson one-third rule is applicable to find I and J and the values are correct. (C) Simpson one-third rule is not applicable to find J . (D) Simpson one-third rule is applicable to find J and its value is correct. SAQ 4.2 0.4
Estimate ∫ e x by composite Simpson’s rule with step size h = 0.1 and compare the result with 0
its exact value. 421
4.3 Composite Simpson’s three-eighth rule We know that for Simpson’s three-eighth rule x3
∫ f ( x) dx ~
x0
3h ( y0 + 3 y1 + 3 y 2 + y3 ) 8
(4.9)
there are three subintervals: [ x0 , x1 ], [ x1 , x2 ] and [ x2 , x3 ] Consequently this rule can be made workable for n subintervals in (4.1) only if n is a multiple of three. Let n = 3m, for some positive integer m. Then the qudrature nodes are x0 , x1 = x0 + 3h, x2 = x0 + 6h, L, xn −1 = x0 + 3(m − 1)h, xn = x0 + 3mh Then (4.9) is applicable on the subintervals [ x0 , x1 ], [ x1 , x2 ], L,[ xn −1 , xn ] ⇒
x`1
x`0 + 3 h
x0
x0
x`2
x`0 + 6 h
x1
x0 + 3 h
∫ f ( x) dx =
∫ f ( x) dx =
∫ f ( x) dx ~
∫ f ( x) dx ~
3h ( y0 + 3 y1 + 3 y 2 + y3 ) 8 3h ( y0 + 3 y1 + 3 y 2 + y3 ) 8
M x`n
x`0 + 3 m
xn−1
x0 + 3( m −1)
∫ f ( x) dx =
∫
f ( x) dx ~
3h ( y3m −3 + 3 y3m − 2 + 3 y3m −1 + y3m ) 8
Adding the above integrals, we get x`1
x`2
x`n
x0
x1
xn−1
∫ f ( x) dx + ∫ f ( x) dx + L + ∫ f ( x) dx
~
3h 3h ( y0 + 3 y1 + 3 y 2 + y3 ) + ( y3 + 3 y 4 + 3 y5 + y6 ) 8 8 +L+
⇒
xn
∫ f ( x) dx ~
x0
3h ( y3m −3 + 3 y3m − 2 + 3 y3m −1 + y3m ) 8
3h [( y0 + y3m ) + 3( y1 + y 2 + y 4 + y5 + L + y3m − 2 + y3m −1 ) 8 + 2( y3 + y6 + y9 + L + y3m −3 )]
422
xn
⇒
∫ f ( x) dx ~
x0
3h [( y0 + y n ) + 3( y1 + y 2 + y 4 + y5 + L + y n − 2 + y n −1 ) 8 + 2( y3 + y6 + y9 + L + y n −3 )]
(4.10)
Above gives the composite Simpson’s three-eighth formula. Problem 4.3
The table below shows the temperature f (t ) as a function of time: t 0 1 2 3 4 5 6 7 8 9 y = f (t ) : 70 81 83 87 90 80 75 72 71 60 8
Use Simpson three-eighth rule to evaluate ∫ f (t ) dt. 0
Solution. Here n = 9 = multiple of three and hence Simpson three-eighth rule is applicable. We
have x0 = 0, h = 1, xn = 9 The ordinates are y0 = 70, y1 = 81, y 2 = 83, y3 = 87, y 4 = 90, y5 = 80, y6 = 75, y7 = 72, y8 = 71, y9 = 60 In this case the formula (4.10) becomes 8
∫ f ( x) dx ~
0
3h [( y0 + y9 ) + 3( y1 + y2 + y4 + y5 + y7 + y8 ) + 2( y3 + y6 )] 8
3 ~ [(70 + 60) + 3(81 + 83 + 90 + 80 + 72 + 71) + 2(87 + 75)] 8 ~ 706.875 Problem 4.4
Using composite Simpson three-eighth formula evaluate the integral 0.6
I= ∫
1 − x 3 dx.
0
by choosing the number of subintervals six. Solution. Since the number of subintervals n = 6, the Simpson rule is applicable. Here the step
size h=
0 .6 − 0 = 0 .1 6 423
Then the function y = f (x) is specified by 7 nodes: x0 = 0, x1 = 0.1, x2 = 0.2, x3 = 0.3, x4 = 0.4, x6 = 0.5, x7 = 0.6 The corresponding values of y = 1 − x 3 are given as follows: y 0 = y ( 0) = 1 − 0 = 1 y1 = y (0.1) = 1 − (0.1) 2 = 0.999 = 0.9995 y 2 = y (0.2) = 1 − (0.2) 3 = 0.992 = 0.9960 y3 = y (0.3) = 1 − (0.3) 3 = 0.973 = 0.9864 y 4 = y (0.4) = 1 − (0.4) 3 = 0.936 = 0.9675 y5 = y (0.5) = 1 − (0.5) 3 = 0.875 = 0.9354 y6 = y (0.6) = 1 − (0.6) 3 = 0.784 = 0.8854 In this case the formula (4.10) has the form 8
∫ f ( x) dx ~
0
~
3h [( y0 + y6 ) + 3( y1 + y2 + y 4 + y5 ) + 2( y3 )] 8 0 .3 [(1 + 0.8854) + 3(0.9995 + 0.9960 + 0.9675 + 0.9354) + 2(0.9864)] 8
~ 0.5833 MCQ 4.3 b
A certain integral I = ∫ f ( x) dx is compatible for its estimation by Simpson one-third and a
Simpson three-eighth rules with given step size h. Then the point (a, b, h) lies on the plane (A) x + y + 6 z = 0 (B) x + y − 6 z = 0 (C) x − y + 6 z = 0 (D) x − y − 6 z = 0
424
SAQ 4.3 1.4
Compute the value of ∫ (sin x − ln x) dx by using composite Simpson three-eighth rule. 0.2
4.4 Composite Boole’s rule We know that Boole’s quadrature formula x4
x0 + 4 h
x0
x0
∫ f ( x) dx = ∫ f ( x) dx ~
2h [ 7 y0 + 32 y1 + 12 y 2 + 32 y3 + 7 y 4 ] 45
(4.11)
involves four subintervals:
[ x0 , x1 ], [ x1 , x2 ], [ x2 , x3 ] and [ x3 , x4 ]. It thus implies that this rule can be extended to n subintervals in (4.1) only if n is a multiple of 4 i.e. n = 4m, for some positive integer m. Then the rule (4.11) is applicable to subintervals:
[ x0 , x0 + 4h], [ x0 + 4h, x0 + 8h], [ x0 + 8h, x0 + 12h], L,[ x0 + (4m − 4)h, x0 + (4m)h] ⇒
x8
x0 + 8 h
x4
x0 + 4 h
x12
x0 +12 h
x8
x0 + 8 h
∫ f ( x) dx = ∫ f ( x) dx ~
∫ f ( x) dx =
∫ f ( x) dx ~
2h [ 7 y 4 + 32 y5 + 12 y6 + 32 y7 + 7 y8 ] 45 2h [ 7 y8 + 32 y9 + 12 y10 + 32 y11 + 7 y12 ] 45
M x4 m
x0 + ( 4 m ) h
x4 m−4
x0 + ( 4 m − 4 ) h
∫ f ( x) dx =
∫
f ( x) dx ~
2h [ 7 y 4 m − 4 + 32 y4 m −3 + 12 y4 m − 2 + 32 y 4 m −1 + 7 y 4 m ] 45
Adding the integrals, we get x4
x8
x12
x4 m
x0
x4
x8
x 4 m−4
∫ f ( x) dx + ∫ f ( x) dx + ∫ f ( x) dx + L + ∫ f ( x) dx
~
2h [( 7 y0 + 32 y1 + 12 y 2 + 32 y3 + 7 y 4 ) + (7 y 4 + 32 y5 + 12 y6 + 32 y7 + 7 y8 ) 45 + ( 7 y8 + 32 y9 + 12 y10 + 32 y11 + 7 y12 ) + L + (7 y 4 m − 4 + 32 y 4 m −3 + 12 y 4 m − 2 + 32 y 4 m −1 + 7 y 4 m ]
⇒
x4 m
∫ f ( x) dx ~
x0
2h [7( y0 + y4 m ) + 32( y1 + y3 + y5 + y7 + y9 + y11 + L + y 4 m −3 + y 4 m −1 ) 45 + 12( y 2 + y6 + y10 + L + y 4 m − 2 ) + 14( y 4 + y8 + y12 + L + y 4 m − 4 )]
(4.12a) 425
or
xn
∫ f ( x) dx ~
x0
2h [7( y0 + y n ) + 32( y1 + y3 + y5 + y7 + y9 + y11 + L + y n −3 + y n −1 ) 45 + 12( y 2 + y6 + y10 + L + y n − 2 ) + 14( y 4 + y8 + y12 + L + y n − 4 )]
(4.12b)
The composite Boole’s formula is given by (4.12a) or (4.12b). Problem 4.5
The function y = f (x) is given by the following nine values:
x:
2
4
6
8
10 12 14 16 18
y = f ( x) : 10 18 20 24 30 36 28 20 10
.
18
Evaluate ∫ f ( x) dx by composite Boole’s composite method. 2
Solution. Here the number of subintervals is 8 and hence composite Boole’s rule is applicable.
The step size is given by h=
18 − 2 = 2. 8
The ordinates are y0 = 10, y1 = 18, y 2 = 20, y3 = 24, y 4 = 30, y5 = 36, y6 = 28, y7 = 20, y8 = 10 Then the composite Boole’s formula (4.12) gives 18
∫ f ( x) dx ~
2
2h [7( y0 + y8 ) + 32( y`1 + y3 + y5 + y7 ) + 12( y 2 + y6 ) + 14( y 4 )] 45
~
2 [7(10 + 10) + 32(18 + 24 + 36 + 20) + 12(20 + 28) + 14(30)] 45
~
2 [4272] 45
~ 189.8667 Problem 4.6 1.2
2
Using composite Boole’s formula estimate the integral ∫ e − x dx by taking 12 quadrature nodes. 0
Solution. Here the nodes are x0 = 0 to x12 = 1.2 and the step size of the 12 subintervals is
h=
426
1.2 − 0 = 0.1 12
2
Denote y ( x) = e − x . We have x0 = 0, x1 = x0 + h = 0.1, x2 = 0.2, x3 = 0.3, x4 = 0.4, x5 = 0.5, x6 = 0.6, x7 = 0.7, x8 = 0.8, x9 = 0.9, x10 = 1.0, x11 = 1.1, x12 = 1.2 The corresponding values of y (x) are as follows: y0 = y (0) = e −0 = 1 2
y1 = y (0.1) = e − ( 0.1) = e −0.01 = 0.9900 2
y2 = y (0.2) = e − ( 0.2 ) = e −0.04 = 0.9608 2
y3 = y (0.3) = e − ( 0.3) = e −0.09 = 0.9139 2
y 4 = y (0.4) = e − ( 0.4 ) = e −0.16 = 0.8521 2
y5 = y (0.5) = e − ( 0.5) = e −0.25 = 0.7788 2
y6 = y (0.6) = e − ( 0.6) = e −0.36 = 0.6977 2
y7 = y (0.7) = e − ( 0.7 ) = e −0.49 = 0.6126 2
y8 = y (0.8) = e − ( 0.8) = e −0.64 = 0.5273 2
y9 = y (0.9) = e − ( 0.9) = e −0.81 = 0.4449 2
y10 = y (1.0) = e − (1.0 ) = e −1 = 0.3679 2
y11 = y (1.1) = e − (1.1) = e −1.21 = 0.2982 2
y12 = y (1.2) = e − (1.2 ) = e −1.44 = 0.2369 In this case the composite Boole’s formula (4.12) takes the form 1.2
∫ f ( x) dx ~
0
2(0.1) [7( y0 + y12 ) + 32( y1 + y3 + y5 + y7 + y9 + y11 ) 45 + 12( y2 + y6 + y10 ) + 14( y4 + y8 )]
~
0.2 [7(1 + 0.2369) + 32(0.9900 + 0.9139 + 0.7788 + 0.6126 + 0.4449 + 0.2982) 45 + 12(0.9608 + 0.6977 + 0.3679) + 14(0.8521 + 0.5273)]
~
0.2 [7(1.2369) + 32(4.0384) + 12( 2.0264) + 14(1.3794)] = 0.8067 45 427
MCQ 4.4 b
The integral ∫ f ( x) dx is evaluated by composite Boole’s rule with step size h. Then it is a
probable that (A)
b−a ∈{12 ⋅ 1, 12 ⋅ 2, 12 ⋅ 3} h
(B)
b−a ∈{ 2 2 ⋅ 1, 2 2 ⋅ 2, 2 2 ⋅ 3} h
(C)
b−a ∈{ 32 ⋅ 1, 32 ⋅ 2, 32 ⋅ 3} h
(D)
b−a ∈{ 4 2 ⋅ 1, 4 2 ⋅ 2, 4 2 ⋅ 3} h
SAQ 4.4 1.6
Use composite Boole’s quadrature formula to estimate ∫ e
x
dx using step length 0.2.
0
4.5 Composite Weddle’s rule The Weddle’s rule x6
x0 + 6 h
x0
x0
∫ f ( x) dx = ∫ f ( x) dx ~
3h [ y0 + 5 y1 + y 2 + 6 y3 + y 4 + 5 y5 + y6 ] 10
(4.13)
is based on six subintervals: [ x0 , x1 ], [ x1 , x2 ], [ x2 , x3 ], [ x3 , x4 ], [ x4 , x5 ] and [ x5 , x6 ] Hence this rule can be extended to n subintervals in (4.1) only if
n is a multiple of 6 i.e.
n = 6m, for some positive integer m. Then the rule (4.13) is valid for subintervals: [ x0 , x6 ] = [ x0 , x0 + 6h], [ x6 , x12 ] = [ x0 + 6h, x0 + 12], [ x12 , x`18 ] = [ x0 + 12h, x0 + 18h], L,[ x6 m −6 , x6 m ] = [ x0 + (6m − 6) h, x0 + (6m) h]
⇒
x12
x0 +12 h
x6
x0 + 6 h
x18
x0 +18 h
x12
x0 +12 h
∫ f ( x) dx =
∫ f ( x) dx = M
428
∫ f ( x) dx ~
∫ f ( x) dx ~
3h [ y6 + 5 y7 + y8 + 6 y9 + y10 + 5 y11 + y12 ] 10 3h [ y12 + 5 y13 + y14 + 6 y15 + y16 + 5 y17 + y18 ] 10
x6 m
x0 + ( 6 m ) h
x6 m −6
x0 + ( 6 m − 6 ) h
∫ f ( x) dx =
∫
f ( x) dx ~
3h [ y6 m −6 + y6 m −5 + y6 m − 4 + 6 y6 m −3 + y6 m − 2 + 5 y6 m −1 + y6 m ] 10
Adding these integrals, we get x6
x12
x18
x6 m
x0
x6
x12
x 6 m −6
∫ f ( x) dx + ∫ f ( x) dx + ∫ f ( x) dx + L + ∫ f ( x) dx
~
3h [( y0 + 5 y1 + y 2 + 6 y3 + y 4 + 5 y5 + y6 ) + ( y6 + 5 y7 + y8 + 6 y9 + y10 + 5 y11 + y12 ) 10
+ ( y12 + 5 y13 + y14 + 6 y15 + y16 + 5 y17 + y18 ) + L + + ( y6 m −6 + 5 y6 m −5 + y6 m − 4 + 6 y6 m −3 + y6 m − 2 + 5 y6 m −1 + y6 m )] ⇒
x6 m
∫ f ( x) dx ~
x0
3h [( y0 + y 2 + y 4 + y8 + y10 + y14 + y16 + L + y6 m − 4 + y6 m − 2 + y6 m ) 10
+ 2( y6 + y12 + y18 + L + y6 m −6 ) + 5( y1 + y5 + y7 + y11 + y13 + y17 + L + y6 m −5 + y6 m −1 ) + 6( y3 + y9 + y15 + L + y6 m −3 )] ⇒
xn
∫ f ( x) dx ~
x0
3h [( y0 + y 2 + y 4 + y8 + y10 + y14 + y16 + L + yn − 4 + yn − 2 + yn ) 10
+ 2( y6 + y12 + y18 + L + yn −6 ) + 5( y1 + y5 + y7 + y11 + y13 + y17 + L + yn −5 + yn −1 ) + 6( y3 + y9 + y15 + L + yn −3 )]
(4.14)
This is the composite Weddle’s formula. Problem 4.7
A river is 60 meters wide. The depth d in meters at a distance x meters from one bank is given by the table below:
x: 0 5 10 15 20 25 30 35 40 45 50 55 60 . d = f ( x) : 0 3 6 8 11 15 20 18 14 10 5 2 0
(a1)
Calculate the cross-section of the river by composite Weddle’s rule. Solution. We know that area bounded by the curve y = f ( x), the x -axis and the two lines x = a
and x = b is given by the integral b
b
a
a
∫ y dx = ∫ f ( x) dx
(a2)
In the problem, d plays a role of y and the cross-section of a river means the area bounded by 429
d = f ( x), the x - axis and the two lines x = 0 and x = 60. Hence noting (a2), the cross-section, denoted by A, is given by 60
A = ∫ f ( x) dx 0
Note that d (depth) and d in dx are different. It is better to denote the depth by another variable
y instead of d to avoid confusion. The data in (a1) has 12 subintervals and hence Weddle’s formula (4.14) is applicable. In this case it has the form 60
A = ∫ f ( x) dx 0
~
3h [( y0 + y 2 + y 4 + y8 + y10 + y12 ) + 2( y6 ) + 5( y1 + y5 + y7 + y11 ) + 6( y3 + y9 )] 10
where y stands for d and h = 5. Noting the values from (a1), the cross-section is
A~
15 [(0 + 6 + 11 + 14 + 5 + 0) + 2(20) + 5(3 + 15 + 18 + 2) + 6(8 + 10)] 10
~ 561 meter 2 MCQ 4.5 b
Given that an integral I = ∫ f ( x) dx is compatible for estimation to the composite methods of a
Boole and Weddle with step sizes hB and hW respectively. Then the point (hB , hW ) lies on the straight line (A) 2 x − 3 y = 0 (B) 2 x + 3 y = 0 (C) 3x − 2 y = 0 (D) 3x + 2 y = 0 Problem 4.8 1
Find the value of ln 21/ 5 from ∫
0
x4 dx by using composite trapezoidal rule with h = 0.25. 1 + x5
Solution. The given integral is 1
x4 1 1 1 dx = ln (1 + x 5 ) = [ln(1 + 1) − ln(1 + 0)] = ln 2 = ln 21/ 5 5 5 5 5 0 1+ x 0
1
I= ∫ 430
(a1)
Now we use composite trapezoidal rule. Let y =
x4 . The step size is 0.25. Then the following 1 + x5
are the values of x and y : x0 = 0, x1 = 0.25, x2 = 0.50, x3 = 0.75, x4 = 1.0 y 0 = y ( 0) =
and
0 =0 1+ 0
y1 = y (0.25) =
(0.25) 4 0.0039 = = 0.0039 5 1 + 0.0010 1 + (0.25)
y 2 = y (0.50) =
(0.50) 4 0.0625 = = 0.0606 5 1 + 0.0313 1 + (0.50)
y3 = y (0.75) =
(0.75) 4 0.3164 = = 0.2557 5 1 + 0.2373 1 + (0.75)
y4 = y (1) =
1 = 0 .5 1+1
By composite trapezoidal rule, we write h I ~ [( y0 + y 4 ) + 2( y1 + y 2 + y3 )] 2 ⇒
I~
0.25 [(0 + 0.5) + 2(0.0039 + 0.0606 + 0.2557)] = 0.1426 2 ln 21/ 5 ~ 0.1426, by (a1)
⇒ Problem 4.9
1
2
Use the composite trapezoidal rule to evaluate the integral ∫ e x dx taking 10 intervals. 0
Solution. Given that n = 10. Then the step size is
h=
1− 0 = 0 .1 10
2
Let y = e x . Then the values of x and y are as follows: x:
0
y:
1 1.01 1.0408 1.0942 1.1735 1.284 1.4333 1.6323 1.8964 2.2479 2.7183 y0 y1 y2 y3 y4 y5 y6 y7 y8 y9 y10
0. 1
0 .2
0 .3
0. 4
0 .5
0 .6
0 .7
0. 8
0 .9
1. 0
In this case the composite trapezoidal rule is 431
h x2 ∫ e dx ~ [( y0 + y10 ) + 2( y1 + y 2 + y3 + y 4 + y5 + y6 + y7 + y8 + y9 )] 2 0
1
~
0 .1 [(1 + 2.7183) + 2(1.01 + 1.0408 + 1.0942 + 1.1735 + 1.284 + 1.4333 2
+ 1.6323 + 1.8964 + 2.2479)] ~
0 .1 (25.2415) = 1.2621 2
Problem 4.10
The velocity v of a particle moving in a straight line covers a distance x meters in time t sec. They are related as follows:
x : 0 10 20 30 40 50 60 70 80 . v : 40 60 65 60 55 50 30 20 10
(a1)
Find time taken to traverse the distance of 80 meters by (i) composite Simpson’s one-third rule and
(ii) composite Boole’s rule.
Hint. v =
dx dt
Solution. We know that the velocity at any time t is given by
v=
⇒
dt =
dx dt
dx = y dx v
(a2)
1 y= . v
where
Let at t = 0, x = 0. Suppose that the particle takes time T sec to cover the distance 80 meters i.e. at t = T , x = 80. We have to find the value of T . Integrating (a2) and taking the said limits of integration, we get T
80
t =0
0
∫ dt = ∫ y dx
⇒
80
[t ]T0 = ∫ y dx 0
432
80
T = ∫ y dx
or
(a2)
0
To evaluate (a2), we have to find the values of y from the given values of v. Then in terms of x and y the data (a1) transforms to the following:
0 10 20 30 40 50 60 70 80 x: y : 0.025 0.0167 0.0154 0.0167 0.0182 0.02 0.0333 0.05 0.1 y0 y1 y2 y3 y4 y5 y6 y7 y8 (i) Since the number of subintervals is even, composite Simpson’s one-third rule is applicable to evaluate the integral in (a2). The rule is given by h T ~ [( y0 + y8 ) + 2( y 2 + y 4 + y6 ) + 4( y1 + y3 + y5 + y7 )] 3 ~
10 [(0.025 + 0.1) + 2(0.0154 + 0.0182 + 0.0333) + 4(0.0167 + 0.0167 + 0.02 + 0.05)] 3
~ 2.2413 i.e.
T ~ 2.24 sec.
(ii) In this case composite Boole’s rule also works. It is given by T~
~
2h [7( y0 + y8 ) + 32( y1 + y3 + y5 + y7 ) + 12( y 2 + y6 ) + 14( y 4 )] 45 20 [7(0.025 + 0.1) + 32(0.0167 + 0.0167 + 0.02 + 0.05) 45
+ 12(0.0154 + 0.0333) + 14(0.0182)] ~ 2.2324
⇒
T ~ 2.23 sec.
Problem 4.11
The velocity v (km/min) of an airbus which starts from rest, is given at fixed intervals of time t (min) by the following table: t : 2 4 6 8 10 12 14 16 18 20 22 24 . v : 10 16 20 25 28 30 40 32 25 15 5 0 Estimate the distance covered in 24 minutes using (i) composite Simpson three-eighth rule (ii) composite Boole’s rule 433
(iii) composite Weddle’s rule. Solution. Here the number of subdivisions is 11 and hence as it is, none of the methods
mentioned in (i), (ii) and (iii) works. But we are given that the airbus starts from rest. It means that v = 0 at t = 0. Considering these values with the given data, we get 13 values i.e. 12 subintervals as follows: t: v:
0 0
2 4 6 8 10 12 14 16 18 20 10 16 20 25 28 30 40 32 25 15
22 5
v0
v1
v11 v12
v2
v3
v4
v5
v6
v7
v8
v9
v10
24 0
Let x (km) be the distance covered in t (min). Then velocity v is given by v=
dx i.e. dx = v dt dt
⇒
∫ dx = ∫ v(t ) dt
If s is the distance covered in 24 minutes, then the limits for x are x = 0 to x = s and the limits for t are t = 0 to t = 24. With these limits above indefinite integral becomes s
24
0
0
∫ dx = ∫ v(t ) dt 24
⇒
s = ∫ v(t ) dt
(a1)
0
We estimate the integral by the methods in (i) to (iii). In the present case (a1), the role of y is played by v. Accordingly we have to use the ordinates v0 , v1 ,L in place of y0 , y1 ,L in the formulae. The step size for all the rules is h = 2. (i) Here composite Simpson’s three-eighth rule has the form s~
3h [(v0 + v12 ) + 3(v1 + v2 + v4 + v5 + v7 + v8 + v10 + v11 ) + 2(v3 + v6 + v9 )] 8
6 ~ [(0 + 0) + 3(10 + 16 + 25 + 28 + 40 + 32 + 15 + 5) + 2(20 + 30 + 25)] 8 ~ 497.25 km (ii) The composite Boole’s rule for (a1) is s~
~
434
2h [7(v0 + v12 ) + 32(v1 + v3 + v5 + v7 + v9 + v11 ) + 12(v2 + v6 + v10 ) + 14(v4 + v8 )] 45 4 [7(0 + 0) + 32(10 + 20 + 28 + 40 + 25 + 5) + 12(16 + 30 + 15) + 14(25 + 32)] = 500.09 km 45
(iii) The composite Weddle’s formula is s~
~
3h [(v0 + v2 + v4 + v8 + v10 ) + 2(v6 + v12 ) + 5(v1 + v5 + v7 + v11 ) + 6(v3 + v9 )] 10 6 [(0 + 16 + 25 + 32 + 15) + 2(30 + 0) + 5(10 + 28 + 40 + 5) + 6( 20 + 25)] 10
~ 499.8 km Problem 4.12
A curve is drawn to pass through the points (1, 2), (1.5, 2.3), (2, 2.5), (2.5, 2.7), (3, 3), (3.5, 2.8) and (4, 2.2). Estimate the area bounded by the curve, the x -axis and the lines x = 1, x = 4. Also estimate the volume of solid of revolution obtained by revolving this area about the x -axis. In both the cases use composite Simpson’s rule. 4
4
1
1
Hint. Area = ∫ y dx and volume of solid of revolution = ∫ π y 2 dx Solution. The given data can be transformed into a tabular form:
x: y:
1 1.5 2 2.5 2 2.3 2.5 2.7 y0 y1 y 2 y3
3 3 y4
3 .5 4 2.8 2.2 . y5 y 6
Here the number of subintervals is 6 and hence composite Simpson’s one-third and three-eighth methods are applicable with h = 0.5. We denote the area by A and the volume generated by V . (i) Composite Simpson’s one-third rule in this case is 4 h A = ∫ y dx ~ [( y0 + y6 ) + 2( y 2 + y 4 ) + 4( y1 + y3 + y5 )] 3 1
~
0 .5 [(2 + 2.2) + 2(2.5 + 3) + 4(2.3 + 2.7 + 2.8)] 3
~ 7.7333 unit 2 By composite Simpson’s one-third rule we have h 2 2 2 2 2 2 2 2 ∫ y dx ~ [{( y0 ) + ( y6 ) } + 2{( y2 ) + ( y 4 ) } + 4{( y1 ) + ( y3 ) + ( y5 ) }] 3 1 4
~
0 .5 [{(2) 2 + (2.2) 2 } + 2{( 2.5) 2 + (3) 2 } + 4{ (2.3) 2 + (2.7) 2 + (2.8) 2 }] 3
~
0 .5 [4 + 4.84 + 2(6.25 + 9) + 4(5.29 + 7.29 + 7.84)] = 20.17 3 435
4
V = π ∫ y 2 dx ~ π(20.17) = 63.3659 unit 3
⇒
1
(ii) Composite Simpson’s three-eighth rule is 4
A = ∫ y dx ~ 1
~
3h [( y0 + y6 ) + 3( y1 + y 2 + y 4 + y5 ) + 2( y3 )] 8 3(0.5) [(2 + 2.2) + 3(2.3 + 2.5 + 3 + 2.8) + 2(2.7)] 8
~ 7.7625 unit 2 4
V = π ∫ y 2 dx ~ π 1
3h [{( y0 ) 2 + ( y6 ) 2 } + 3{( y1 ) 2 + ( y2 ) 2 + ( y 4 ) 2 + ( y5 ) 2 } + 2( y3 ) 2 ] 8
~
1.5π [{(2) 2 + ( 2.2) 2 } + 3{( 2.3) 2 + (2.5) 2 + (3) 2 + (2.8) 2 } + 2(2.7) 2 ] 8
~
1.5π [4 + 4.84 + 3(5.29 + 6.25 + 9 + 7.84) + 2(7.29)] 8
~ 63.9471 unit 3 SAQ 4.5
A rocket is launched from the ground. Its acceleration a cm sec −2 during the first 80 seconds is given by the following data: t : 0 10 20 30 40 50 60 70 80 . a : 20 30 35 40 42 45 50 54 60 Apply the composite Simpson’s one – third rule and composite Boole’s rule to estimate the velocity of the rocket at t = 80 seconds. SAQ 4.6
Apply the composite Trapezoidal rule and the composite Simpson’s one-third rule to estimate the integral 1
2 ∫ (3x + 4 x + 1) dx
0
taking the step size h = 0.1. Find its exact solution and determine the relative and percentage error in each case.
436
SAQ 4.7 π/ 2
Estimate ∫ sin x 3 dx using composite Boole’s rule with step size h = 0
π . 16
SAQ 4.8 12
Evaluate ∫
x e − x dx taking h = 1 by
0
(a) composite Trapezoidal rule (b) composite Simpson’s one-third rule (c) composite Simpson’s three-eighth rule (d) composite Boole’s rule and
(e) composite Weddle’s rule.
SAQ 4.9
The velocity v meter sec −1 of a particle at distances x meters from a point on its path is given by the following values: x : 10 20 30 40 50 60 . v : 6 10 15 25 40 70 The particle starts from rest. Estimate the time taken to travel 60 meters by using composite Simpson’s methods. SAQ 4.10
A curve passes through the points with the following coordinates: x: 1 2 3 4 5 . y : 2 2 .4 2 .8 3 4 Using composite Simpson’s one-third method, estimate the area bounded by the curve, the x -axis and the lines x = 0.1, x = 0.5. Also estimate the volume of solid of revolution obtained by revolving this area about the x -axis.
437
SUMMARY
The study of numerical integration carried out in the previous unit is continued. The closed quadrature rules are generalized in the form of composite quadrature formulae. These formulae include composite trapezoidal rule, composite Simpson’s one-third rule, composite Simpson’s three-eighth rule, composite Boole’s rule and composite Weddle’s rule. Various problems are solved to illustrate the working of these rules.
KEY WORDS
Composite rule Composite Trapezoidal rule Composite Simpson’s rules Composite Boole’s rule Composite Weddle’s rule
438
UNIT 04-05: NUMERICAL INTEGRATION CONTINUED (ERROR ANALYSIS OF QUADRATURE RULES)
439-488
LEARNING OBJECTIVES After successful completion of the unit, you will be able to Explain errors occurring in quadrature rules: trapezoidal, Simpson one-third, Simpson threeeighth, Boole and Weddle
Apply the methods to compute errors in numerical integration
INTRODUCTION The main objective of numerical integration is to evaluate the integral b
I = ∫ y ( x) dx
(5.1)
a
where the function y = f (x) is either explicitly defined or specified by n + 1 values in a tabular
form: x: a = x0 y = f ( x) : y0
x1 L xn = b . y1 L yn
(5.2)
In (5.2), the values of x are equally spaced with step size h=
b−a . n
(5.3)
The process of integration is executed according to the quadrature rules or formula. In the previous two units five rules are deduced: Trapezoidal rule Simpson one-third rule Simpson three-eighth rule Boole’s rule and
Weddle’s rule.
In these methods, we make use of an interpolating polynomial which approximates the function y = f (x). Thus the definite integral (5.1) is written in terms of the definite integral of a polynomial p (x) of degree ≤ n as follows: b
b
a
a
∫ y ( x) dx ~ ∫ p ( x) dx
(5.4) 439
The five methods studied so far specifies the formulae for the right side of (5.4): Trapezoidal rule:
x1
A = ∫ p ( x) dx = x0
Simpson one-third rule:
x2
A = ∫ p ( x) dx = x0
x3
Simpson three-eighth rule: A = ∫ p ( x) dx = x0
Boole’s rule:
x4
A = ∫ p( x) dx = x0
and
Weddle’s rule:
x6
A = ∫ p ( x) dx = x0
h ( y0 + y1 ) 2
(5.5a)
h ( y0 + 4 y1 + y 2 ) 3
(5.5b)
3h ( y0 + 3 y1 + 3 y 2 + y3 ) 8
(5.5c)
2h (7 y0 + 32 y1 + 12 y 2 + 32 y3 + 7 y 4 ) 45
(5.5d)
3h ( y0 + 5 y1 + y 2 + 6 y3 + y 4 + 5 y5 + y6 ) (5.5e) 10
Here we follow the convention:
y0 = y ( x0 ), y1 = y ( x1 ), L The values in (5.5) are the approximate values for the integral in (5.1). Naturally in carrying out approximation, errors are created. There are different types of errors. However, we are concerned with truncation error, denoted by E ( y, x) or simply by E. It is defined as b
b
a
a
∫ y ( x) dx = ∫ p( x) dx + E.
(5.6)
Since an error E is closely related to the polynomial, it can be denoted by E ( pi , y, x) or by E ( pi ), where pi stands for a polynomial in x of degree i. This unit is devoted to the study of errors in the quadrature rules. The study of truncation error will be carried out using the following: (i) the degree of precision of a quadrature rule (ii) error estimation formula for Lagrange interpolation and
(iii) Taylor expansion of the function y = f (x).
5.1 The degree of precision and truncation error of a quadrature rule Consider the definite integral in (5.1). Let its approximate value or estimation be given by A. Corresponding to each quadrature rule this estimated value A is specified in (5.5). We know, from geometrical point of view, that A gives the approximate value of the area bounded by the curve y = f (x), the x - axis and two ordinates x = a, x = b. 440
Definition. We say that the quadrature rule is exact on the interval [a, b] if b
I = ∫ y ( x) dx = A.
(5.7)
a
Since A is the approximation of I , we have I ~ A i.e. I ≠ A .
The definition signifies the circumstances if I = A. Definition. The degree of precision of a quadrature rule is the positive integer k such that
and
(i) E ( pi ) = 0 for all polynomials pi ( x) of degree i ≤ k
(5.8a)
(ii) E ( pk +1 ) ≠ 0 for some polynomial pk +1 ( x) of degree k + 1.
(5.8b)
In view of the equations in (5.5) and (5.6), the conditions in (5.8) can be rewritten in terms of I and A in the form: I = A for all polynomials pi ( x) of degree i ≤ k
and
I ≠ A for some polynomial pk +1 ( x) of degree k + 1.
Since I = A is for all polynomials of degree ≤ k , it is true for the test polynomials: 1, x, x 2 , L, x k Thus the definition can be conveniently reworded as follows: Definition. The degree of precision of a quadrature rule is the positive integer k such that
and
(i) I = A for all test polynomials 1, x, x 2 , L, x k
(5.9a)
(ii) I ≠ A for the test polynomial x k +1.
(5.9b)
From (5.6) and (5.9), we have I = A ⇒ E = 0 and I ≠ A ⇒ E ≠ 0.
Hence the error term E vanishes for all polynomials 1, x, x 2 , L, x k and it comes into play i.e. E ≠ 0 for the polynomial x k +1. Error constant and truncation error
Let k be the degree of precision of a quadrature rule, then the quantity C defined by C = I − A for y = x k +1
(5.10)
is called the error constant of the quadrature rule. 441
Then the truncation error term E is defined by
E=
C y ( k +1) (c), for some c ∈ (a, b) (k + 1)!
(5.11)
Remark. If the degree of precision of a quadrature rule is k , then the error term in (5.11)
appears for the lowest nonzero polynomial x k +1. This also holds for a nonzero value of error constant C. The degree of precision is also called the order of a rule.
5.2 Truncation error in the trapezoidal rule Theorem 5.1 (Degree of precision of the trapezoidal rule)
The trapezoidal rule has degree of precision k = 1. Proof. It will suffice to apply the trapezoidal rule over [0,1] with h = 1. Here x0 = 0, x1 = 1.
Choose the test polynomials y ( x) = 1, x, x 2 , ∀ x ∈ [0,1] ⇒
y0 = y ( x0 ) = y (0) and y1 = y ( x1 ) = y (1). 1
I = ∫ y ( x) dx and A =
Denote
0
h ( y0 + y1 ) 2
We choose three test polynomials y ( x) = 1, x, x 2 1
I = ∫ 1 dx = [ x]10 = 1 − 0 = 1
(i) For y = 1 :
0
A=
and ⇒
1 1 1 ( y0 + y1 ) = [ y (0) + y (1)] = [1 + 1] = 1, Q y ( x) = 1, ∀ x ∈ [0,1] 2 2 2
I=A 1
(ii) For y ( x) = x :
1 1 1 A = [ y (0) + y (1)] = (0 + 1) = 2 2 2
and ⇒
I=A
(iii) For y ( x) = x 2 :
442
1 1 1 1 1 I = ∫ y ( x) dx = ∫ x dx = x 2 = [1 − 0] = 2 0 0 2 0 2
1 1 1 1 I = ∫ y ( x) dx = ∫ x 2 dx = x 3 = 0 0 3 0 3
1 1 1 A = [ y (0) + y (1)] = [0 + 1] = 2 2 2
and ⇒
I≠A
Then (i) and (ii) ⇒ the trapezoidal rule is exact for y ( x) = 1, x and
(iii) ⇒ y ( x) = x 2 is the lowest power of x for which the rule is not exact.
This implies that the trapezoidal rule has degree of precision k = 1.
QED
Theorem 5.2 (Truncation error in a trapezoidal rule)
Let the function y = f ( x) ∈ C 2 [ x0 , x1 ]. Then the truncation error ET in a trapezoidal rule over the interval [ x0 , x1 ] is given by
ET = −
h3 y ′′(c) . 12
(5.12)
for some c ∈ ( x0 , x1 ) and h = x1 − x0 . Proof. The trapezoidal rule is given by x1
∫ y ( x) dx ~
x0
h [ y ( x0 ) + y ( x1 )] = A 2
There will no loss of generality if we take x0 = 0 and x1 = h. Then the interval of integration is [0, h]. On this interval, above trapezoidal rule becomes h h I = ∫ y ( x) dx ~ A = [ y (0) + y (h)] 2 0
(5.13)
By the previous theorem, the degree of precision of the trapezoidal rule is 1. Hence I = A, for y ( x) = 1, x and
I ≠ A, for y ( x) = x 2 .
By definition, the error constant is given by C = I − A, for y = x 2 Then (5.13) ⇒ ⇒
h h C = ∫ x 2 dx − [ (0) 2 + (h) 2 ], Q y ( x) = x 2 ⇒ y (h) = h 2 etc 2 0
C=
h3 h3 h3 − =− 3 2 6
With this value of error constant, the truncation error in (5.11) is given by 443
ET = ⇒
C y (1+1) (c), c ∈ ( x0 , x1 ) (1 + 1)!
(5.12)
QED
Use of Taylor series to find the error in a trapezoidal rule There is an old but effective method based on Taylor series expansion of the function y (x) to deduce the truncation error. We apply it to get the error term ET in a form different but equivalent to (5.12). From the definition of the error term, we have x1 h ET = ∫ y ( x) dx − ( y0 + y1 ) = I − A, say 2 x0
Let the function y = f (x) be sufficiently differentiable so that it can be expanded in a Taylor’s series in the powers of ( x − x0 ) . Then we write the Taylor’s expansion for y (x) : y ( x ) = y ( x0 ) +
( x − x0 ) ( x − x0 ) 2 y0′ + y0′′ + L 1! 2!
(5.14)
Substituting this value in I , we get x1 x1 ( x − x0 ) ( x − x0 ) 2 I = ∫ y ( x) dx = ∫ y0 + y0′ + y0′′ + L dx 1! 2! x0 x0 x1
( x − x0 ) 2 ( x − x0 ) 3 = y0 x + y0′ + y0′′ + L 2 × 1! 3 × 2! x0 = y0 ( x1 − x0 ) +
= h y0 +
( x1 − x0 ) 2 ( x − x )3 y0′ + 1 0 y0′′ + L 2! 3!
h2 h3 y0′ + y0′′ + L, Q x1 − x0 = h 2 6
Taking x = x1 in (5.14), we write y1 = y ( x1 ) = y0 +
⇒
( x1 − x0 ) ( x − x )2 h2 y0′ + 1 0 y0′′ + L = y0 + h y0′ + y0′′ + L 1! 2! 2
A=
h h2 h3 ( y0 + y1 ) = hy0 + y0′ + y0′′ + L 2 2 4
Substituting the values of I and A in the error term, we have
444
h3 1 1 ET = h 3 − y0′′ + L = − y0′′ + L 12 6 4 On the right, the terms after the first term contain higher powers of a small number h and bounded derivatives. Hence these terms are negligible. Then we get ET = −
h3 y0′′ 12
(5.15)
Remark. Though the forms of ET in (5.12) and (5.15) appear to be different, ultimately for
maximum error they become one. From (5.12), we write | ET | = −
h3 h3 y ′′(c) ≤ M 12 12
| y ′′(c) | ≤ max | y ′′( x) | = M
where
[ x0 , x1 ]
h3 h3 y0′′ ≤ M 12 12
Similarly (5.15) ⇒
| ET | = −
where
| y0′′ | ≤ max | y ′′( x) | ≤ M [ a,b]
Problem 5.1
Determine the coefficients a, b and c such that the quadrature rule 2h
−1 / 2 y ( x) dx ~ 2h [a y (0) + b y ( h) + c y (2h)] ∫ x
(a1)
0
is exact for polynomials of as high order as possible. Find the error constant and then the truncation error. Solution. To determine three unknowns, we need three equations. Hence we choose the test
polynomials up to order 2: y ( x) = 1, x, x 2 With these values from (a1), we get three equations as follows. (i)
y ( x) = 1 :
2h
−1 / 2 ∫ x (1) dx = 2h [ a (1) + b (1) + c (1)]
0
⇒
[2 x1/ 2 ]02 h = 2h (a + b + c)
⇒
2 2h = 2h ( a + b + c ) 445
⇒ (ii)
a+b+c =2
(a2)
2h
−1 / 2 ∫ x ( x) dx = 2h [ a (0) + b (h) + c (2h)]
y ( x) = x :
0
2h
1/ 2 ∫ x dx = h 2h [b + 2c]
⇒
0
2h
⇒
2 3/ 2 3 x = h 2h (b + 2c) 0
⇒
2 2h ( 2 h) 3 / 2 = 2h (b + 2c) 3 2
⇒
3(b + 2c) = 4
(iii) y ( x) = x 2 :
(a3)
2h
−1 / 2 2 2 2 ∫ x ( x ) dx = 2h [ a (0) + b ( h ) + c (2h) ]
0
2h
3/ 2 2 ∫ x dx = h 2h [b + 4c]
⇒
0
2h
⇒
2 5/ 2 2 5 x = h 2h (b + 4c) 0
⇒
2 ( 2h) 2 ( 2 h) 5 / 2 = 2h (b + 4c) 5 4
⇒
5(b + 4c) = 8
(a4)
Solving the equations (a2), (a3) and (a4), we get a=
12 16 2 ,b= ,c= 15 15 15
Hence the rule (a1) becomes 2h
−1 / 2 y ( x) dx ~ ∫ x
0
2 2h [6 y (0) + 8 y (h) + y (2h)] 15
For the polynomial y ( x) = x 3 , we have 2h
−1 / 2 3 x dx − ∫ x
0
2h 32h 3 2h 2 2h [6 (0) + 8(h 3 ) + (2h) 3 ] = ∫ x 5 / 2 dx − 15 15 0
2 4( 2 h ) 3 2 h = ( 2h) 7 / 2 − 7 15
446
(a5)
2 4 = − ( 2 h) 7 / 2 7 15 ≠0 Hence y = x 3 is the lowest polynomial for which the rule is not exact. Then the error constant is given by 16 2 7 / 2 2 4 C = − ( 2h ) 7 / 2 = h 105 7 15 With this error constant, the truncation error is
⇒
E=
C y ( 2+1) (c), c ∈ (0, 2h) (2 + 1)!
E=
16 2 h 7 / 2 y ′′′(c), c ∈ (0, 2h) 315
Problem 5.2
Deduce the truncation error formula (5.12) for the error estimation rule from Lagrange interpolation given by equations (4.10) and (4.11) of unit 4 of credit 3. Solution. By trapezoidal rule, we have x1
∫ y ( x) dx ~
x0
h ( y0 + y1 ) 2
Let ET be the error in the trapezoidal rule over the interval [ x0 , x1 ]. Then above gives x1
∫ y ( x) dx =
x0
h ( y0 + y1 ) + ET 2
(a1)
Taking n = 1 in equations (4.10) and (4.11) of unit 4 of credit 3, and writing y for f , we get y ( x) − p1 ( x) = ( x − x0 )( x − x1 )
y ′′(u ) 2!
for some u (x) such that x0 < u ( x) < x1. Integrating on [ x0 , x1 ], we get x1 x1 y′′(u ) ∫ y ( x) dx − ∫ p1 ( x) dx = ∫ ( x − x0 )( x − x1 ) dx 2! x0 x0 x0 x1
⇒
x1
x1 h ∫ y ( x) dx − ( y0 + y1 ) = ∫ 2 x0 x0
y′′(u ) ( x − x0 )( x − x1 ) dx, by (5.5a) 2! 447
Now x − x0 ≥ 0 and x − x1 ≤ 0 for all x ∈ [ x0 , x1 ] ⇒
( x − x0 )( x − x1 ) ≤ 0 for all x ∈ [ x0 , x1 ]
Hence ( x − x0 )( x − x1 ) does not change sign on the interval [ x0 , x1 ]. Also y ′′(u ( x)) is continuous. Then by weighted integral mean value theorem∗, we have h y ′′(c) x1 ∫ y ( x) dx − ( y0 + y1 ) = ∫ [( x − x0 )( x − x1 )]dx, x0 < c < x1 2 2 x0 x0 x1
Substitute x = x0 + h t in the integral on the right. Then dx = h dt and the limits for t are from 0 to 1. With this above becomes h y ′′(c) 1 ∫ y ( x) dx − ( y0 + y1 ) = ∫ ht h(t − 1) h dt 2 2 0 x0 x1
h y ′′(c)h 3 1 2 ∫ y ( x) dx − ( y0 + y1 ) = ∫ (t − t ) dt 2 2 0 x0 x1
⇒
h y ′′(c)h 3 ( ) ( ) y x dx − y + y = ∫ 0 1 2 2 x0 x1
⇒
1
t3 t2 − 3 2 0
h y ′′(c)h 3 ∫ y ( x) dx − ( y0 + y1 ) = − 2 12 x0 x1
⇒ Noting (a1), we get the error
ET = −
h3 y ′′(c), x0 < c < x1 12
Problem 5.3 0.2
Evaluate ∫
0.1
x2 dx by trapezoidal rule. Determine the error. 1+ x 3
Solution. Here x0 = 0.1, x1 = 0.2, h = 0.2 − 0.1 = 0.1. Let y = 0.2
∫ y dx ~
0.1
Here
∗
y0 = y ( x0 ) = y (0.1) =
x2 . The trapezoidal rule is 1 + x3
h ( y0 + y1 ) 2
(a1)
(0.1) 2 0.01 = = 0.01 3 1.001 1 + (0.1)
Let f , g ∈ C[a, b]. If g (x) does not change sign on [a, b], then there exists a number
c ∈ (a, b) such that b
b
a
a
∫ f ( x) g ( x) dx = f (c) ∫ g ( x) dx
448
y1 = y ( x1 ) = y (0.2) =
and
0.2
Then (a1) ⇒
∫ y dx ~
0.1
(0.2) 2 0.04 = = 0.0397 3 1.008 1 + ( 0 .2 )
0.1 (0.01 + 0.0397) = 0.0025 2
(a2)
The given integral can be evaluated exactly. We have 0.2
ln(1 + x 3 ) 1 x2 3 3 = dx ∫ = [ ln {1 + (0.2) } − ln{(1 + (0.1) }] 3 3 3 1 + x 0.1 0.1
0.2
1 = [0.008 − 0.001] = 0.0023 3
Ea = 0.0023 − 0.0025 = −0.0002
The actual error
ET = −
By Theorem 5.2,
|E|=
⇒
y=
Now
and
h3 y ′′(c) 12
h3 h3 | y ′′(c) | ≤ max y ′′( x) 12 12 [ 0.1, 0.2 ]
(a4)
2(1 − 2 x 2 )(1 + x 3 ) − 6 x 3 (2 − x 3 ) x2 ′ ′ ⇒ ( ) y x = (1 + x 3 ) 3 1 + x3 =
⇒
(a3)
2 − 4 x 2 − 10 x 3 − 4 x 5 + 6 x 6 (1 + x 3 ) 3
max | 2 − 4 x 2 − 10 x 3 − 4 x 5 + 6 x 6 | = | 2 − 4(0.2) 2 − 10(0.2) 3 − 4(0.2) 5 + 6(0.2) 6 | = 1.7588
[ 0.1, 0.2 ]
min | (1 + x 3 ) 3 | = | (1 + (0.1) 3 ) 3 | = 1.0030
[ 0.1, 0.2 ]
max y ′′ =
⇒
Then (a4) ⇒
[ 0.1, 0.2 ]
| ET | ≤
⇒
1.7588 = 1.7535 1.0030
(0.1) 3 (1.7535) = 0.0001 12 | ET | < | Ea |
Theorem 5.3 (Truncation error in a composite trapezoidal rule) The error term in a composite trapezoidal rule is given by ECT = −
(b − a) h 2 y ′′(c), for some c ∈ (a, b) 12
(5.16)
Proof. We know that the error term in a trapazoidal rule for a single interval [ x0 , x1 ] is given by 449
h3 y ′′(c1 ), x0 < c1 < x1 12
E1 = −
Similarly for the subintervals [ x1 , x2 ],L, [ xn −1 , xn ], we have errors: E2 = −
h3 y ′′(c2 ), x1 < c2 < x2 12
M En = −
h3 y ′′(cn ), xn −1 < cn < xn 12
Adding the errors for all n subintervals and denoting the sum by ECT , we get
ECT = −
⇒
ECT = −
h3 [ y′′(c1 ) + y ′′(c2 ) + L + y ′′(cn )] 12
nh 3 y′′(c1 ) + y ′′(c2 ) + L + y′′(cn ) n 12
The term in the square bracket is an average of values for the second derivatives and hence can be replaced by y ′′(c ), for some c ∈ ( x0 , xn ) = (a, b). Then we have
ECT = −
nh 3 y ′′(c), a < c < b 12
Since nh = (b − a ), above becomes
ECT = −
(b − a) h 2 y′′(c), a < c < b 12
QED
Remark. The error term in (5.16) can further be expressed in the form
| ECT | ≤ where
(b − a) h 2 M 12
(5.17)
| y ′′(c) | ≤ max | y ′′( x) | ≤ M [a,b]
Corollary. If ε is the error tolerance in the composite trapezoidal rule, then the number of
subintervals in (5.2) is estimated by n2 ≥
(b − a ) 3 M . 12 ε
Proof. From the rule (5.18), the error term in the composite trapezoidal rule is given by
450
(5.18)
| ECT | ≤
| ECT | ≤
⇒
(b − a )h 2 M 12
(b − a) 3 b−a M,Qh = 2 n 12 n
Let an error tolerance ε be given. Then above ⇒ (b − a ) 3 M≤ε 12 n 2 ⇒
(5.18).
QED
Remark. By the corollary, we can find the number n of subintervals in (5.2) for the given error
tolerance. Problem 5.4 1
Evaluate ∫
0
dx using composite trapezoidal rule taking h = 0.2. Find 1 + x2
(i) the exact solution (ii) the actual error term and
(iii) the maximum magnitude error term. .
Hint. See Problem 4.1 of the previous unit. Solution. In the Problem 4.1 of the previous unit, the estimation of the integral is obtained with
step size h = 0.2 : 1
I= ∫
0
dx ~ 0.7837 1 + x2
The exact solution is
I exact = 0.7854 and the actual error term is
Ea = 0.0017 We find the maximum error term ECT from the rule (5.17): | ECT | ≤ Now
y=
(b − a )h 2 nh 3 M= M 12 12
(a1)
6x2 − 2 2x 1 ′ ′ ′ ⇒ y y = − and = (1 + x 2 ) 2 (1 + x 2 ) 3 1 + x2 451
max (6 x 2 − 2) = 6(1) − 2 = 4 and min (1 + x 2 ) 3 = 1 [ 0 ,1]
[ 0 ,1]
max y ′′( x) =
⇒
[ 0 ,1]
Then (a1) ⇒
| ECT | ≤
⇒
4 = 4 i.e. M ≥ 4 1
(1 − 0) (0.2) 2 (4) = 0.0134 12 | Ea | < | ECT |
Problem 5.5 2
Evaluating ∫
1
dx using trapezoidal rule with n = 4, find the maximum error and the number of 1+ x
subintervals if the error is to be less than 10 −4. Solution. Here a = 1, b = 2, n = 4 and y =
h=
1 . The step size is given by 1+ x
b − a 2 −1 1 = = = 0.25 n 4 4
Then x takes the values: x0 = 1, x1 = 1.25, x2 = 1.5, x3 = 1.75, x4 = 2 ⇒
y0 =
y1 =
1 1 1 = = = 0.4444 1 + x1 1 + 1.25 2.25
y2 =
y3 =
1 1 1 = = = 0 .5 1 + x0 1 + 1 2
1 1 1 = = = 0.4 1 + x 2 1 + 1 .5 2 .5
1 1 1 = = = 0.3636 1 + x3 1 + 1.75 2.75
y4 =
1 1 1 = = = 0.3333 1 + x4 1 + 2 3
By trapezoidal rule, we have dx h ~ [( y0 + y 4 ) + 2( y1 + y2 + y3 )] x 1 2 + 1 2
∫
452
~
0.25 [(0.5 + 0.3333) + 2(0.4444 + 0.4 + 0.3636)] 2
~ 0.4062 The exact solution is 2
∫
1
dx = [ln(1 + x)]12 = ln 3 − ln 2 = 1.0986 − 0.6931 = 0.4055 1+ x
⇒
| actual error | = | 0.4055 − 0.4062 | = 0.0007
The maximum error is given by | ECT | ≤
M (b − a ) h 2 M (2 − 1)(0.25) 2 M = = 12 12 192
We find M as follows: y=
1 2 1 , y′ = − , y ′′ = 2 1+ x (1 + x) (1 + x) 3
On the interval [1, 2] the max y ′′(x) is at x = 1. Hence we have M = max y ′′( x) = max [1, 2 ]
[1, 2 ]
| ECT | =
⇒
2 2 1 = = 3 3 4 (1 + x) (1 + 1)
1 = 0.0013 4 × 192
The number subdivisions n is specified by (5.18): n2 ≥
(b − a ) 3 M 12 ε
where | ECT | is given to be less then ε = 10 −4. ⇒ ⇒
n2 ≥
(2 − 1) 3 1 10 4 ⋅ = = 208.3333 12 × 10 − 4 4 48 n ≥ 14.4338
Since n is a positive integer, we have n = 15. MCQ 5.1
The trapezoidal rule produces exact rules for the polynomial y ( x) = (m − 1) x 2 + 0.1x + m on [a, b]. 453
Then (A) ln m = 0.1 (B) ln m = 0 (C) ln m = 1 (D) ln m = 2 MCQ 5.2
The quadrature formula h
2 ∫ x y ( x) dx = h [a y (0) + b y (h)]
0
is exact for polynomials of as high order as possible. Then the point (a, b) lies on the straight line: (A) x − 2 y = 0 (B) x + 2 y = 0 (C) 2 x − y = 0 (D) 2 x + y = 0 MCQ 5.3 2
Evaluating ∫ cos x dx by trapezoidal rule with h = 1 and h = 0.5, the maximum error terms are 1
found to be E and E ′ up to two decimal places respectively. Then (A) E ≅ 4 E ′ (B) E ≅ 3E ′ (C) E ≅ 2 E ′ (D) E ≅ E ′ MCQ 5.4
dx by trapezoidal rule, the maximum error is to be less than 10 −3. Then 1 1+ x 2
In evaluating ∫
(A) step size h = 0.3 (B) step size h = 0.25
454
(C) step size h = 0.2 (D) step size h = 0.1.5 MCQ 5.5 2
Using the composite trapezoidal rule to estimate ∫
1
dx , the number of subintervals is n if the 1+ x
error is to be less than 5 × 10 −9. Then (A) n is odd and is divisible by 5 (B) n is even and is divisible by 3 (C) n ≤ 4000 (D) n ≥ 4444 SAQ 5.1
Find the quadrature rule 2
∫ y ( x) dx ~ a y (0) + b y (1) + c y (2)
0
which is exact for polynomials of the highest possible degree. SAQ 5.2 2
Find the maximum errors in estimating ∫ sin x dx using trapezoidal rule with h = 1 and h = 0.5. 1
SAQ 5.3 1
Estimate ∫
0
dx using trapezoidal rule with n = 5. Find the maximum error and the number x + x+6 2
of subintervals if the error is to be less than 10 −5. SAQ 5.4 1
Determine the minimum number of intervals to estimate ∫ ln(1 + x) dx using trapezoidal rule with 0
an accuracy of 10 −3.
5.3 Truncation error in Simpson’s one-third rule We know that Simson’s one-third rule is 455
x2
∫ p ( x) dx =
x0
h ( y0 + 4 y1 + y 2 ) 3
Incorporating the errors, this is rewritten as x2
h ∫ y ( x) dx − ( y0 + 4 y1 + y 2 ) = E S1 3 x0 I − A = ES1
or
(5.19a) (5.19b)
where E S1 is the truncation error. Theorem 5.4 (Degree of precision of Simpson’s one-third rule)
The Simpson’s one-third rule has degree of precision k = 3. Proof. The Simpson’s rule is applicable only if the number of subintervals is even. It will suffice
to apply the rule on the interval [0, 2] with h = 1. Here we have x0 = 0, x1 = 1, x2 = 2, y0 = y (0), y1 = y (1), y 2 = y (2). We choose the test polynomials y ( x) = 1, x, x 2 , x 3 , x 4 on the interval [1, 2]. The Simpson’s one-third rule is I = A, 2 1 I = ∫ y ( x) dx, A = [ y (0) + 4 y (1) + y (2)] 3 0
where
(i) For y ( x) = 1 :
2
2
0
0
I = ∫ y ( x) dx = ∫ 1 dx = [ x]02 = 2
and
1 1 A = [ y (0) + 4 y (1) + y ( 2)) = (1 + 4(1) + 1] = 2, Q y ( x) = 1 ∀ x ∈ [0, 2] 3 3
⇒
I=A
(ii) For y ( x) = x :
2 2 1 1 I = ∫ y ( x) dx = ∫ x dx = [ x 2 ]02 = (4) = 2 2 2 0 0
and
1 1 A = [ y (0) + 4 y (1) + y (2)] = [0 + 4(1) + 2] = 2 3 3
⇒
I=A
(iii) For y = x 2 : 456
2 2 8 1 1 I = ∫ y ( x) dx = ∫ x 2 dx = [ x 3 ]02 = (8) = 3 3 3 0 0
and
1 1 8 A = [ y (0) + 4 y (1) + y (2)] = [0 + 4(12 ) + 2 2 ] = 3 3 3
⇒
I=A
(iv) For y = x 3 :
2 2 1 1 I = ∫ y ( x) dx = ∫ x 3 dx = [ x 4 ]02 = (16) = 4 4 4 0 0
and
1 1 A = [ y (0) + 4 y (1) + y ( 2)] = [0 + 4(13 ) + 2 3 ] = 4 3 3
⇒
I=A
(iv) For y = x 4 :
2 2 32 1 1 I = ∫ y ( x) dx = ∫ x 4 dx = [ x 5 ]02 = (32) = 5 5 5 0 0
and
1 1 20 A = [ y (0) + 4 y (1) + y ( 2)] = [0 + 4(14 ) + 2 4 ] = 3 3 3
⇒
I≠A
Thus Simpson’s rule is exact for the test polynomials of degree ≤ 3 and is not exact for the lowest polynomial of degree 4. Hence the degree of precision of the Simpson’s rule is k = 3. QED Problem 5.6
Let the function y = f ( x) ∈ C 4 [ x0 , x2 ]. Show that the error constant C and the truncation error ES 1 in a trapezoidal rule over the interval [ x0 , x2 ] are given by C=− E S1 = −
and
4h 5 15
h 5 ( 4) y (c ) . 90
for some c ∈ ( x0 , x2 ) and h = x1 − x0 = x2 − x1. Solution. Taking x0 = 0 and x2 = 2h, the interval of integration is [0, 2h]. Here
x0 = 0, x1 = h, x2 = 2h. Then the Simpson’s rule becomes 2h h I = ∫ y ( x) dx ~ A = [ y (0) + 4 y (h) + y (2h)] 3 0
(a1)
Since the degree of precision of the trapezoidal rule is k = 3, we have 457
I = A, for y ( x) = 1, x, x 2 , x 3 I ≠ A, for y ( x) = x 4
and Then the error constant is given by
C = I − A, for y = x 4 2h h = ∫ x 4 dx − [0 4 + 4 (h 4 ) + (2h) 4 ], by (a1) 3 0 h
x5 h = − (20h 4 ) 5 0 3 =−
⇒
E S1 =
4 5 h 15
C h5 y (3+1) (c) = − y ( 4 ) (c), c ∈ (0, 2h) or c ∈ ( x0 , x2 ) etc (3 + 1)! 90
Use of Taylor series to find the error in Simpson’s rule The error E S1 in Simpson’s one-third rule is given by x2 h ES 1 = ∫ y ( x) dx − ( y0 + 4 y1 + y 2 ) = I − A, say 3 x0
(5.20)
x1 − x0 = h, x2 − x1 = h, x2 − x0 = 2h.
Here
Let the function y = f (x) be sufficiently differentiable so that it can be expanded in a Taylor’s series in the powers of ( x − x0 ) . Then we write the Taylor’s expansion for y (x) : y ( x ) = y ( x0 ) +
( x − x0 ) ( x − x0 ) 2 y0′ + y0′′ + L 1! 2!
(5.21)
Substituting this value in I , we get x2
I = ∫ y ( x) dx x0
x2 ( x − x0 ) ( x − x0 ) 2 ( x − x0 ) 3 ( x − x0 ) 4 ( 4 ) y0′ + y0′′ + y0′′′ + y0 + L dx = ∫ y0 + 1! 2! 3! 4! x0
x2
( x − x0 ) 2 ( x − x0 ) 3 ( x − x0 ) 4 ( x − x0 ) 5 ( 4 ) = y0 x + y0′ + y0′′ + y0′′′ + y0 + L 2 × 1! 3 × 2! 4 × 3! 5 × 4! x0 458
= y 0 ( x 2 − x0 ) +
( x 2 − x0 ) 2 ( x − x0 ) 3 ( x − x0 ) 4 ( x − x0 ) 5 ( 4 ) y0′ + 2 y0′′ + 2 y0′′′ + 2 y0 + L 2! 3! 4! 5!
= 2hy0 + 2h 2 y0′ +
4h 3 2h 4 4h 5 ( 4 ) y0′′ + y0′′′ + y0 + L 3 3 15
Taking x = x1 and x = x2 in (5.21), we write ( x1 − x0 ) ( x − x )2 ( x − x )3 (x − x )4 y0′ + 1 0 y0′′ + 1 0 y0′′′ + 1 0 y0( 4) + L 1! 2! 3! 4!
y1 = y ( x1 ) = y0 +
= y0 + h y0′ +
and
h2 h3 h 4 ( 4) y0′′ + y0′′′ + y0 + L 2 6 24
y 2 = y ( x2 ) = y 0 +
( x 2 − x0 ) ( x − x0 ) 2 ( x − x0 ) 3 ( x − x0 ) 4 ( 4 ) y0′ + 2 y0′′ + 2 y0′′′ + 2 y0 L 1! 2! 3! 4!
4 2 = y0 + 2h y0′ + 2h 2 y0′′ + h 3 y0′′′ + h 4 y0( 4 ) + L 3 3 Then
A=
h h2 h3 h 4 ( 4) y0′′ + y0′′′ + y0 y0 + 4 y0 + h y0′ + 3 2 6 24
+ y0 + 2h y0′ + 2h 2 y0′′ +
4 3 2h 4 ( 4 ) h y0′′′ + y0 + L 3 3
4 2 5 = 2hy0 + 2h 2 y0′ + h 3 y0′′ + h 4 y0′′′ + h 5 y0( 4 ) + L 3 3 18 Substituting the values of I and A in (5.20), we get h5 4 5 E S1 = − h 5 y0( 4 ) + L = − y0( 4) + L 90 15 18
(5.22)
On the right side we ignore the terms involving h 6 , h 7 ,L, the first term gives the error in Simpson’s one-third rule: E S1 = −
h 5 ( 4) y0 90
(5.23)
Remark. It can be shown that error term in (5.23) can be written as
ES1 = −
h 5 ( 4) y (c), x0 < c < x2 . 90
(5.24)
459
Theorem 5.5 (Error estimate for composite Simpson’s one-third rule)
Let the function y = f (x) be such that y ∈ C 4 [ x0 , xn ] = C 4 [ a, b]. Then the error estimate in composite Simpson’s one-third rule is given by ECS 1 = −
(b − a)h 4 ( 4) y (c), a < c < b. 180
(5.25)
Proof. Since the Simpson’s one-third rule is applicable to even number of subintervals, suppose
that the interval of integration [ x0 , xn ] = [a, b] is subdivided into 2n subintervals
[ xi , xi +1 ], i = 0,1,L, 2n − 1 The step size is h=
b−a 2n
We know that on each of the intervals [ x0 , x2 ], [ x2 , x4 ],L,[ x2 n − 2 , x2 n ] the formula (5.24) for error term holds. Thus we have on [ x0 , x2 ] : E1 = −
h 5 ( 4) y (c1 ), x0 < c1 < x2 90
on [ x2 , x4 ] : E2 = −
h 5 ( 4) y (c2 ), x2 < c2 < x4 90
M
on [ xn − 2 , xn ] : En = −
h 5 ( 4) y (cn ), xn − 2 < cn < xn 90
Adding all the error terms, we have ECS 1 = E1 + E2 + L + En = −
460
h5 ( 4) [ y (c1 ) + y ( 4 ) (c2 ) + L + y 4 (cn )] 90
y ( 4 ) (c1 ) + y ( 4 ) (c2 ) + L + y ( 4 ) (cn ) n
=−
nh 5 90
=−
nh 5 [ average of values for the fourth derivatives] 90
=−
nh 5 ( 4) y (c), x0 < c < xn 90
Here we have b − a = 2nh. Then ECS 1 = −
(2nh)h 4 ( 4 ) (b − a )h 4 ( 4 ) y (c ) = − y (c) 180 180
QED
This rule can be used to estimate the number of subintervals required to get a specified accuracy and the rule to that effect is given by the following theorem. Theorem 5.6 (Number of subintervals for error tolerance ε )
If ε is the error tolerance in the composite Simpson’s one-third rule, then the number of subintervals is estimated by n4 ≥
(b − a) 5 M 2880 ε
M = max | y ( 4 ) ( x) | .
where
[a,b]
(5.26a) (5.26b)
Proof. The error term in the composite Simpson’s one-third rule is (see (5.25)) given by
| ECS 1 | = −
(b − a) h 4 ( 4 ) (b − a)h 4 (b − a )h 4 y (c ) ≤ M , by (5.26b) × max | y ( 4) ( x) | = [ a,b] 180 180 180
The step length is h=
b−a 2n
With this value of h in the above inequality, we get 4
| ECS 1 | ≤
(b − a ) b − a (b − a ) 5 M M= 180 2n 2880 n 4
Let ε be the error tolerance. Then above gives (b − a ) 5 M ≤ε 2880 n 4 n4 ≥
⇒
(b − a ) 5 M 2880 ε
QED
Problem 5.7 2
Evaluating ∫
1
dx by Simpson’s one-third method with h = 0.5 and h = 0.25, find the 1+ x
maximum error and the number of subintervals if the error is to be less than 10 −9 in each case. 461
Solution. Here a = 1, b = 2, and y =
1 . 1+ x
(i) For h = 0.5, x takes the values:
x0 = 1, x1 = 1.5, x2 = 2 y0 =
⇒
1 1 1 = = = 0 .5 1 + x0 1 + 1 2
y1 =
1 1 1 = = = 0 .4 1 + x1 1 + 1.5 2.5
y2 =
1 1 1 = = = 0.3333 1 + x2 1 + 2 3
By Simpson’s one-third rule, we have dx h ~ [ y0 + 4 y1 + y 2 ] 1 x 3 + 1 2
∫
0 .5 [0.5 + 4(0.4) + 0.3333] = 0.4056 3
~ The exact solution is 2
∫
1
dx = [ln(1 + x)]12 = ln 3 − ln 2 = 1.0986 − 0.6931 = 0.4055 1+ x | actual error | = | 0.4055 − 0.4056 | = 0.0001
⇒
The maximum error is given by | ES1 | = |
h 5 ( 4) (0.5) 5 ( 4) (0.5) 5 y0 | = | y0 | ≤ M 90 90 90 M = max | y ( 4) ( x) |
where
[1, 2 ]
We find M as follows: y=
1 1 2 6 24 , y′ = − , y ′′ = , y ′′′ = − , y ( 4) = 2 3 4 1+ x (1 + x) (1 + x) (1 + x) (1 + x) 5
The max of | y ( 4) ( x) | is at the end point x = 1. ⇒
⇒ 462
M = max y ( 4) ( x) = max [1, 2 ]
[1, 2 ]
| E Si | ≤
24 24 24 = = = 0.75 5 5 32 (1 + x) (1 + 1)
(0.5) 5 (0.75) = 0.0003 90
The number n is specified by (5.26): n4 ≥
(b − a) 5 M 2880 ε
where ε = 10 −9. ⇒
n4 ≥
(2 − 1) 5 109 × 0 . 75 = × 0.75 = 260416.6667 2880 2880 × 10 −9
⇒
n ≥ 22.59
Since n is a positive integer, we take n = 23. Then the number of subdivisions 2n is 46. (ii) For h = 0.25, x takes the values: x0 = 1, x1 = 1.25, x2 = 1.5, x3 = 1.75, x4 = 2 ⇒
y0 =
y1 =
1 1 1 = = = 0.4444 1 + x1 1 + 1.25 2.25
y2 =
y3 =
1 1 1 = = = 0 .5 1 + x0 1 + 1 2
1 1 1 = = = 0.4 1 + x 2 1 + 1 .5 2 .5
1 1 1 = = = 0.3636 1 + x3 1 + 1.75 2.75
y4 =
1 1 1 = = = 0.3333 1 + x4 1 + 2 3
By composite Simpson’s one-third rule, we have dx h ~ [( y0 + y 4 ) + 4( y1 + y3 ) + 2 y 2 ] 3 1 1+ x 2
∫
~
0.25 [(0.5 + 0.3333) + 4(0.4444 + 0.3636) + 2(0.4)] 3
~ 0.4054 ⇒
| actual error | = | 0.4055 − 0.4054 | = 0.0001
The maximum error is given by | ES1 | = |
h 5 ( 4) (0.25) 5 ( 4 ) (0.25) 5 y0 | = | y0 | ≤ M 90 90 90 463
M = max | y ( 4) ( x) | = 0.75
where
[1, 2 ]
⇒
| E Si | ≤
(0.25) 5 (0.75) = 0.000008 90
Again using (5.26), we get n = 23. Then the number of subdivisions 2n is 46. Problem 5.8
Find the number n and the step size h so that the error ECS 1 for the composite Simpson’s one6
third rule is less than 10 −10 for the approximation ∫
1
dx . x
Solution. The truncation error for the composite Simpson’s one-third rule is given by (5.25):
ECS 1 = − Here
y ( x) =
(b − a )h 4 ( 4) y (c), a < c < b. 180
(a1)
1 2 6 24 1 ⇒ y ′ = − 2 , y ′′ = 3 , y ′′′ = − 4 and y ( 4 ) = 5 . x x x x x
Then on the interval [1, 6], the max y ( 4 ) ( x) attends at x = 1. Hence | y ( 4) (c) | ≤ max | y ( 4 ) ( x) | = [1, 6 ]
Then (a1) ⇒
| ECS 1 | ≤
24 = 24 15
(6 − 1) h 4 2 (24) = h 4 180 3
For the rule we have h=
b − a 6 −1 5 = = 2n 2n 2n
Substituting this value of h in (a2), we get | ECS 1 | ≤
2 5 3 2n
4
The error tolerance being 10 −10 , we have 4
| ECS 1 | ≤
⇒
464
2 5 −10 ≤ 10 3 2n
1250 ≤ 10 −10 48 n 4
(a2)
n4 ≥
⇒
1250 × 1010 = 260416666666.6667 48
n ≥ 714.36
⇒
Since n is a positive integer, we choose n = 715. Then the corresponding step size
h=
b−a 5 = = 0.0035 2n 1430
MCQ 5.6 4
The error for the composite Simpson’s one-third rule is less than 10 −8 for estimating ∫ x e − x dx. 0
Then the pair (n, h) of the number n and the step size h is (A) (220, 110 −1 ) (B) (110, 55 −1 ) (C) (100, 50 −1 ) (D) None of the above. MCQ 5.7 1
2
Let E S1 be the error in estimating ∫ e − x dx by the composite Simpson’s one-third rule with 0
2n = 10. Choose the true statement from the following: (A) − 7 × 10 −6 ≤ ECS 1 ≤ 5 × 10 −6 (B) − 5 × 10 −6 ≤ ECS 1 ≤ 5 × 10 −6 (C) − 5 × 10 −6 ≤ ECS1 ≤ 7 × 10 −6 (D) − 7 × 10 −6 ≤ ECS1 ≤ 7 × 10 −6 SAQ 5.5 2
Dividing the range of integration into 8 equal parts, evaluate ∫
0
dx using the composite x + x +1 2
Simpson’s one-third rule. Find the maximum error. SAQ 5.6
Find the number n and the step size h so that the error for the composite Simpson’s one-third 5
rule in estimating ∫ sin( 2 x ) dx is less than 10 −6. 1
465
5.4 Truncation error in Simpson’s three-eighth rule The study of error analysis for Simpson’s three-eighth rule can be carried out on the lines of Simpson’s one-third rule . The discussion on degree of precision and truncation error is worked out in details. Other results corresponding to that of one-third method are briefly summarized and their details are left to the readers. Simson’s three-eighth rule is given by x3
∫ y ( x) dx −
x0
3h ( y0 + 3 y1 + 3 y 2 + y3 ) = E S 2 8
I − A = ES 2
or
(5.27a) (5.27b)
where ES 2 is the truncation error. Theorem 5.7 (Degree of precision of Simpson’s three-eighth rule) The Simpson’s three-eighth rule has degree of precision k = 3. Proof. The Simpson’s three-eighth rule is applicable only if the number of subintervals is a
multiple of 3. It will suffice to apply the rule on the interval [0, 3] with h = 1. Here we have x0 = 0, x1 = 1, x2 = 2, x3 = 3, y0 = y (0), y1 = y (1), y 2 = y (2), y3 = y (3).
Then the Simpson’s one-third rule becomes I = A,
where
3 3 I = ∫ y ( x) dx, A = [ y (0) + 3 y (1) + 3 y (2) + y (3)] 8 0
We choose the test polynomials y ( x) = 1, x, x 2 , x 3 , x 4 on the interval [0, 3].
(i) For y ( x) = 1 :
3
3
0
0
I = ∫ y ( x) dx = ∫ 1 dx = [ x]30 = 3
and
3 3 A = [ y (0) + 3 y (1) + 3 y (2) + y (3)] = (1 + 3(1) + 3(1) + 1] = 3 8 8
⇒
I=A
(ii) For y ( x) = x :
and
466
3 3 1 9 I = ∫ y ( x) dx = ∫ x dx = [ x 2 ]30 = 2 2 0 0
3 3 9 A = [ y (0) + 3 y (1) + 3 y (2) + y (3)] = [0 + 3(1) + 3(2) + 3] = 8 8 2
⇒
I=A 3 3 1 I = ∫ y ( x) dx = ∫ x 2 dx = [ x 3 ]30 = 9 3 0 0
(iii) For y = x 2 :
and
1 3 A = [ y (0) + 3 y (1) + 3 y (2) + y (3)] = [0 + 3(12 ) + 3(2 2 ) + 32 ] = 9 3 8
⇒
I=A 3 3 1 81 I = ∫ y ( x) dx = ∫ x 3 dx = [ x 4 ]30 = 4 4 0 0
(iv) For y = x 3 :
and
3 3 81 A = [ y (0) + 3 y (1) + 3 y (2) + y (3)] = [0 + 3(13 ) + 3(23 ) + 33 ] = 8 8 4
⇒
I=A 3 3 1 243 I = ∫ y ( x) dx = ∫ x 4 dx = [ x 5 ]30 = 5 5 0 0
(iv) For y = x 4 :
and
3 3 99 A = [ y (0) + 3 y (1) + 3 y (2) + y (3)] = [0 + 3(14 ) + 3(2 4 ) + 34 ] = 8 8 2
⇒
I≠A
Hence the Simpson’s three-eighth rule is exact for the test polynomials of degree ≤ 3 and is not exact for the lowest polynomial of degree 4. Hence the degree of precision of the Simpson’s three-eighth rule is k = 3.
QED
Theorem 5.7 (Truncation error for Simpson’s three-eighth rule) If y ∈ C 4 [ x0 , x3 ], then x3
∫ y dx =
x0
3h 3h 5 ( 4 ) ( y0 + 3 y1 + 3 y 2 + y3 ) − y (c), x0 < c < x3 8 80
i.e. the error term = −
3h 5 ( 4 ) y (c), x0 < c < x3 . 80
(5.28a)
(5.28b)
Proof. We denote the interval of integration [ x0 , x3 ] = [0, 3h]. Then we have x0 = 0, x1 = h, x2 = 2h, x3 = 3h
With these values, the Simpson’s three-eighth rule becomesy 3h
I = ∫ y ( x) dx ~ A = 0
3h [ y (0) + 3 y (h) + 3 y (2h) + y (3h)] 8
Since the degree of precision of the Simpson’s three-eighth rule is 3, we have 467
I = A, for y ( x) = 1, x, x 2 , x 3 I ≠ A, for y ( x) = x 4
and Then the error constant is given by
C = I − A, for y = x 4
⇒
3h
C = ∫ y ( x) dx − 0
3h
= ∫ x 4 dx − 0
3h [ y (0) + 3 y (h) + 3 y (2h) + y (3h)], y ( x) = x 4 8
3h 4 [0 + 3(h 4 ) + 3(2h) 4 + (3h) 4 ] 8
3h
x5 243h 5 99h 5 9h 5 3h = − × 132h 4 = − =− 5 2 10 8 5 0 ⇒
ES 2 =
9h 5 3h 5 ( 4 ) C y (3+1) (c) = − y ( 4 ) (c ) = − y (c), c ∈ (0, 3h) = ( x0 , x3 ) (3 + 1)! 10 × 24 80
QED
Theorem 5.9 (Error estimate for composite Simpson’s three-eighth rule) Let the function y = f ( x) be such that y ∈ C 4 [ x0 , xn ] = C 4 [ a, b]. Then the error estimate in composite Simpson’s three-eighth rule is given by ECS 2 = −
(b − a ) h 4 ( 4 ) y (c), a < c < b. 80
(5.29)
Hint. For the Simpson’s three-eighth rule, the number of subintervals is a multiple of 3. Hence
subdivide the interval [ x0 , xn ] = [a, b] into 3n subintervals [ xi , xi +1 ], i = 0,1,L, 3n − 1 with h =
b−a 3n
On each of the intervals [ x0 , x3 ], [ x3 , x6 ],L,[ x3n −3 , x3n ] the error formula (5.28) holds. Then taking the sum of errors, the total error over the interval [ x0 , xn ] will be ECS 2 = −
⇒
ECS 2 = −
n(3h 5 ) ( 4 ) y (c), x0 < c < xn 80
(3nh)h 4 ( 4 ) (b − a )h 4 ( 4) y (c ) = − y (c), Q b − a = 3nh 80 80
Write all the details and rewrite the proof yourself. 468
Theorem 5.10 (Number of subintervals for error tolerance ε ) If ε is the error tolerance in the composite Simpson’s three-eighth rule, then the number of subintervals is estimated by
n4 ≥
M = max | y ( 4 ) ( x) | .
where
[a,b]
| ECS 2 | = −
Hint.
Then h =
(b − a ) 5 M 6480 ε
(5.30a)
(5.30b)
(b − a ) h 4 ( 4) (b − a )h 4 (b − a)h 4 y (c ) ≤ M × max | y ( 4 ) ( x) | = [a,b] 80 80 80 4
b−a ⇒ 3n
(b − a ) b − a (b − a) 5 = M M 80 3n 6480 n 4
| ECS 1 | ≤
For the error tolerance ε,
(b − a) 5 (b − a) 5 4 M ≤ ε n ≥ M. i.e. 6480 ε 6480 n 4
Problem 5.9 4
Evaluating ∫
1
dx by composite Simpson’s three-eighth method with h = 0.5, find the 1+ x
maximum error and the number of subintervals if the error is to be less than 10 −9. Solution. Here a = 1, b = 4, and y =
1 . 1+ x
(i) For h = 0.5, x takes the values: x0 = 1, x1 = 1.5, x2 = 2, x3 = 2.5, x4 = 3, x5 = 3.5, x6 = 4 Since the number of subintervals 6 is a multiple of 3, composite Simpson’s three-eighth rule is
applicable. ⇒
y0 =
1 1 1 = = = 0 .5 1 + x0 1 + 1 2
y1 =
1 1 1 = = = 0 .4 1 + x1 1 + 1.5 2.5
y2 =
1 1 1 = = = 0.3333 1 + x2 1 + 2 3
y3 =
1 1 1 = = = 0.2857 1 + x3 1 + 2.5 3.5 469
y4 =
y5 =
1 1 1 = = = 0.25 1 + x4 1 + 3 4
1 1 1 = = = 0.2222 1 + x5 1 + 3.5 4.5
y6 =
1 1 1 = = = 0.2 1 + x6 1 + 4 5
By composite Simpson’s three-eighth rule, we have dx 3h ~ [( y0 + y6 ) + 3( y1 + y 2 + y 4 + y5 ) + 2 y3 ] 8 1 1+ x 4
∫
~
3(0.5) [(0.5 + 0.2) + 3(0.4 + 0.3333 + 0.25 + 0.2222) + 2(0.2857)] 8
~ 0.9165 The exact solution is 4
∫
1
dx = [ln(1 + x)]14 = ln 5 − ln 2 = 1.6094 − 0.6931 = 0.9163 1+ x | actual error | = | 0.9163 − 0.9165 | = 0.0002
⇒
The maximum error is given by
ECS 2 = − | ECS 2 | =
⇒
(b − a)h 4 ( 4 ) y (c ) 80
(4 − 1)(0.5) 4 ( 4 ) | y (c) | = 0.0023 | y ( 4 ) (c) | ≤ 0.0023 M 80 | y ( 4 ) (c) | ≤ max | y ( 4) ( x) | ≤ M
where
[1, 4 ]
We find M as follows: y=
1 1 2 6 24 , y′ = − , y ′′ = , y ′′′ = − , y ( 4) = 2 3 4 1+ x (1 + x) (1 + x) (1 + x) (1 + x) 5
The max of | y ( 4) ( x) | is at the end point x = 1.
⇒
M = max y ( 4) ( x) = max [1, 2 ]
[1, 2 ]
24 24 24 = = = 0.75 5 5 32 (1 + x) (1 + 1)
⇒
| ECS 2 | ≤ 0.0023 (0.75) = 0.0017
⇒
| actual error | < | ECS 2 |
470
The number n is specified by (5.30a):
n4 ≥
(b − a ) 5 M 6480 ε
where ε = 10 −9.
n4 ≥
⇒
( 4 − 1) 5 3 × 109 × 0 . 75 = × 0.75 = 347222.2222 6480 6480 × 10 −9
n ≥ 24.2745
⇒
Since n is a positive integer, we take n = 25. Then the number of subdivisions 3n is 75. MCQ 5.8
The error ECS 2 for the composite Simpson’s three-eighth rule is less than 10 −6 for the 6
approximation ∫
1
dx . Then the number of subdivisions is x
(A) 117 (B) 147 (C) 177 (D) 297 SAQ 5.7 2.5
Evaluating ∫
1
dx by composite Simpson’s three-eighth method with h = 0.25, find the 1+ x
maximum error and the number of subintervals if the error is to be less than 10 −10. SAQ 5.8
Use Taylor series expansion of the function y = f ( x) in powers of ( x − x0 ) to obtain the truncation error for the Simpson’s three-eighth rule.
5.5 Truncation error in Boole’s quadrature rule The Boole’s quadrature rule is given by x4
∫ y ( x) dx ~
x0
2h [ 7 y ( x0 ) + 32 y ( x1 ) + 12 y ( x2 ) + 32 y ( x3 ) + 7 y ( x4 )] 45
(5.31)
This rule is applicable if the number of subdivisions is a multiple of 4. Now we discuss its error 471
analysis starting from its degree of precision. Theorem 5.11 (Degree of precision of Boole’s rule)
The degree of precision of Boole’s rule is five. Proof. Since the Boole’s rule is applicable only if the number of subintervals is a multiple of 4,
it will suffice to take the interval of integration [0, 4] with step length h = 1. In this case we have
x0 = 0, x1 = 1, x2 = 2, x3 = 3, x4 = 4 and yi = y ( xi ), i = 0,1, 2, 3, 4 Then the Boole’s rule (5.31) takes the form 4
∫ y ( x) dx ~
0
2 [7 y (0) + 32 y (1) + 12 y (2) + 32 y (3) + 7 y (4)] 45
We denote the right side by
A=
2 [7 y (0) + 32 y (1) + 12 y (2) + 32 y (3) + 7 y (4)] 45
We choose the test polynomials
y ( x) = 1, x, x 2 , x 3 , x 4 , x 5 , x 6 .
and
4
4
0
0
4 ∫ y ( x) dx = ∫ 1dx = [ x]0 = 4
(i) For y ( x) = 1 :
A=
2 [7 y (0) + 32 y (1) + 12 y (2) + 32 y (3) + 7 y (4)] 45
=
2 [7(1) + 32(1) + 12(1) + 32(1) + 7(1)], Q y ( x) = 1 ∀ x ∈ [0, 4] 45
=
2 [90] = 4 45
⇒
I=A
and
472
4
4 1 2 ∫ y ( x) dx = ∫ x dx = x = 8 0 0 2 0 4
(ii) For y ( x) = x :
A=
2 [7 y (0) + 32 y (1) + 12 y (2) + 32 y (3) + 7 y (4)] 45
=
2 [7(0) + 32(1) + 12(2) + 32(3) + 7(4)], Q y ( x) = x ∀ x ∈ [0, 4] 45
=
2 [180] = 8 45
(5.32)
⇒
I=A
and
2 [7 y (0) + 32 y (1) + 12 y (2) + 32 y (3) + 7 y (4)] 45
A=
=
2 [7(0) + 32(12 ) + 12(2 2 ) + 32(32 ) + 7( 4 2 )], Q y ( x) = x 2 ∀ x ∈ [0, 4] 45
=
2 64 [480] = 45 3
⇒
I=A
A=
2 [7 y (0) + 32 y (1) + 12 y (2) + 32 y (3) + 7 y (4)] 45
=
2 [7(0) + 32(13 ) + 12(23 ) + 32(33 ) + 7(43 )], Q y ( x) = x 3 ∀ x ∈ [0, 4] 45
=
2 [1440] = 64 45
⇒
I=A
A=
2 [7 y (0) + 32 y (1) + 12 y (2) + 32 y (3) + 7 y (4)] 45
=
2 [7(0) + 32(14 ) + 12(2 4 ) + 32(34 ) + 7( 4 4 )], Q y ( x) = x 4 ∀ x ∈ [0, 4] 45
=
2 1024 [4608] = 45 5
⇒
I=A 4
4 4 6 2048 1 6 5 y x dx = x dx = x ( ) = = ∫ ∫ 6 3 0 0 0 6 4
(v) For y ( x) = x 5 :
and
4
4 45 1024 1 5 4 y x dx = x dx = x ( ) = = ∫ ∫ 5 5 0 0 0 5 4
(v) For y ( x) = x 4 :
and
4
4 1 4 3 ∫ y ( x) dx = ∫ x dx = x = 64 0 0 4 0 4
(iv) For y ( x) = x 3 :
and
4
4 64 1 3 2 ∫ y ( x) dx = ∫ x dx = x = 0 0 3 0 3 4
(iii) For y ( x) = x 2 :
A=
2 [7 y (0) + 32 y (1) + 12 y (2) + 32 y (3) + 7 y (4)] 45 473
=
2 [7(0) + 32(15 ) + 12( 25 ) + 32(35 ) + 7( 45 )], Q y ( x) = x 5 ∀ x ∈ [0, 4] 45
=
2 2048 [15360] = 45 3
I=A
⇒
A=
and
4
4 4 7 16384 1 7 6 = ∫ y ( x) dx = ∫ x dx = x = 7 0 0 7 0 7 4
(vi) For y ( x) = x 6 :
2 [7 y (0) + 32 y (1) + 12 y (2) + 32 y (3) + 7 y (4)] 45
=
2 [7(0) + 32(16 ) + 12(2 6 ) + 32(36 ) + 7(4 6 )], Q y ( x) = x 6 ∀ x ∈ [0, 4] 45
=
2 7040 [52800] = 45 3
⇒
I≠A
Thus Boole’s rule is exact for the test polynomials of degree ≤ 5 and is not exact for the polynomial of least degree 6. Hence the degree of precision of the Boole’s rule is k = 5.
QED
Theorem 5.12 (Truncation error in Boole’s rule)
If y ∈ C 6 [ x0 , x4 ], then x4
∫ y dx =
x0
2h 8h 7 ( 6 ) (7 y0 + 32 y1 + 12 y 2 + 32 y3 + 7 y4 ) − y (c), x0 < c < x4 45 945
i.e. the error term = −
8h 7 ( 6 ) y (c), x0 < c < x4 . 945
Proof. We choose [ x0 , x4 ] = [0, 4h] so that
x0 = 0, x1 = h, x2 = 2h, x3 = 3h, x4 = 4h Then the Boole’s rule (5.31) takes the form 4h
I = ∫ y ( x) dx ~ A = 0
2h [7 y (0) + 32 y (h) + 12 y (2h) + 32 y (3h) + 7 y ( 4h)] 45
Since the degree of precision of the rule is 5,
I = A, for y ( x) = 1, x, x 2 , x 3 , x 4 , x 5
474
(5.33a)
(5.33b)
I ≠ A, for y ( x) = x 6
and Then the error constant C is given by
C = I − A, for y = x 6 4h
= ∫ x 6 dx − 0
2h [7 y (0) + 32 y (h) + 12 y (2h) + 32 y (3h) + 7 y (4h)], for y = x 6 45
4h
x7 2h = − [7(0 6 ) + 32( h 6 ) + 12(2h) 6 + 32(3h) 6 + 7(4h) 6 ] 45 7 0 =
16384h 7 2h 7 − (32 + 768 + 23328 + 28672) 7 45
=
16384h 7 7040h 7 − 7 3
=−
128 7 h 21
Then the truncation error for Boole’s rule is
⇒
EB =
8h 7 ( 6 ) C y (5+1) (c) = − y (c), c ∈ (0, 4h) = ( x0 , x4 ) etc. (5 + 1)! 945
QED
Corollary. The truncation error in (5.33) can be conveniently written in the form
| EB | ≤
8h 7 M 945
M = max | y ( 6 ) ( x) |
where
[ x0 , x 4 ]
(5.34a) (5.34b)
Hint. Since | y ( 6) (c) | ≤ max | y ( 6) ( x) | = M , we get (5.34) from (5.33). [ x0 , x 4 ]
Problem 5.10
Using Boole’s quadrature formula, show that the estimation of the truncation error in (5.34) can be deduced from Taylor’s expansion for y ( x) in the powers of ( x − x0 ), . Solution. Incorporating the error term, the Boole’s rule is rewritten in the form x4
∫ y ( x) dx −
x0
Here
2h [7 y0 + 32 y1 + 12 y2 + 32 y3 + 7 y 4 ) = E B i.e. I − A = E B 45
(a1)
x1 − x0 = h, x2 − x0 = 2h, x3 − x0 = 3h, x4 − x0 = 4h
(a2)
Let the function y = f ( x) be sufficiently differentiable so that it can be expanded in a Taylor’s 475
series in the powers of ( x − x0 ) :
y ( x ) = y ( x0 ) +
( x − x0 ) ( x − x0 ) 2 ( x − x0 ) 3 ( x − x0 ) 4 ( 4 ) y0′ + y0′′ + y0′′′ + y0 1! 2! 3! 4!
+
( x − x0 ) 5 (5) ( x − x0 ) 6 ( 6) y0 + y0 + L 5! 6!
(a3)
Integrating over the interval [ x0 , x4 ], we get x4 x4 ( x − x0 ) ( x − x0 ) 2 ( x − x0 ) 3 ( x − x0 ) 4 ( 4 ) I = ∫ y ( x) dx = ∫ y0 + y0′ + y0′′ + y0′′′ + y0 1! 2! 3! 4! x0 x0
+
( x − x0 ) 5 ( 5 ) ( x − x0 ) 6 ( 6 ) y0 + y0 + L 5! 6!
( x − x0 ) 2 ( x − x0 ) 3 ( x − x0 ) 4 ( x − x0 ) 5 ( 4 ) = y0 x + y0′ + y0′′ + y0′′′ + y0 2 × 1! 3 × 2! 4 × 3! 5 × 4! x4
( x − x0 ) 6 ( 5 ) ( x − x0 ) 7 ( 6 ) + y0 + y0 + L 6 × 5! 7 × 6! x = y 0 ( x 4 − x0 ) + + = 4hyy0 +
0
( x 4 − x0 ) 2 ( x − x0 ) 3 ( x − x0 ) 4 ( x − x0 ) 5 ( 4 ) y0′ + 4 y0′′ + 4 y0′′′ + 4 y0 2! 3! 4! 5! ( x4 − x0 ) 6 (5) ( x4 − x0 ) 7 ( 7 ) y0 + y0 + L 6! 7!
( 4h ) 2 ( 4h) 3 ( 4h) 4 ( 4 h) 5 ( 4 ) ( 4 h ) 6 ( 5 ) ( 4 h ) 7 ( 6 ) y0′ + y0′′ + y0′′′ + y0 + y0 + y0 + L 2 6 24 120 720 5040
= 4hyy0 + 8h 2 y0′ +
32h 3 32h 4 128h 5 ( 4 ) 256h 6 (5) 1024h 7 ( 6) y0′′ + y0′′′ + y0 + y0 + y0 + L 3 3 15 45 315
(a4)
Taking x = x1 , x2 , x3 , x4 in (a3) and noting (a2), we write y1 = y ( x1 ) = y0 + +
= y0 + h y0′ +
( x1 − x0 ) (x − x )2 ( x − x )3 ( x − x )4 y0′ + 1 0 y0′′ + 1 0 y0′′′ + 1 0 y0( 4 ) 1! 2! 3! 4! ( x1 − x0 ) 5 (5) ( x1 − x0 ) 6 ( 6) y0 + y0 + L 5! 6! h2 h3 h 4 ( 4) h 5 ( 5) h 6 ( 6) y0′′ + y0′′′ + y0 + y0 + y0 + L 2 6 24 120 720
Similarly, we have y 2 = y ( x2 ) = y0 + (2h) y0′ +
476
( 2h ) 2 ( 2h ) 3 ( 2 h ) 4 ( 4 ) ( 2 h ) 5 ( 5 ) ( 2h ) 6 ( 6 ) y0′′ + y0′′′ + y0 + y0 + y0 + L 2 6 24 120 720
= y0 + 2h y0′ + 2h 2 y0′′ + y3 = y0 + (3h) y0′ + = y0 + 3h y0′ +
(3h) 2 (3h) 3 (3h) 4 ( 4 ) (3h) 5 (5) (3h) 6 ( 6) y0′′ + y0′′′ + y0 + y0 + y0 + L 2 6 24 120 720
9h 2 9h 3 27 h 4 ( 4) 81h 5 (5) 81h 6 ( 6 ) y0′′ + y0′′′ + y0 + y0 + y0 + L 2 2 8 40 80
y4 = y0 + (4h) y0′ +
( 4h) 2 ( 4h) 3 ( 4 h) 4 ( 4 ) ( 4 h) 5 ( 5 ) ( 4h ) 6 ( 6 ) y0′′ + y0′′′ + y0 + y0 + y0 + L 2 6 24 120 720
= y0 + 4h y0′ + 8h 2 y0′′ + ⇒
A=
4h 3 2 h 4 ( 4 ) 4 h 5 ( 5 ) 4h 6 ( 6 ) y0′′′ + y0 + y0 + y0 + L 3 3 15 45
32h 3 32h 4 ( 4 ) 128h 5 (5) 256h 6 ( 6 ) y0′′′ + y0 + y0 + y0 + L 3 3 15 45
2h h2 h3 h 4 ( 4 ) h 5 ( 5) h 6 ( 6 ) y0′′ + y0′′′ + y0 + y0 + y0 + L 7 y0 + 32 y0 + h y0′ + 45 2 6 24 120 720
4h 3 2 h 4 ( 4 ) 4 h 5 ( 5 ) 4h 6 ( 6 ) y0′′′ + y0 + y0 + y0 + L + 12 y0 + 2h y0′ + 2h 2 y0′′ + 3 3 15 45 9h 2 9h 3 27 h 4 ( 4) 81h 5 (5) 81h 6 ( 6) y0′′ + y0′′′ + y0 + y0 + y0 + L + 32 y0 + 3h y0′ + 2 2 8 40 80
32 h 3 32 h 4 ( 4 ) 128 h 5 ( 5 ) 256 h 6 ( 6 ) 2 ′ ′ ′ ′ ′ ′ + 7 y0 + 4 h y0 + 8h y0 + y0 + y0 + y0 + y 0 + L 3 3 15 45 = 4hy0 + 8h 2 y0′ +
32h 3 32h 4 128h 5 ( 4) 256h 6 (5) 88h 7 ( 6) y0′′ + y0′′′ + y0 + y0 + y0 + L 3 3 15 45 27
Substituting the values of I and A in (a1), we get 8 7 (6) 1024 88 7 ( 6) h y0 + L I − A4 = − h y0 + L = − 945 315 27 Since the derivatives of y are bounded on [ x0 , x4 ] and the step size h is sufficiently small, we ignore the terms involving h8 , h 9 ,L, on the right side. The first term gives the error in Boole’s rule i.e. EB = −
⇒ where
| EB | =
8h 7 ( 6 ) y0 945
8h 7 ( 6 ) 8h 7 8h 7 | y0 | ≤ max | y ( 6) ( x) | = M 945 945 [ x0 , x4 ] 945 M = max | y ( 6 ) ( x) | etc. [ x0 , x 4 ]
477
Theorem 5.13 (Error estimate for composite Boole’s rule)
Let the function y = f (x) be such that y ∈ C 6 [ x0 , xn ] = C 6 [a, b]. Then the error estimate in composite Boole’s rule is given by ECB = −
2(b − a)h 6 ( 6 ) y (c), a < c < b. 945
(5.35)
Proof. For Boole’s rule, the number of subintervals is a multiple of 4. Hence subdivide the
interval [ x0 , xn ] = [a, b] into 4n subintervals [ xi , xi +1 ], i = 0,1,L, 4n − 1 with h =
b−a 4n
On each of the intervals [ x0 , x4 ], [ x4 , x8 ],L,[ x4 n − 4 , x4 n ] the error formula (5.34) holds. Then taking the sum of errors, the total error over the interval [ x0 , xn ] will be ECB = −
⇒
ECB = −
n(8h 7 ) ( 6 ) y (c), x0 < c < xn 945
(4nh)2h 6 ( 6) 2(b − a)h 6 ( 6 ) y (c ) = − y (c), Q b − a = 4nh 945 945
QED
Theorem 5.14 (Number of subintervals for error tolerance ε )
If ε is the error tolerance in the composite Boole’s rule, then the number of subintervals is estimated by n6 ≥
2(b − a ) 7 M 945 × 4 6 ε
M = max | y ( 6 ) ( x) | .
where
[a,b]
Proof. The error for the composite Boole’s rule in (5.35) is written in the form
| ECB | = −
2(b − a ) h 6 ( c ) 2(b − a )h 6 2(b − a )h 6 × max | y ( 6 ) ( x) | = y (c ) ≤ M [a,b] 945 945 945
b−a Then h = ⇒ 4n For the error tolerance ε, 478
6
2(b − a ) b − a 2(b − a ) 7 | ECB | ≤ M M= 945 4n 945 × 4 6 n 6 2(b − a ) 7 M ≤ε 945 × 4 6 n 6
(5.36a) (5.36b)
n6 ≥
⇒
2(b − a) 7 M. 945 × 4 6 ε
QED
Problem 5.11
dx by Boole’s rule with h = 0.25. 1 1+ x 2
Estimate the maximum truncation error in evaluating ∫
Solution. The truncation error formula is given by (5.34):
| EB | ≤ h=
Here
8h 7 M 945
(a1)
2 −1 = 0.25 and M = max | y ( 6 ) ( x) | . [1, 6 ] 4
We compute M . We have
y=
6! 6! 1 = ⇒ y ( 6 ) ( x) = (−1) 6 7 (1 + x) (1 + x) (1 + x) 7
The maximum of y ( 6 ) ( x) on [1, 2] takes place at x = 1. Hence M = max | y ( 6 ) ( x) | = [1, 6 ]
Then (a1) ⇒
| EB | ≤
6! 720 45 = = 2 7 128 8
8 (0.25) 7 45 × = 0.000003 945 8
Problem 5.12
dx by the composite Boole’s rule with 1 1+ x 7
Estimate the maximum truncation error in evaluating ∫
h = 0.5. Find the number of subintervals and the step size h if the error is to be less than 10 −9. Solution. The truncation error formula for the composite Boole’s rule is given by (5.35):
ECB = −
Here
Then (a1) ⇒
2(b − a)h 6 ( 6 ) y (c), a < c < b. 945
h = 0.5 and M = max | y ( 6 ) ( x) | = [1, 7 ]
| EB | ≤
(a1)
45 , see the previous problem 8
2(7 − 1) (0.5) 6 45 × = 0.0011161 945 8
The number n is specified by (5.36): 479
n6 ≥
2(b − a) 7 M. 945 × 4 6 ε
where ε = 10 −9.
n6 ≥
⇒
2(7 − 1) 7 45 2 × 6 7 × 109 45 × = 775948660.7143 × = 8 945 × 4 6 × 10 −9 8 945 × 4 6
⇒
n ≥ 30.3137
Since n is a positive integer, we take n = 31. Then the number of subdivisions 4n is 124.
h=
Then
b − a 7 −1 3 = = = 0.05 4n 124 62
MCQ 5.9
The error for the composite Boole’s quadrature formula is less than 10 −9 for the estimation of 7
∫
2
dx . Then the number of subintervals is x (A) 16 (B) 17 (C) 18 (D) 19
SAQ 5.9 4
Evaluating ∫ x e − x dx with h = 0.5 by the composite Boole’s rule, find the number of subintervals 0
and the step size to compute the given integral with an accuracy of 10 −10. SAQ 5.10
Investigate the error when the composite Boole’s rule is used over [1, 5] to integrate the function
y ( x) = ln x having the number of subintervals 8.
5.6 Truncation error in Weddle’s quadrature rule The Weddle’s quadrature rule is given by x6
x0 + 6 h
x0
x0
∫ y( x) dx = ∫ y( x) dx ~
480
3h [ y( x0 ) + 5 y( x1 ) + y( x2 ) + 6 y( x3 ) + y( x4 ) + 5 y( x5 ) + y( x6 )] (5.37) 10
This rule is applicable if the number of subdivisions is a multiple of 6. Now we discuss its error analysis starting from its degree of precision. Theorem 5.15 (Degree of precision of Weddle’s rule) The degree of precision of Weddle’s rule is five. Proof. It will suffice to take the interval of integration [0, 6] with step length h = 1. In this case
we have h = 1, x0 = 0, x1 = 1, x2 = 2, x3 = 3, x4 = 4, x5 = 5, x6 = 6
yi = y ( xi ), i = 0,1, 2, 3, 4, 5, 6
and
Then the Weddle’s rule (5.37) takes the form 6
I = ∫ y ( x) dx ~ 0
3 [ y (0) + 5 y (1) + y (2) + 6 y (3) + y (4) + 5 y5 + y6 ] 10
(5.38)
Denote the right side by
A=
3 [ y (0) + 5 y (1) + y (2) + 6 y (3) + y (4) + 5 y5 + y6 ] 10
We choose the test polynomials
y ( x) = 1, x, x 2 , x 3 , x 4 , x 5 , x 6 . Now use the rule (5.38). 6
6
0
0
6 ∫ y ( x) dx = ∫ 1 dx = [ x]0 = 6
(i) For y ( x) = 1 :
A=
and
3 [1 + 5 + 1 + 6 + 1 + 5 + 1] = 6 10
⇒
I=A
(ii) For y ( x) = x :
and
A=
6
3 [0 + 5(1) + 2 + 6(3) + 4 + 5(5) + 6] = 18 10 I=A
⇒ (iii) For y ( x) = x 2 :
6
1 2 ∫ y ( x) dx = ∫ x dx = x = 18 0 0 2 0 6
6
6 216 1 3 2 = 72 ∫ y ( x) dx = ∫ x dx = x = 3 0 0 3 0 6
481
A=
and
3 [0 + 5(12 ) + 2 2 + 6(32 ) + 4 2 + 5(5 2 ) + 6 2 ] = 72 10 I=A
⇒
A=
and
6
6 64 1 4 3 ( ) y x dx = x dx = x = = 324 ∫ ∫ 4 0 0 0 4 6
(iv) For y ( x) = x 3 :
3 3 [0 + 5(13 ) + 23 + 6(33 ) + 43 + 5(53 ) + 63 ] = (1080) = 324 10 10 I=A
⇒ (v) For y ( x) = x :
A=
and
6
65 7776 1 5 = ∫ y ( x) dx = ∫ x dx = x = 5 0 0 5 0 5 6
4
6
4
3 3 7776 [0 + 5(14 ) + 2 4 + 6(34 ) + 4 4 + 5(54 ) + 6 4 ] = (5184) = 10 10 5 I=A
⇒
A=
and
6
6 66 1 6 5 y ( x ) dx = x dx = x = = 7776 ∫ ∫ 6 0 0 0 6 6
(v) For y ( x) = x 5 :
3 3 [0 + 5(15 ) + 25 + 6(35 ) + 45 + 5(55 ) + 65 ] = (25920) = 7776 10 10 I=A
⇒ (vi) For y ( x) = x :
and
6
6 7 279936 1 7 = ∫ y ( x) dx = ∫ x dx = x = 7 0 0 7 0 7 6
6
A=
6
6
3 3 [0 + 5(16 ) + 2 6 + 6(36 ) + 4 6 + 5(56 ) + 6 6 ] = (133320) = 39996 10 10 I≠A
⇒
Hence the Weddle’s rule is exact for the test polynomials of degree ≤ 5 and is not exact for the polynomial of least degree 6. This shows that the degree of precision of the Boole’s rule is k = 5.
QED
Remark. It is always convenient to take [0, 6h] as the interval of integration for Weddle’s rule.
Then we have x0 = 0, x1 = h, x2 = 2h, x3 = 3h, x4 = 4h, x5 = 5h, x6 = 6h With this the Weddle rule becomes
482
6h
I = ∫ y ( x) dx ~ A = 0
3h [ y (0) + 5 y (h) + y ( 2h) + 6 y (3h) + y (4h) + 5 y (5h) + y (6h)] 10
(5.39)
This form is used in the proof of the following theorem. Theorem 5.16 (Truncation error in Weddle’s rule)
If y ∈ C 6 [ x0 , x6 ], then x6
∫ y dx =
x0
3h h 7 (6) ( y0 + 5 y1 + y 2 + 6 y3 + y 4 + 5 y5 + y6 ) − y (c), x0 < c < x6 10 140 i.e. the error term = −
h 7 ( 6) y (c), x0 < c < x6 . 140
(5.40a)
(5.40b)
Proof. From the previous theorem, the degree of precision of the Weddle’s rule is 5. Taking the
Weddle’s rule in the form (5.39) over the interval [0, 6h], we have I = A for y ( x) = 1, x, x 2 , x 3 , x 4 , x 5 I ≠ A for y ( x) = x 6 .
and
Then by definition, the error constant is given by C = I − A for y ( x) = x 6 ⇒
6h
C = ∫ y ( x) dx − 0
6h
= ∫ x 6 dx − 0
3h [ y (0) + 5 y (h) + y (2h) + 6 y (3h) + y ( 4h) + 5 y (5h) + y (6h)], y = x 6 10
3h [0 + 5(h 6 ) + (2h) 6 + 6(3h) 6 + (4h) 6 + 5(5h) 6 + (6h) 6 ] 10
6h
x7 3h = − (133320h 6 ) 7 0 10 1 36 = (279936h 7 ) − 39996h 7 = − h 7 7 7 By definition, the error term EW is given by EW =
C y (5+1) (c), 0 < c < 6h (5 + 1)!
=−
36h 7 ( 6) h 7 (6) y (c ) = − y (c ) 7 × 6! 140
Taking x0 = 0 and x6 = 6h, above takes the form in (5.40) etc.
QED
483
Corollary. The truncation error in (5.40) can be conveniently written in the form
| EB | ≤
h7 M 140
(5.41a)
M = max | y ( 6) ( x) |
where
(5.41b)
[ x 0 , x6 ]
Hint. Since | y ( 6) (c) | ≤ max | y ( 6 ) ( x) | = M , we get (5.41) from (5.40) etc. [ x0 , x64 ]
Theorem 5.17 (Error estimate for composite Weddle’s rule)
Let the function y = f (x) be such that y ∈ C 6 [ x0 , xn ] = C 6 [a, b]. Then the error estimate in composite Weddle’s rule is given by ECW = −
(b − a ) h 6 ( 6 ) y (c), a < c < b. 840
(5.42)
Proof. For Weddle’s rule, the number of subintervals is a multiple of 6.. Hence subdivide the
interval [ x0 , xn ] = [a, b] into 6n subintervals [ xi , xi +1 ], i = 0,1,L, 6n − 1 with h =
b−a 6n
On each of the intervals [ x0 , x6 ], [ x6 , x12 ],L,[ x6 n −6 , x6 n ] the error formula (5.40) holds. Then taking the sum of errors, the total error over the interval [ x0 , xn ] will be ECW = −
⇒
ECW = −
n( h 7 ) ( 6 ) y (c), x0 < c < xn 140
(6nh)h 6 ( 6) (b − a)h 6 ( 6) y (c ) = − y (c), Q b − a = 6nh 6 × 140 840
QED
Theorem 5.18 (Number of subintervals for error tolerance ε )
If ε is the error tolerance in the composite Weddle’s rule, then the number of subintervals is estimated by n6 ≥ where 484
(b − a ) 7 M 840 × 6 6 ε
M = max | y ( 6 ) ( x) | . [a,b]
(5.43a) (5.43b)
Proof. The error for the composite Weddle’s rule in (5.42) is written in the form
| ECB | = −
(b − a ) h 6 ( c ) (b − a )h 6 (b − a )h 6 × max | y ( 6) ( x) | = y (c ) ≤ M [ a,b] 840 840 840 6
(b − a) b − a (b − a) 7 | ECB | ≤ M M= 840 6n 840 × 6 6 n 6
b−a Then h = ⇒ 6n
(b − a ) 7 M ≤ε 840 × 6 6 n 6
For the error tolerance ε, ⇒
(5.43)
Problem 5.13 2.2
Estimate the maximum truncation error in evaluating ∫
1
dx by Weddle’s rule with h = 0.2. x
Solution. The truncation error formula is given by (5.34):
| EW | = where
h=
h7 h7 | y ( 6 ) (c ) | = M 140 140
(a1)
2.2 − 1 1.2 = = 0.2 and M = max | y ( 6 ) ( x) | . [1, 2.2 ] 6 6
We compute M . We have y=
6! 6 ! 1 ⇒ y ( 6 ) ( x) = (−1) 6 7 = 7 x x x
The maximum of y ( 6 ) ( x) on [1, 2.2] takes place at x = 1. Hence M = max | y ( 6 ) ( x) | = [1, 2.2 ]
Then (a1) ⇒
| EW | ≤
6! = 720 17
(0.2) 7 × 720 = 0.000066 140
Problem 5.14 2.2
Estimate the maximum truncation error in evaluating ∫
1
dx by the composite Weddle’s rule with x
h = 0.1. Find the number of subintervals and the step size h if the error is to be less than 10 −10. Solution. The truncation error formula for the Composite Weddle’s rule is given by (5.35):
ECW = −
(b − a ) h 6 ( 6 ) y (c), a < c < b. 840
(a1) 485
h = 0.1 and M = max | y ( 6) ( x) | = 720, see the previous problem
Here
[1, 2.2 ]
| ECW | ≤
Then (a1) ⇒
( 2.2 − 1) (0.1) 6 × 720 = 0.000001 840
The number n is specified by (5.43): n6 ≥
(b − a ) 7 M 840 × 6 6 ε
where ε = 10 −10. n6 ≥
⇒
( 2.2 − 1) 7 (1.2) 7 × 1010 × 720 = × 720 = 658285,7143 840 × 6 6 × 10 −10 840 × 6 6
⇒
n ≥ 9.3268
Since n is a positive integer, we take n = 10. Then the number of subdivisions 6n is 60.. h=
Then
b − a 2.2 − 1 1.2 = = = 0.02 6n 60 60
MCQ 5.10
The error for the composite Weddle’s quadrature formula is less than 10 −9 for the estimation of dx . Then the number of subintervals is 2 1+ x
5
∫
(A) 246 (B) 252 (C) 258 (D) 264 SAQ 5.11 3
Evaluating ∫ x e − x dx with h = 0.5 by the composite Weddle’s rule, find the number of 0
subintervals and the step size to compute the given integral with an accuracy of 10 −9. SAQ 5.12
Investigate the error when the composite Weddle’s rule is used over [1, 7] to integrate the function y ( x) = ln x having the number of subintervals 12.
486
SAQ 5.13
Using Weddle’s quadrature formula, show that the estimation of the truncation error in (5.40) can be deduced from Taylor’s expansion for y (x) in the powers of ( x − x0 ), .
487
SUMMARY
The study of error analysis is carried out in reference to the quadrature rules involving trapezoidal rule, composite trapezoidal rule .
Simpson’s one-third rule, composite Simpson’s one-third rule
.
Simpson’s three-eighth rule, composite Simpson’s three-eighth rule Boole’s rule, composite Boole’s rule
and
Weddle’s rule, composite Weddle’s rule.
The concept of degree of precision of a qudrature rule is explained. This is used to deduce the formulae of truncation errors in the above methods. Also use of Taylor’s series is made to obtain the error rules.
KEY WORDS
Degree of precision Error constant Truncation error Taylor’s series Composite quadrature rules
488