Are you sure?
This action might not be possible to undo. Are you sure you want to continue?
MASENGE
African Virtual university
Université Virtuelle Africaine
Universidade Virtual Africana
Numerical
Methods
/lrcan vrrua unversr, '
Notice
This document is published under the conditions of the Creative Commons
http://en.wikipedia.org/wiki/Creative_Commons
Attribution
http://creativecommons.org/licenses/by/2.5/
License (abbreviated “ccby”), Version 2.5.
/lrcan vrrua unversr, 2
I. NumericalMethods_________________________________________3
II. PrerequisiteCourseorKnowledge _____________________________3
III. Time ____________________________________________________3
IV. Materials_________________________________________________3
V. ModuleRationale __________________________________________3
VI. Content__________________________________________________4
6.1 Overview___________________________________________4
6.2 Outline _____________________________________________5
6.3 GraphicOrganizer_____________________________________6
VII. GeneralObjective(s)________________________________________7
VIII. SpecificLearningActivities___________________________________8
IX. TeachingandLearningActivities_______________________________9
X. LearningActivities_________________________________________16
XI. CompiledListofallKeyConcepts(Glossary)___________________107
XII. CompiledListofCompulsoryReadings_______________________113
XIII. CompiledListofMultimediaResources_______________________114
XIV. SynthesisoftheModule___________________________________115
XV. SummativeEvaluation_____________________________________116
XVI.References_____________________________________________130
XVII.MainAuthoroftheModule_________________________________131
Table of ConTenTs
/lrcan vrrua unversr, J
I. numerical Methods
by Dr. Ralph W.P Masenge
II. Prerequisite Courses or Knowledge
Calculus 2 is prerequisite.
III. Time
The total time for this module is 120 study hours.
IV. Material
Students should have access to the core readings specifed later. Also, they will need
a computer to gain full access to the core readings. Additionally, students should
be able to install the computer software wxMaxima and use it to practice algebraic
concepts.
V. Module Rationale
A key attribute of mathematics is its applicability in problem solving. The history of the
subject is full of evidence that the driving force in its early development was based in
trying to solve problems in plane geometry, celestial mechanics and in navigation.
Unfortunately, mathematical formulations (models) of most problems in science and
engineering are, in general, diffcult to solve analytically either because of the com
plex nature of the analytical solutions or because such solutions cannot be expressed
in terms of combinations of known mathematical functions.
In all such cases, numerical methods have to be resorted to. The mathematics or
science student is therefore expected to have a working knowledge of and ability
to apply numerical methods in solving some basic mathematical problems such as
interpolation, numerical integration and fnding roots of functions.
Figure 3: Surfng on the Internet is a key to e‑learning
/lrcan vrrua unversr, 4
VI. Content
6.1 Overview
First Learning Activity: Types and Causes of Errors
The frst learning activity aims at making the learner appreciate the need for numerical
methods. It is also felt that this is the right moment to defne the concept of a mathe
matical error, point out the sources and types of errors and mention some practical
ways of reducing their cumulative effect on the numerical solution.
Second Learning Activity: Interpolation
The second learning activity deals with the concept of interpolation. Both linear and
higher order polynomial interpolation methods, based on Lagrange, Newton’s divided
differences and fnite difference interpolation techniques are presented.
Third Learning Activity: Numerical Integration
The third learning activity looks at the problem of numerical integration. The discus
sion is limited to Newton‑Cotes formulae. Specifc attention is given to the
Trapezoidal and Simpson’s rules and the application of Richardson’s extrapolation
technique on both the Trapezoidal and Simpson’s rules in deriving
Romberg integration schemes.
Fourth Learning Activity: Roots of functions
The fourth and fnal learning activity presents the root fnding problem associated
with solving the nonlinear equation f (x) = 0 and solving the coupled system of two
nonlinear equations f (x, y) = 0 , g(x, y) = 0 .
Figure 4: A Baobab Tree. Number of roots equals number of twigs
/lrcan vrrua unversr, 5
6.2 Outline: Syllabus (include specific timings here if needed).
This is a two unit course offered at Level 2 with priority rating A. Mathematics
Module 3 is its prerequisite course.
The following is a detailed outline of the contents of each Learning Activity. The
timings shown are suitable for students following a unit level course allowing 35
hours per unit. The timings show the length of time the Learner is recommended to
spend learning each of its components.
[Students following a module level course should allow 120 hours for the complete
module].
Preperation, taking and review for PreAssessment (4 hrs)
Learning Activity No.1: Types and Causes of Errors (25 hrs)
Types and sources of errors
Need for numerical methods
Error sources and types
Strategies for reducing errors
Learning Activity No.2: Interpolation (35 hrs)
Linear interpolation
Lagrangian interpolation
Newton’s divided differences
Finite difference operators
Finite difference tables
Finite difference interpolation polynomials
Learning Activity No.3: Numerical integration (25 hrs)
Newton Cote’s formulae
Derivation of the trapezoidal and Simpson’s rules
Romberg integration
Gaussian quadrature formulae
Learning Activity No. 4: Roots of functions. (25 hrs)
Bisection method
Convergence of the bisection method
The Regula Falsi or False Position method
Secant method
NewtonRaphson’s method
Solving a coupled system of two nonlinear equations
Fixed point iterations
/lrcan vrrua unversr, 6
Preperation and taking Summative Assessment (6 hrs)
6.3 Graphic Organiser
Figure 5: Graphic Organizer
/lrcan vrrua unversr, 7
VII. General objective(s)
At the end of this module:
You will be equipped with knowledge and understanding of the properties of
elementary functions and their various applications necessary to confdently teach
these subjects at the secondary school level.
You will have secure knowledge of the related contents of school mathematics to
enable you confdently teach these subjects at the secondary school level.
You will acquire knowledge of and the ability to apply available ICT to improve the
teaching and learning of school mathematics.
Specifically you will be able to:
(1) Distinguish between numerical and analytical methods/solutions
(2) Appreciate the need for learning and applying numerical methods
(3) Identify the main sources of errors and take measures to eliminate or reduce
such errors
(4) Derive and apply a number of interpolation methods
(5) Derive and apply a number of numerical integration methods
(6) Derive and apply a number of numerical methods for fnding roots of func
tion
(7) Solve a coupled system of two nonlinear equations in two variables.
Figure 6: Internet Dish at the AVULearning Center, University of Dar Es Salaam
/lrcan vrrua unversr, 8
VIII. specifc learning objectives
As already mentioned in the Module Outline given in Section VI, this is a two units
module and its contents will be presented using four learning activities. Each learning
activity has a set of specifc learning objectives. We are stating them here in advance
with a view to enable the learner have a global overview of what lies ahead in terms
of what s/he will be able to do on completion of the module.
At the end of the module, the learner will be able to:
S/N Lear
ning
Activity
Specifc Learning Objectives
1 Types
and sour
ces of
errors
• List the chief sources of computational errors and the practical
steps to be taken to eliminate or reduce their cumulative effect on
the numerical solution
• Appreciate the difference between the size (accuracy) and the
seriousness (precision) of an error.
• Understand and apply linear interpolation on a given table of
function values
• Estimate the error in linear interpolation for a known smooth
function
2 Interpo
lation
• Explain why numerical methods are essential in solving mathe
matical problems
• Write down and apply the Lagrange interpolation polynomial for
equally spaced data
• Write down and apply Newton’s interpolation based on divided
differences
• Defne and manipulate the shift, forward, backward, central and
mean difference operators
• Construct tables of differences for a given function or given data
• Derive and apply Newton’s forward, Newton’s backward, and
Stirling’s central difference interpolation polynomials.
3 Numeri
cal Inte
gration
• Derive, understand and apply the Trapezoidal rule, Simpson’s
rule and any other NewtonCotes type numerical integration for
mula
• Derive, understand and apply Romberg’s numerical integration
scheme based on either the Trapezoidal or Simpson’s rule.
4 Roots of
functions
• Derive and apply the bisection method
• Prove convergence of the bisection method
• Derive, understand and apply both the Secant and the Regula
Falsi methods
• Derive, understand and apply the Newton Raphson method
• Derive, understand and apply the Newton’s method on a pair of
nonlinear simultaneous equations.
/lrcan vrrua unversr, 9
IX. Teaching and learning activities
9.1 Preassessment
1. If x is an exact measurement of a certain quantity and x
0
is its approximation,
the concept of error in the approximation is defned by
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
x
0
− x
x − x
0
x − x
0
x − x
0
2. The absolute error in approximating the exact quantity x = 104 by the approxi
mate value x
0
= 107 is given by
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
4
3
7
104
The relative error in the approximation x
0
given in Question 1 is
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
0.028846
0.299462
0.002885
0.038462
3. One valid reason why the function
f (x) =
1 if x > 0
0 if x = 0
⎧
⎨
⎪
⎩
⎪
/lrcan vrrua unversr, '0
is not continuous at x = 0 is
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
lim
x → 0
lim
x → 0
lim
x → 0
lim
x → 0
f (x) = f (0)
f (x) = 0
f (x) = 1
f (x) ≠ f (0)
4. The continuous function x
3
− 3x − 3 must have a zero (root) at some point in
the
interval 2 < x < 3 because
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
f (2) f (3) = 0
f (2) f (3) < 0
f (2) > 0
f (2) = 0
f (3) < 0
f (3) = 0
5. The frst derivative of the function y = x
x
is
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
1+ ln(x) ( ) x
x
x
x
x
x
ln(x)
(1− ln(x))x
x
6. The truncated cubic Maclaurin series expansion of the function f (x) = 1+ x is
(a) :1−
x
2
+
x
2
4
−
3x
3
8
(b) :1+
x
2
−
x
2
4
+
3x
3
8
(c) :1−
x
2
+
x
2
8
−
x
3
16
(d) :1+
x
2
−
x
2
8
+
x
3
16
/lrcan vrrua unversr, ''
7. The general antiderivative of the function f (x) = ln(x) is given by
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
xln(x) + C
ln(x) − x + C
xln(x) − x + C
xln(x) + x + C
8. The value of the integral
1+ x
x
2
+ 2x + 5
3 1
2
∫
dx is
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
1.146581
1.145681
1.146185
1.164581
9. Working throughout with six decimal places accuracy, the approximate
value of
1+ x
x
2
+ 2x + 5
3 1
2
∫
dx using the Trapezoidal rule with h = 0.25 is
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
1.146850
1.416560
1.146038
1.146580
10. Working under the same conditions, the approximate value of the integral given
in Question 8 using Simpson’s rule is found to be
(a) :
(b) :
(c) :
(d) :
⎧
⎨
⎪
⎪
⎩
⎪
⎪
1.416039
1.146083
1.146038
1.146580
/lrcan vrrua unversr, '2
11. If the 3
rd
and 13
th
terms of an arithmetic sequence of numbers are 7 and 27 ,
respectively, then the 52
nd
element of the sequence is
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
103
105
107
106
12. Starting with x
0
= 2, the value of x
4
using the iteration formula x
n+1
=
3(1+ x
n
)
x
n
is
(a) :
(b) :
(c) :
(d) :
⎧
⎨
⎪
⎪
⎩
⎪
⎪
2.104255
2.103731
2.130731
2.103713
13. Given two points P(x
0
, y
0
) andQ(x
1
, y
1
) , the xcoordinate of the point where the
secant line AB cuts the x  axis is
(a)
x
1
y
0
− x
0
y
1
y
1
− y
0
(b)
y
1
− y
0
x
1
y
0
− x
0
y
1
(c)
x
0
y
1
− x
1
y
0
y
1
− y
0
(d)
y
1
− y
0
x
0
y
1
− x
1
y
0
⎧
⎨
⎪
⎪
⎪
⎪
⎪
⎩
⎪
⎪
⎪
⎪
⎪
/lrcan vrrua unversr, 'J
14. The curve of a function y = f (x) passes through two points whose coordinates
are (0.2,1.183) and(0.4,1.342) . By using the straight line which joins the
two points to approximate the curve of the function in the given interval, the
approximate value of y at x = 0.3 is found to be
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
y = 1.2265
y = 1.6225
y = 1.5262
y = 1.2625
15. Given a point P(x
0
, f (x
0
)) on the curve of a differentiable function y = f (x) ,
the x coordinate of the point where the tangent at P cuts the x  axis is
(a) : x
0
−
f (x
0
)
f
'
(x
0
)
(b) : x
0
+
f (x
0
)
f
'
(x
0
)
(c) : x
0
−
f
'
(x
0
)
f (x
0
)
(d) : x
0
+
f
'
(x
0
)
f (x
0
)
16. The Bisection method is based on the principle that a continuous function which
is positive at one point x = a and negative at another point x = b has a root
(zero) at some point x = c in the interval a < c < b and that the point x =
a + b
2
, which bisects the interval [a, b], is a reasonable approximation of c . Starting
with the two points a = 2, b = 3, application of the bisection method on
the function x
3
− 3x − 3 gives the value
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
x
3
=
x
3
=
x
3
=
x
3
=
2.215
2.115
2.125
2.225
after the third
bisection process.
/lrcan vrrua unversr, '4
17. The Newton Raphson method for approximating a root of a function f (x) uses
the iteration formula
x
n+1
= x
n
−
f (x
n
)
f
'
(x
n
)
n = 0,1, 2,...
If x
0
= 2 is an approximation of one of the roots of the function f (x) = x
3
− 3x − 3,
then application of the NewtonRaphson method on the function gives the value of
x
2
as:
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
x
2
=
x
2
=
x
2
=
x
2
=
2.130836
2.103386
2.301836
2.103836
18. The coordinates of the point where the curves representing the functions
x
2
+ y
2
= 4 ; x
2
− y
2
= 1 intersect each other and which lies in the frst qua
drant are
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
x = 1.224745,
x = 1.581139,
x = 1.511839,
x = 1, 242745,
y = 1.561139
y = 1.224745
y = 1.227445
y = 1.561139
19. Starting with x
0
= 1.5 , y
0
= 1.2 , the values x
3
and y
3
obtained using the pair
formulae x
n+1
= 4 − y
n
2
, y
n+1
= x
n
2
−1 n = 0,1, 2,... are
(a)
(b)
(c)
(d)
⎧
⎨
⎪
⎪
⎩
⎪
⎪
x
3
= 1.562050,
x
3
= 1.322875,
x
3
= 1.526050,
x
3
= 1.233875,
y
3
= 1.322875
y
3
= 1.562050
y
3
= 1.322875
y
3
= 1.562050
/lrcan vrrua unversr, '5
Solutions
1. (c) 11. (b)
2. (b) 12. (b)
3. (d) 13. (c)
4. (b) 14. (d)
5. (a) 15. (a)
6. (d) 16. (c)
7. (d) 17. (d)
8. (c) 18. (b)
9. (c) 19. (c)
10. (d)
Pedagogical Comment For Learners
The learner’s confdence to embark on this module will greatly be enhanced by
solving these preassessment questions.
Questions 1,2 are on errors and 3 is on continuity. If you have problems in solving
them you are advised to look up the defnitions given in the Module Glosary.
Questions 4,5,6 and 7 are on the concepts of limits, continuity, differentiation and
the antiderivative. If you fail to solve any of them then work through the relevant
Sections of the prerequisite Module (Mathematics Module 3). The same tip holds if
you experience diffculties in solving Questions 8,9,10 and 11 on integration.
Questions 12,13,16,17,18 and 19 relate to the concept of iterations and simula
tneous equations. Here, simply study carefully the given formulae and apply them
faithfully.
Questions 15, 16 and 17 are on linear approximation of a function. In case one faces
some problems in solving any of these, one should work through the relevant section
in your Higher Level Mathmatics books.
Each correct solution has 5 marks, giving a maximum score of 90 marks. A score in
the range 41 – 60 is average. A below average score (0 – 40) probably implies that
you need a thorough go at the relevant prerequisite material before starting the mo
dule. An average score may mean you can start the module but with frequent cross
reference to some prerequisite materials. With an above average score (61 – 90) the
learner should confdently embark on the module in the knowledge that he/she has
the required background knowledge to start and successfully complete it.
/lrcan vrrua unversr, '6
X. learning activities
LEARNING ACTIVITY # 1
Types and Sources of Errors
Summary
In this learning activity we discuss three important introductory topics. We begin by
making a distinction between analytic and numerical solutions. This is followed by
discussion of some typical mathematical problems specifcally selected to convince
the learner why numerical methods are needed. We conclude the activity by defning
the concept of errors in computational mathematics, pointing out their main causes,
types and presenting practical ways of eliminating or reducing their effect on nume
rical solutions.
Specific Learning objectives
At the end of this learning activity the learner will be able to:
• Defne the concept of errors in computational mathematics
• Distinguish between absolute and relative errors and appropriately relate
them to the concepts of accuracy and precision
• List the chief sources of computational errors and the practical steps to be taken
to eliminate or reduce their cumulative effect on the numerical solution
• Appreciate the difference between the size (accuracy) and the seriousness
(precision) of an error.
• Understand and apply linear interpolation on a given table of function va
lues
• Estimate the error in linear interpolation for a known smooth function
List of required readings
Wikipedia: Numerical Methods/Errors Introduction
List of relevant useful links
Wolfram MathWorld (visited 03.04.07)
http://mathworld.wolfram.com
Students should search for the entry covering the unit title. Also, search for
any key words in the text. Mathworld gives a detailed reference in all cases.
/lrcan vrrua unversr, '7
Wikipedia (visited 03.04.07)
http://en.wikipedia.org/wiki
As with mathworld, students should search for the entry covering the unit title.
Also, search for any key words in the text. Wikipedia generally gives shorter
and less complete entries. However, they can be easier to read.
MacTutor History of Mathematics (visited 03.03.07)
http://wwwhistory.mcs.standrews.ac.uk/Indexes
The MacTutor Archive is the most comprehensive history of mathematics on
the internet. Students should search for their unit title and read the history of
the subject. This gives a helpful overview of the importance and context of
the topic being studied.
Key Words
[Full defntions are given in the text]
Error in an approximation: The difference between the exact and the approximate
value.
Absolute error: The error without consideration of the sign (positive or negative).
Relative error: The ratio between the absolute error and the exact quantity.
Initial, discretization, truncation and rounding errors: Different types of errors
caused by different sources of error.
/lrcan vrrua unversr, '8
Learning Activity 1: Types and Sources of Errors
Introduction
This frst learning activity of the module is intended to provide the learner with
answers to the following important questions; questions raised by many students
taking a numerical methods course for the frst time.
(1) What is a numerical solution and how does such a solution differ from an exact
(true) or analytical solution?
(2) Why should one learn numerical methods? Are numerical methods needed?
(3) What are errors in the context of mathematics? What are the main sources of
computational errors? How can one eliminate errors or reduce their effect on
numerical solutions?
We begin the activity by explaining the difference between an analytic and a numerical
solution. In order to establish the need for numerical methods we discuss a number of
mathematical problems specifcally selected with a view to convince the learner that
there is a real need for learning numerical methods either because analytical solutions
cannot be found or they are too complex to be of any practical use.
To answer the questions on errors we defne the concept of an error and list a number
of sources of errors. In the sequel we also suggest for each type and source of error
practical steps to be taken to reduce the error and hence its impact on numerical
solution.
Analytic Methods, Numerical Methods and Errors.
(a) Analytic versus numerical methods
What is a numerical solution and how does such a solution differ from an exact (true)
or analytical solution?
An analytic method for solving a given mathematical problem is any method based
on rigorous mathematical analysis and whose application leads to the true (exact)
solution, also known as analytic solution.
A numerical method for solving a given mathematical problem is any method based
on rigorous mathematical analysis whose application, in most cases, can only lead
to an approximate (nonexact) solution, also known as numerical solution. In some
very rare cases, a numerical method may result in an exact solution.
/lrcan vrrua unversr, '9
Example 1.1
The exact solutions of the nonlinear equation x
2
− 5x + 3 = 0 can be obtained using
the well known quadratic formula (analytic method)
x
1, 2
=
−b± b
2
− 4ac
2a
.
This gives the analytic solutions x
1, 2
=
5 ± 13
2
.
On the other hand, the iteration formula (numerical method)
x
n+1
= 5x
n
− 3, n = 0,1, 2,... ; x
0
= 4.5
may also be applied to approximate one of the two solutions of the given quadratic
equation. This method can only give an approximate numerical solution.
DO THIS
Given the numerical integration formulas
Trapezoidal rule: [ ]
0 1 1 0
; ) ( ) (
2
) (
1
0
x x h x f x f
h
dx x f
x
x
− = + =
∫
Simpson’s rule:
[ ]
0 1 1 2 2 1 0
; ) ( ) ( 4 ) (
3
) (
2
0
x x x x h x f x f x f
h
dx x f
x
x
− = − = + + =
∫
Verify that:
(i) The trapezoidal rule gives exact values of the integral
∫
1
0
) (
x
x
dx x f for any linear
function b ax x f + = ) ( .
(ii) Simpson’s rule gives exact values of the integral
∫
2
0
) (
x
x
dx x f for any cubic
function :
d cx bx ax x f + + + =
2 3
) (
.
In general, the difference between analytical and numerical solutions can be summed
up by the statement: Analytical solutions are exact while numerical methods are
only approximate.
/lrcan vrrua unversr, 20
(b) Need for numerical methods
Why should one learn numerical methods? Are numerical methods needed?
Because of the above distinction between analytic and numerical solutions one can
easily be tempted to conclude that one should only use analytic methods in solving
mathematical problems. In other words, there is no need to learn numerical methods
because they can only give approximate solutions. Such a conclusion is misguided.
We need to learn numerical methods for the following three main reasons.
1. For some problems the analytical solution may not be known. A typical examples
is given by the following cases.
x 1.0 1.25 1.5 1.75
2.0
) (x f
0000 . 1 1180 . 1 1180 . 1 3229 . 1 4142 . 1
2. An integral, such as
∫
1
0
2
dx e
x
, is perfectly defned but the anti‑derivative of the in
tegrand
2
) (
x
e x f = cannot be expressed using known mathematical functions.
3. In some cases, it may be possible to fnd a mathematical expression for the
analytical solution of a given problem. However, the expression may be com
putationally too complicated to handle numerically. A typical problem is that of
fnding an anti‑derivative of the function
3
8
1
) (
x
x f
−
= .
After some tedious manipulations involving factorization of the denominator fol
lowed by application of the method of partial fractions, one fnds the general anti‑
derivative
C
x x
x x x
x F +
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛
− −
+ +
+
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛ +
=
−
4 4
4 2
ln
24
1
3
1
tan
12
3
) (
2
2
1
where C is an arbitrary constant of integration. This complicated result makes the
evaluation of a typical associated defnite integral
∫
−
2
1
3
8 x
dx
almost impossible to
carry out with any meaningful degree of accuracy.
/lrcan vrrua unversr, 2'
DO THIS
(i) Verify that ) ( x f
dx
dF
= (using the function F in example 3 above).
(ii) By factorizing
3
8 x − = ) 4 2 )( 2 (
2
+ + − x x x and applying the method of
partial fractions derive the expression for ) (x F as an antiderivative of ) (x f .
(c) Errors
What are errors in the context of mathematics? What are the main sources of com
putational errors? How can one eliminate errors or reduce their effect on numerical
solutions?
In the key words section you can fnd defnitions of the key concepts and stated the key
theorems and principles relevant to the topic of numerical methods. This includes the
defnitions of errors, absolute errors, relative errors, initial errors, discretization errors,
truncation errors and rounding errors. For ease of reference we list them here.
Assumption
Let
*
X be an approximation to an exact (true) quantity X . Then,
The absolute error in
*
X is defned by
*
X X − .
The error in
*
X is defned by
*
X X −
The percentage error in
*
X is defned by
X
X X
*
100
−
%
Since the exact (true) value X is normally not known, one replaces it with the
approximate value
*
X in the denominator of the expression for the relative and
percentage errors.
Precision and Accuracy
Measurements and calculations can be characterized with regard to their accuracy
and precision.
/lrcan vrrua unversr, 22
Precision refers to how big or how small the absolute error
*
X X − is. The absolute
error is therefore a measure of the precision of an approximation.
Accuracy refers to how closely the approximation
*
X agrees with the true value X
. Here, what counts is not only the magnitude of the deviation
*
X X −
but its size
relative to the true value X . Accuracy is therefore measured by the relative error
X
X X
*
−
.
(d) Types and Sources of Errors
We now list the sources and types of errors and briefy discuss methods of eliminating
or reducing such errors so that the numerical solution we get is not seriously affected
by them to the extent of rendering it meaningless.
(i) Initial errors
Any mathematical problem meriting to be solved numerically involves some initial
data. Such data may be in the form of coeffcients in a mathematical expression or
entries in a matrix. If this initial data is not exact, then the deviations from their respec
tive true values are called initial errors. In some problems, uncertainties in the initial
data can have devastating effect on the fnal numerical solution to the problem.
(ii) Discretization error
Most of the literature on the subject of computational errors does not make a distinc
tion between discretization and truncation errors, the reason being that the two types
of errors are almost inseparable. In this presentation we separate the two because
truncation errors are special types of discretization errors.
The true (exact) solutions of some mathematical problems are continuous functions
) (x f y = of their respective independent variables. In almost all cases, numerical
methods for solving such problems approximate the unknown continuous solution
) (x f by a sequence { } ) (
n
x f of approximate values of the solution at a discrete set of
points { }
n
x in the domain of the solution function ) (x f . For example, the continuous
function
x
e x x f
−
+ = ) ( is the solution of the initial value problem x y y + = + 1
/
,
1 ) 0 ( = y
/lrcan vrrua unversr, 2J
A typical numerical method for solving this problem is given by the recurrence
relation
, 1 , 0
0 0
= = y x
, ) 1 ( ) 1 (
1 1
h x y h y
n n n − −
+ + − = ,... 3 , 2 , 1 = n , h being a
constant distance between two consecutive discrete values of the variable x . The
error resulting from such a discretization process is called discretization error.
(iii) Truncation error
Truncation errors are special types of discretization errors. The term truncation error
refers to the error in a method, which occurs because some infnite process is stopped
prematurely (truncated) to a fewer number of terms or iterations in the process.
Such errors are essentially algorithmic errors and one can predict the extent of the
error that will occur in the method.
Specifcally, the solution obtained using some numerical methods may involve infnite
processes. For instance, this is the case with all convergent iteration methods and
convergent infnite series. Since such infnite processes cannot be carried out indef
nitely, one is forced to stop (truncate) the process and hence accept an approximate
solution. The error caused though this unavoidable termination of an infnite process
is called a truncation error.
(iv) Rounding error
Rounding errors are errors introduced during numerical calculations due to the ina
bility of calculating devices to perform exact arithmetic. For example, if we multiply
two numbers, each with six decimal digits, the product will have twelve decimal digits.
Unfortunately some calculating devices may not be able to display all twelve decimal
digits. In such cases one is forced to work with fewer digits thereby necessitating
dropping some of the (less signifcant) digits on the right of the product. The error
so introduced is called a rounding error.
(e) Methods of reducing errors
In the spirit of “prevention is better than cure” we shall attempt in this section to
give practical suggestions of ways to eliminate or reduce the impact of various types
of computational errors that are encountered in resorting to numerical methods.
(i) How to reduce initial error
Initial errors can have a devastating effect on numerical solutions.
We illustrate a typical case involving an example taken from Francis Sheid, Nume
rical Analysis, Shaum Outline Series, 1968 page 342 involving the solution of the
following two simultaneous linear equations.
x

y
=
1
x

y 00001 . 1
=
0
/lrcan vrrua unversr, 24
The true (analytical) solution is 001 , 100 = x , 000 , 100 = y . In this example, the
set of initial data consists of the elements of the coeffcient matrix
and the right hand side vector .
However, if the entry 00001 . 1 − in the matrix A
is changed
to 99999 . 0 − while all other data items remain unchanged, the resulting system of
equations
x

y
=
1
x

y 99999 . 0
=
0
has the drastically changed exact (analytical) solution 999 , 99 − = x , 000 , 100 − = y
This somewhat startling result demonstrates how a small change in the initial data
can cause disproportionately large changes in the solution of some problems.
Thus, the only way to reducing or if possible, to eliminate initial errors is by ensuring
that all data given with or computed for use in solving a problem is as accurate
as is humanly possible.
(ii) How to reduce discretization errors
Different numerical methods for approximating the solution of a given mathematical
problem can result in numerical solutions with very different degrees of accuracy
due to the magnitudes of their respective discretization errors. Consider the problem
of evaluating the defnite integral:
∫
+
1
0
2
1 x
dx
. The exact (analytical) value of the integral, correct to six decimal places
is
785398 . 0 ) 1 ( tan
1
=
−
.
Let us apply the trapezoidal method and Simpson’s rule using an interval length
25 . 0 = h . First we evaluate the integrand
2
1
1
) (
x
x f
+
= at the relevant points and
get
⎥
⎦
⎤
⎢
⎣
⎡
−
−
=
00001 . 1 1
1 1
A
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛
=
0
1
b
/lrcan vrrua unversr, 25
i 0 1 2 3 4
i
x
0 25 . 0 5 . 0 75 . 0 1
) (
i
x f
000000 . 1 941176 . 0 800000 . 0 640000 . 0
500000 , 0
The trapezoidal rule [ ]
⎭
⎬
⎫
⎩
⎨
⎧
+ + + + ) ( ) ( ) ( ) ( 2 ) (
2
4 3 2 1 0
x f x f x f x f x f
h
gives the numerical solution 782794 . 0 .
Simpson’s rule [ ] { } ) ( ) ( 2 ) ( ) ( 4 ) (
3
4 2 3 1 0
x f x f x f x f x f
h
+ + + + leads to
the numerical solution 0.785392.
One observes that, while the solution obtained using the trapezoidal rule is correct
to only two decimal places, the solution obtained using Simpson’s rule is correct to
four decimal places. This signifcant difference in the accuracy of the two numerical
solutions is caused by the differences in the discretization errors of the two nume
rical methods. Simpson’s rule has a smaller discretization error than the trapezoidal
rule.
In general, discretization errors cannot be avoided. However, one can reduce them
substantially by being careful in selecting a numerical method whose discretization
error is known a priori to be relatively small.
(iii) How to reduce truncation errors
Truncation errors are caused by the unavoidable need to stop a convergent infnite
process in efforts to get a solution. The size of the truncation error will therefore
depend on the particular infnite process (numerical method) being used an on how
far we are prepared to carry on with the infnite process.
The truncation error can be reduced either by
(a) Choosing a numerical method with a small truncation error or
(b) Carrying out the infnite process suffciently far.
/lrcan vrrua unversr, 26
Example 1.2
The continuous function 1 3 ) (
2
+ − = x x x f has a root which lies in the interval
1 0 < < x (Why?). Using the quadratic formula, the exact value of the root correct
to six decimal places is 381966 . 0 = ρ . A number of iterative methods exist for
approximating such a root. Here we consider two such methods:
The bisection method
x
n+1
=
x
n
− x
n−1
2
, provided
f (x
n
) f (x
n−1
) < 0
.
The NewtonRaphson method
x = x −
f (x
n
)
f
/
(x
n
)
, provided f
/
(x
n
) ≠ 0.
If one performs only three iterations (truncation after three iterations) with each
method using the starting values 0
0
= x and 1
1
= x for the bisection method and
0
1
= x for the NewtonRaphson method, one gets the following sequence of ap
proximations for each method.
Method Initial Values
2
x
3
x
4
x
Bisection
0
0
= x
1
1
= x
500000 . 0 250000 . 0 375000 . 0
Newton
Raphson
0
1
= x
333333 . 0 380952 . 0 381966 . 0
These results demonstrate that in stopping the infnite process (iteration) after the
third iteration, the truncation error of the Newton Raphson method is much smaller
than that of the bisection method.
/lrcan vrrua unversr, 27
DO THIS
Continue applying the bisect method on the above example until the solution is correct
to three decimal places. How many more iterations did this require?
(iv) How to Reduce Rounding Errors
Before we discuss this important last task in our learning activity we shall frst intro
duce a few terms that will frequently be mentioned and used in the process.
•What are Figures or Digits
In computational mathematics, the words “fgure” and “digit” are synonyms. They
are used interchangeably to mean any one of the ten numerals in the set {0, 1, 2, 3,
4, 5, 6, 7, 8, 9}.
In the decimal system of real numbers, a number N is a string or an ordered se
quence of fgures or digits A typical example is the number
0 0000450700 . 0365 0007392060 = N
A number can be viewed as a measure of the size or magnitude of some real or ima
ginary quantity. The position of each digit in the string of digits has direct bearing
on the importance or signifcance of that digit (fgure) in the overall measure of the
size or magnitude of the quantity the number represents.
Intuitively we know that the leftmost digit 7 in the number N above is more signi
fcant than the rightmost digit 7.
• Which digits in a number are Signifcant?
The following rules apply in deciding which digits or fgures in a given number are
signifcant.
1. Nonzero integers are always signifcant fgures.
2. Any zeros on the leftmost part of a number are not signifcant.
3. All zero digits positioned between nonzero digits are signifcant.
4. Zeros at the rightmost end of a number are counted as signifcant only if the
number contains a decimal point.
• How many Signifcant Figures are in a given Number
The number of signifcant fgures in a given number is found using the following
rule:
Rule 1: The number of signifcant fgures in a purely integer number (with no decimal
digits) is obtained by counting, starting with the leftmost nonzero digit and ending
with the rightmost nonzero digit.
/lrcan vrrua unversr, 28
Example 1.3
The number 541500409 has 9 signifcant fgures.
The number 002507030 has 6 signifcant fgures
Rule 2: The number of signifcant fgures in a number having a decimal part is ob
tained by counting all the digits, starting with the leftmost nonzero digit.
Example 1.4
The number 6.00213 has 6 signifcant fgures.
The number 6.00213000 has 9 signifcant fgures
NOTE: All zero digits at the end of a decimal number are signifcant.
(iv) How to Reduce Rounding Errors
Armed with the concepts of digits/fgures and signifcant fgures in a number we can
now comfortably discuss ways of reducing rounding errors.
One obvious method of dealing with the problem of rounding errors is to work with
the maximum allowable accuracy on our calculating device at each stage in our
calculations.
Example 1.5
Find the sum of the numbers 2.35, 1.48, 4.24 using a calculating device that can only
handle numbers with two signifcant fgures.
The exact sum is 07 . 8 24 . 4 48 . 1 35 . 2 = + + = S
If we neglect the second decimal digit from each term and form their sum we fnd
the approximate sum
9 . 7 2 . 4 4 . 1 3 . 2
1
= + + = S
The absolute error in
1
S is: 17 . 0
1
= − S S
A better approximation of S under the same limitations is
1 . 8 2 . 4 5 . 1 4 . 2
2
= + + = S
/lrcan vrrua unversr, 29
The absolute error in
2
S is: 03 . 0
2
= − S S
This error is signifcantly smaller than that in
1
S .
The immediate question expected to be raised by the learner is “How did one arrive
at the two digit terms in the sum
2
S ?”
The answer to the above question is simple. Each term has been obtained from its
corresponding threedigit term by rounding.
The learner will soon know how to round numbers
What it means to round a number
To round a number to a fxed number of fgures or digits simply means leaving out
(dropping) all digits on the right hand side of the number beyond a certain posi
tion.
If a number is rounded simply by dropping all digits beyond a certain position on the
right hand side of the number without making any adjustments to the last retained
digit, then one speaks of “rounding off or chopping the number”.
Example 1.6
The sum
1
S has been calculated using terms obtained from the original numbers by
rounding off (chopping) the third decimal digit from each term. The term 2.35 was
rounded to 2.3, the term 1.48 was rounded to 1.4 and the term 4.24 was rounded to
4.2. In each case, the last retained digit (the frst decimal place) has not been adjusted
in the process of rounding.
Note
The sum
2
S has also been obtained through rounding. However, the rounding this
time is different. Here, not all the three terms have been rounded off!
The term 2.35 has been rounded to 2.4
The term 1.48 has been rounded to 1.5
The term 4.24 has been rounded to 4.2
We observe that in rounding each of the frst two terms 2.35 and 1.48, the digit occu
pying the second decimal position has been dropped but the digit occupying the frst
decimal position has been adjusted by increasing it by one (unity). The third digit
4.24 has simply been rounded off.
This practice (or as yet unknown rule for rounding numbers) seems to have some
signifcant advantage over rounding off manifested by the above example in which
2
S is more accurate than
1
S .
/lrcan vrrua unversr, J0
Rules for Rounding Numbers
In order to reduce the error in rounding numbers, the rejection of digits beyond some
predetermined position ( n ) is accompanied by making adjustments to the digit re
tained in position (n1). The adjustment involves either leaving the digit in position
( n ) unchanged or increasing it by one (unity). The decision to retain or increase by
1 the digit occupying position (n1) is governed by the following rules.
(a) If the digit in position ( 1 + n ) is greater than 5 then the digit in position ( n )
is increased by 1.
(b) If the digit in position ( 1 + n ) is 5 and at least one other digit to its right is non
zero then the digit in position ( n ) is increased by 1.
(c) If the digit in position ( 1 + n ) is less than 5 then the digit in position ( n ) is
left unchanged.
(d) If the digit in position ( 1 + n ) is 5 and all other digits to the right of position
( 1 + n ) zero, then
(i) The digit in position ( n ) is increased by 1 if it is an odd number ) 9 , 7 , 5 , 3 , 1 ( ;
(ii) The digit in position ( n ) is retained unchanged if it is an even number
) 8 , 6 , 4 , 2 , 0 ( .
Example1.7
Rounding a given number correct to two signifcant fgures
S/N Number Rounded to 2 Signifcant
fgures
Rule Used
1 8.361 8.4 (a)
2 8.351 8.4 (b)
3 8.350 8.4 (d) (i)
4 8.450 8.4 (d) (ii)
5 8.050 8.0 (d) (ii)
6 8.349 8.3 (c)
7 2.55 2.6 (d) (i)
8 2.65 2.6 (d) (ii)
9 0.0557 0.056 (a)
10 0.0554 0.055 (b)
/lrcan vrrua unversr, J'
Formative Evaluation: Students should work through this exercise carefully writing
full solutions for each problem. They should check their work thoroughly using the
solutions provided.
Questions
1. (a) Using the method of substitution fnd the exact solution of the linear system
of equations
905 . 16 10 7
075 . 12 7 5
= +
= +
y x
y x
(b) Round the values on the right hand side of each equation to two signifcant fgures
and then fnd the exact solution of the resulting system of linear equation.
(c) Use the solutions obtained from the two systems of equations to explain why
initial errors need to be avoided as much as possible.
2. (a) How many signifcant fgures are in each of the following numbers:
(i) 00001000020000
(ii) 10000200003004
(iii) 000123.0004500
(b) Round each of the following numbers correct to fve signifcant fgures.
(i) 0123.395
(ii) 0123.205
(iii) 0123.206
3. Given the quantity
20
3
11
3
3
1
−
⎟
⎠
⎞
⎜
⎝
⎛
+ = X , perform the following calculations:
(a) Find the exact value of X correct to fve signifcant fgures.
(b) Approximate value of X using three digit chopping arithmetic (rounding
without making any adjustments).
(c) Approximate value of X using three digit rounding arithmetic.
(d) Calculate the absolute errors and percentage errors in the approximations
obtained in parts (b) and (c).
/lrcan vrrua unversr, J2
4. The truncation error ) (x E in linearly interpolating a function ) (x f between two
points
0
x and
1
x , with h x x + =
0 1
, is given by ) ( ) )( (
2
1
) (
//
1 0
ξ f x x x x x E − − =
where ξ is some point in the interval ) , ( :
1 0
x x I = .
(a) Using the second derivative test, show that
M
h
x E Max
I x
8
) (
2
=
∈
, where
M = Max
x ∈I
f
/ /
(x)
.
(b) If ) sin( ) ( x x f = determine the value of h for which the truncation error
will always be less than 01 . 0 .
5. Assuming that the function ) (x f has a single root ρ lying inside the closed
interval, b x a ≤ ≤ the bisection method for approximating ρ uses the iteration
formula
2
1 2 − −
+
=
i i
i
x x
x , ,.... 3 , 2 , 1 = i a x =
−1
, b x =
0
, 0 ) ( ) (
1 2
<
− − i i
x f x f
(a) Prove by mathematical induction that the error in the
th
i iterate
i
x is given by
i
i
a b
E
2
−
= .
(b) If 0 = a and 1 = b , how many bisection iterations will be needed to obtain
an approximation with an error not greater than
3
10
−
?
Solutions
1. (a) 415 . 2 = x , 0 = y .
(b) 1 = x , 1 = y .
(c) Initial errors must be avoided because the solutions of some problems may
be very sensitive to relatively small initial errors.
2. (a) (i) 6 (b) (i) 123.40
(ii) 14 (ii) 123.20
(iii) 10 (iii) 123.21
/lrcan vrrua unversr, JJ
3. (a) Exact value 45606 . 0 = X
(b) Approximate value 455 . 0 =
b
X
(c) Approximate value 456 . 0 =
c
X
(d) Absolute error 00106 . 0 = −
b
X X
Absolute error 00006 . 0 = −
c
X X
Percentage errors % 23 . 0 100 =
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛ −
X
X X
b
Percentage errors % 013 . 0 100 =
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛ −
X
X X
c
4. (a) Consider the function ) )( ( ) (
1 0
x x x x x g − − = whose frst and second deri
vatives are: ) ( 2 ) (
1 0
/
x x x x g + − = and 2 ) (
//
= x g , respectively. ) (x g has a
single critical point at
2
1 0
x x +
= ζ , and since 0 ) (
//
> ς g , we conclude that
) (ς g = ) )( (
1 0
x x − − ς ς
=
⎥
⎦
⎤
⎢
⎣
⎡
− +
⎥
⎦
⎤
⎢
⎣
⎡
− +
1 1 0 0 1 0
2
1
2
1
2
1
2
1
x x x x x x
= ( ) ( )
1 0 0 1
2
1
2
1
x x x x − −
=
4
2
h
−
We therefore conclude that and hence the result that
Max E x
h
M  ( ) =
2
4
.
Max g x
h
 ( ) =
2
4
/lrcan vrrua unversr, J4
(b) With ) sin( ) ( x x f = , we have 1 = M and therefore we need to fnd h such
that 01 . 0
8
2
≤
h
. This leads to the value 3 . 0 08 . 0 < ≤ h .
5. (a)Mathematical induction
i
i
a b
E
2
−
=
Test : Formula is true for 1 = i because the error in the frst bisection is
2
a b −
.
Assumption: Let the formula hold for 1 > = k i (fxed). This means
k
k
a b
E
2
−
= .
Induction: Error in
k k k
E E x
2
1
1 1
= =
+ +
1
2 2 2
1
+
−
=
⎥
⎦
⎤
⎢
⎣
⎡ −
k k
a b a b
= . Q.e.d
(b) If 0 = a and 1 = b , then
i
i
E
2
1
= . This will not exceed
3
10
−
if .
10
) 2 ln(
) 1000 ln(
= ≥ i
/lrcan vrrua unversr, J5
Learning Activity 2: Interpolation
Summary
The concept of interpolation is important in any introductory course on numerical
methods. Numerical approximation addresses both the need to approximate numbers
as well as approximating functions. Numerical interpolation approximates functions.
We approximate functions for one or several of the following reasons:
• A large number of important mathematical functions may only be known
through tables of their values.
• Some functions may be known to exist but are computationally too complex
to manipulate numerically.
• Some functions may be known but the solution of the problem in which they
appear may not have an obvious mathematical expression to work with.
Interpolation as it is presented in this Learning Activity will give the Learner an op
portunity to experience frst hand some practical applications of numerical methods
in solving the mathematical problem of approximating a function ) (x f which is
known only through a set of values at a fnite number of points.
This Learning Activity covers the following subtopics:
• Linear interpolation
• Lagrange interpolation polynomial
• Newton’s divided differences interpolation polynomial
• Finite differences interpolation polynomials
We start off by defning the concept of interpolation. Linear interpolation is used to
illustrate the concept. This is followed by presenting special interpolation polynomials.
Specifcally, we discuss interpolation polynomials based on Lagrangian interpola
tion coeffcients, Newton’s divided differences and on fnite differences.
Specific Learning objectives
At the end of this Learning Activity the learner will be able to:
• Explain why numerical methods are needed in solving interpolation pro
blems.
/lrcan vrrua unversr, J6
• Apply Lagrangean interpolation polynomials.
• Apply Newton’s divided differences interpolation polynomial.
• Defne and manipulate fnite difference operators (shift, forward, backward,
central and mean difference operators).
• Construct tables of differences for tabulated function values.
• Derive and apply Newton’s forward, Newton’s backward and Stirling’s
central difference interpolation polynomials, and fnally
• Use fnite difference interpolation polynomials in deriving some numerical
integration methods.
List of required readings
Wikipedia: Interpolation
List of relevant useful links
Wolfram MathWorld (visited 03.04.07)
http://mathworld.wolfram.com
Students should search for the entry covering the unit title. Also, search for
any key words in the text. Mathworld gives a detailed reference in all cases.
Wikipedia (visited 03.04.07)
http://en.wikipedia.org/wiki
As with mathworld, students should search for the entry covering the unit title.
Also, search for any key words in the text. Wikipedia generally gives shorter
and less complete entries. However, they can be easier to read.
MacTutor History of Mathematics (visited 03.03.07)
http://wwwhistory.mcs.standrews.ac.uk/Indexes
The MacTutor Archive is the most comprehensive history of mathematics on
the internet. Students should search for their unit title and read the history of
the subject. This gives a helpful overview of the importance and context of
the topic being studied.
Key Terms and Theorems
Full defnitions are given in the text.
Interpolation: approximation of a function using discrete values.
Interpolation polynomial: a polynomial which interpolates a function using discrete
values provided.
Divided Differences: Differences of the function values provided, related to the
differences between the discrete points provided.
/lrcan vrrua unversr, J7
Finite difference operators: Mathematical operators used in constructing the diffe
rences in the function values.
Finite difference tables: A table showing different orders of the differences in the
function values.
Introduction
How Many Learning Activities are in this Module?
As stated in the summary above, numerical methods are used both for approximating
numbers as well as for approximating functions. The contents of this module are
covered in four Learning Activities. Two of these Learning Activities are on methods
of approximating numbers (the defnite integral and roots of functions). Another
Learning Activity is on errors and a fourth Learning Activity is on numerical methods
for approximating functions.
Why are Polynomials Chosen to Approximate Functions?
Functions are approximated using other functions deemed to be simple to manipulate
numerically. Specifcally, one uses polynomials to approximate other complicated
functions, mainly because polynomials are
• Simple to evaluate
• Simple to differentiate, and
• Simple to integrate.
We begin the presentation by defning the concept of interpolation and establishing
the need for numerical methods for carrying out interpolation. This is followed by
a detailed discussion of the simplest polynomial used in approximating functions,
liner interpolation. Higher order interpolation polynomials are then introduced,
including
• Lagrangian interpolation polynomials
• Newton’s divided differences interpolation polynomials, and fnally
/lrcan vrrua unversr, J8
• Finite difference interpolation polynomials.
At the end of the Learning Activity we briefy discuss the possible use of interpolation
polynomials in deriving some numerical integration methods such as the Trapezoidal
rule and Simpson’s rule.
Learning activity # 2
2.1 Meaning of Interpolation
The mathematical concept of interpolation is concerned with the problem of approxi
mating a function ) (x f defned over a closed interval ] , [ b a .
The function ) (x f to be approximated is usually defned through a set of its values
at 1 + n distinct points lying in the interval ] , [ b a . Typically one is given the pairs
of values
b x a x n k x f x
n k k
= = = , ; ,..., 2 , 1 , 0 )); ( , (
0
The problem is then to fnd values (or even derivatives) of the function at some non
tabular points lying inside the interval.
These types of problems are quite common in experimental physics and chemistry,
where an algebraic expression for a function may not be known but its values for
different values of its independent variable may be obtained experimentally through
laboratory measurements.
Typical Example (Bajpai et al 1975 pp 205)
In an experiment carried out in a physics laboratory, the length y of a wire was
measured for various loads x suspended from it. The results of the experiment are
as tabulated hereunder:
Table 1: Load versus extension of a wire
: x Load (kg)
0 1 2 3 4 5
: y Length (mm)
2027.1 2029.4 2031.8 2034.1 2036.5 2039.0
/lrcan vrrua unversr, J9
From the data obtained above one may wish to know the length of the wire for any
non tabulated load lying inside the range ] 5 , 0 [ . This is known as interpolating
the function ) (x f y = , where the functional dependence of y on the load x is not
explicitly given here. Any attempt to use the data to calculate the length of the wire
for a load outside the given range is called extrapolation.
2.2 Linear interpolation
In linear interpolation we assume that we have two points ) , (
0 0
f x A and ) , (
1 1
f x B
on the curve of a (usually unknown) continuous function ) (x f y = and that we now
wish to approximate the value of the function at a point
) , (
1 0
x x x ∈ .
DO THIS
Revisit and learn the various forms of defning a straight line and writing the equation
of the straight line for each form:
• Twopoints given
• A point and a slope is given
Because a straight line is completely defned by giving two points which lie on it,
we approximate the function ) (x f locally over the interval ] , [
1 0
x x by the straight
line through the two given points.
The equation of the straight line can be given in different forms. Here we consider
three forms:
(i) The usual yintercept  slope or Newton’s form.
(ii) The Lagrange form and
(iii) The determinant form
For computational purposes, the determinant form is the best of the three forms given.
/lrcan vrrua unversr, 40
⎪
⎪
⎪
⎪
⎪
⎪
⎩
⎪
⎪
⎪
⎪
⎪
⎪
⎨
⎧
−
−
−
−
−
+
−
−
−
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛
−
−
+
=
x x f
x x f
x x
iii
f
x x
x x
f
x x
x x
ii
x x
x x
f f
f i
x P
1 1
0 0
0 1
1
0 1
0
0
1 0
1
0
0 1
0 1
0
1
1
) (
) (
) ( ) (
) (
Worked Example 1
Using the data obtained from the laboratory experiment of suspending load from a
wire and measuring its length, apply the determinant form of linear interpolation to
approximate the length of the wire when the load is 2.7 kg
Solution
In this example we substitute the values
7 . 2 , 1 . 2034 , 3 , 8 . 2031 , 2
1 1 0 0
= = = = = x f x f x
into the determinant form of the equation and obtain the value
41 . 2033
3 . 0 1 . 2034
7 . 0 8 . 2031
) 7 . 2 (
1
=
−
= P
which looks to be quite reasonable in that as may be expected, it is closer to
1
f than
it is to
0
f .
/lrcan vrrua unversr, 4'
DO THIS (2.1)
Apply the other two forms of the linear interpolation function ) (
1
x P to approximate
the length of the wire when the load is 1.35 kg
2.3 Error in linear interpolation
We now attempt to answer the question: How big is the error in linear interpola
tion?
In other words, we wish to know how accurate the answers obtained through the
process of linear interpolation are.
An important feature of interpolation polynomial ) (x P
n
of any degree is that
n k x f x P
k k n
,..., 2 , 1 , 0 ) ( ) ( = = .
For linear interpolation this implies that ) ( ) ( ), ( ) (
1 1 0 0
x f x P x f x P = = .
This further implies that the error ) (x E at any point ] , [
1 0
x x x ∈ in linear interpo
lation must have the form
C x x x x x E ) )( ( ) (
1
− − =
where C is a constant which is independent of x . In a subsequent section of this Lear
ning Activity the value of C for a function ) (x f which is assumed to be suffciently dif
ferentiable is given as ) (
2
1
//
ξ f C =
where ) , , ( ) , , (
1 0 1 0
x x x Max x x x Min < < ξ
With this result, the error in linear interpolation assumes the form
). (
2
1
) )( ( ) (
//
1 0 1
ξ f x x x x x E − − =
If ) (
//
x f Max M = over the interval ] , [
1 0
x x , then one can show that
2 2
0 1 1
8
1
) (
8
1
) ( Mh x x M x E = − ≤
/lrcan vrrua unversr, 42
2.4 Interpolation polynomials
As already stated at the beginning of the Learning Activity the main problem of
polynomial interpolation may be stated as follows:
Given the values
k k
f x f = ) ( of some continuous function ) (x f at 1 + n distinct
points n k x
k
,..., 2 , 1 , 0 , = one is required to construct a polynomial ) (x P
n
of
degree n such that it satisfes the following co‑location criteria
n k f x P
k k n
,..., 2 , 1 , 0 ; ) ( = =
One can show that this so called “Interpolation polynomial” does exist and is unique.
However there are different forms of representing the interpolation polynomial. In
this Learning Activity we give four different forms of the interpolation polynomial.
2.5 Lagrangean interpolation polynomial
The Lagrangean form of the interpolation polynomial has the general form
∑
=
= + + + + =
n
i
i i n n n
f x L f x L f x L f x L f x L x P
0
2 2 1 1 0 0
) ( ) ( .... ) ( ) ( ) ( ) (
in which the terms n i x L
i
,..., 2 , 1 , 0 ), ( = are individually polynomials of degree
n in x called are called the Lagrangean interpolation coeffcients.
To ensure that ) (x P
n
satisfes the co‑location criteria given above, the Lagrangean
interpolation coeffcients are constructed such that they satisfy the condition
⎪
⎩
⎪
⎨
⎧
≠
=
= =
j i if
j i if
x L
j i j i
0
1
) (
,
δ
One can verify that the following defnition of ) (x L
i
meets this requirement:
/lrcan vrrua unversr, 4J
) )...( )( )...( )( (
) )...( )( )...( )( (
) (
1 1 1 0
1 1 1 0
n i i i i i i i
n i i
i
x x x x x x x x x x
x x x x x x x x x x
x L
− − − − −
− − − − −
=
+ −
+ −
With this defnition of the Lagrangian interpolation coeffcients one can now verify
the colocation condition on the interpolation polynomial, for
n j f f f x L x P
j i
n
i
ij
n
i
j j i j n
,..., 2 , 1 , 0 ; ) ( ) (
0 0
= = = =
∑ ∑
= =
δ
Worked Example 2
Construct the cubic Lagrangean interpolation polynomial which interpolates the
function ) (x f given by the following table of values:
Table 2
i 0 1 2 3
i
x
1 2 3 4
i
f
1.54 0.58 0.01 0.35
P
3
(x) = 1.54L
0
(x) + 0.58L
1
(x) + 0.01L
2
(x) +
0.35L
3
(x)
where
) 3 )( 2 )( 1 (
6
1
) 3 4 )( 2 4 )( 1 4 (
) 3 )( 2 )( 1 (
) (
) 4 )( 2 )( 1 (
2
1
) 4 3 )( 2 3 )( 1 3 (
) 4 )( 2 )( 1 (
) (
) 4 )( 3 )( 1 (
2
1
) 4 2 )( 3 2 )( 1 2 (
) 4 )( 3 )( 1 (
) (
) 4 )( 3 )( 2 (
6
1
) 4 1 )( 3 1 )( 2 1 (
) 4 )( 3 )( 2 (
) (
3
2
1
0
− − − =
− − −
− − −
=
− − − − =
− − −
− − −
=
− − − =
− − −
− − −
=
− − − − =
− − −
− − −
=
x x x
x x x
x L
x x x
x x x
x L
x x x
x x x
x L
x x x
x x x
x L
/lrcan vrrua unversr, 44
DO THIS (2.2)
Make use of the above Lagrangean interpolation polynomial to interpolate the func
tion ) (x f at 6 . 2 = x
Observation
(i) We note that the second form (ii) of the equation of a straight line given in the
DO THIS (2.1) selfexercise problem is a typical example of the Lagrangean
linear interpolation formula.
(ii) In changing from one degree Lagrangian interpolation polynomial to ano
ther, say from linear to quadratic, all calculations must be done afresh. For
instance, none of the expressions used in the linear approximation case (the
linear Lagrangian coeffcients ) ( ), (
1 0
x L x L ) are useful in the construction of
the quadratic Lagrangian interpolation polynomial.
Because of the second observation, efforts have been made to construct interpola
tion polynomials that are iterative in the sense that, a higher degree interpolation
polynomial can be got simply by adding higherdegree terms to an existing lower
degree interpolation polynomial. In what follows we shall present two interpolation
polynomials in this category.
2.6 Newton’s divided differences
Let the function ) (x f be given at 1 + n distinct points
n
x x x ,..., ,
1 0
such that
n k x f f
k k
,..., 2 , 1 , 0 , ) ( = =
We defne what are known as Newton’s divided differences
n k x x x f
k
,..., 2 , 1 , ] ,..., , [
1 0
= as follows
0
1 2 1 0 3 2 1
2 1 0
0 3
2 1 0 3 2 1
3 2 1 0
0 2
1 0 2 1
2 1 0
0 1
0 1
1 0
] ,..., , , [ ] ,..., , , [
] ..., , , [
] , , [ ] , , [
] , , , [
] , [ ] , [
] , , [
] , [
x x
x x x x f x x x x f
x x x x f
x x
x x x f x x x f
x x x x f
x x
x x f x x f
x x x f
x x
f f
x x f
k
k k
k
−
−
=
•
•
−
−
=
−
−
=
−
−
=
−
/lrcan vrrua unversr, 45
A typical table of divided differences would look as follows
Table 3: Table of Divided Differences
Divided Differences
x
) (x f
First Second Third Fourth
0
x ) (
0
x f
] , [
1 0
x x f
1
x ) (
1
x f
] , , [
2 1 0
x x x f
] , [
2 1
x x f ] , , , [
3 2 1 0
x x x x f
2
x ) (
2
x f
] , , [
3 2 1
x x x f ] , , , , [
4 3 2 1 0
x x x x x f
] , [
3 2
x x f ] , , , [
4 3 2 1
x x x x f
3
x ) (
3
x f
] , , [
4 3 2
x x x f ] , , , , [
5 4 3 2 1
x x x x x f
] , [
4 3
x x f ] , , , [
5 4 3 2
x x x x f
4
x ) (
4
x f
] , , [
5 4 3
x x x f
] , [
5 4
x x f
5
x
) (
5
x f
Using these divided differences Newton derived the following nth degree po
lynomial ) (x P
n
which interpolates the function ) (x f at the 1 + n distinct
collocation points n k x
k
,..., 2 , 1 , 0 , = : (Burden and Faires, 1989 p 113)
∑
=
−
+
− − − + =
− − − − +
+ − − −
+ − − + − + =
n
k
k k n
n n
n
x x x x f x x x x x x x f x P
OR
x x x x f x x x x x x x x
x x x x f x x x x x x
x x x f x x x x x x f x x x f x P
1
1 2 1 0 1 0 0
2 1 0 1 2 1 0
3 2 1 0 2 1 0
2 1 0 1 0 1 0 0 0
] ,... , , [ ) )...( )( ( ) ( ) (
] ,..., , , [ ) )...( )( )( (
... ] , , , [ ) )( )( (
] , , [ ) )( ( ] , [ ) ( ) ( ) (
We shall illustrate this approach on the following example.
/lrcan vrrua unversr, 46
Worked Example 3
(i) Construct a table of divided differences for the function ) (x f given by the fol
lowing data:
Table 4: Tabulated values of a function
x 3 2 1 0 1 2 3
f(x) 17 25 13 5 1 23 115
(ii) Use the resulting table of differences to interpolate ) (x f at:
3 . 2 − = x
using Newton’s linear, quadratic and cubic interpolation polynomials
based at 3
0
− = x
Solution
Table 5: Table of divided differences
Divided Differences
x
) (x f
First Second Third Fourth
3 17
8
2 25 10
12 4
1 13 2 1
8 0
0 5 2 1
4 4
1 1 10 1
24 8
2 23 34
92
3 115
Interpolation based on 0 . 3 − = x
/lrcan vrrua unversr, 47
• Linear Interpolation
Here we take: 3 . 2 , 8 ] , [ , 17 ) ( , 0 . 3
1 0 0 0
− = − = − = − = x x x f x f x and we
get 6 . 22 ] , [ ) ( ) ( ) 3 . 2 (
1 0 0 0
− = − + = − x x f x x x f f
• Quadratic Interpolation
Because we are interpolating at the same point 3 . 2 − = x we only need to consider
the additional term ] , , [ ) )( (
2 1 0 1 0
x x x f x x x x − − whose value at 3 . 2 − = x is
1 . 2 ) 10 )( 3 . 0 )( 7 . 0 ( − = −
Adding this correction to the value obtained through linear interpolation we get
7 . 24 1 . 2 6 . 22 ) 3 . 2 ( − = − − = − f
• Cubic interpolation
Again we only need to calculate a correction to be made in the value obtained using quadra
tic interpolation. The additional term is ] , , , [ ) )( )( (
3 2 1 0 2 1 0
x x x x f x x x x x x − − −
whose value is 092 . 1 ) 4 )( 3 . 1 )( 3 . 0 )( 7 . 0 ( − = − − −
.
Making this correction in the value obtained by quadratic interpolation gives
792 . 25 ) 3 . 2 ( − = − f
DO THIS (2.3)
Using the above table of divided differences
(i) Write down the value of the divided difference ] , , [
4 3 2
x x x f and show exactly
how it has been arrived at.
(ii) Interpolate ) (x f at 3 . 0 − = x using a 4th degree Newton’s divided differences
interpolation polynomial based on the point
0 . 1 − = x .
Compare your answer with the value of the function 5 4 3 2 ) (
2 3 4
− + − + = x x x x x f
at 3 . 0 − = x
/lrcan vrrua unversr, 48
2.7 Finite Difference Operators
The third and fnal set of interpolation polynomials are closely related to those based
on Newton’s divided differences.
The basic assumption here is that
The function values
k k
f x f = : ) ( are given at a number of equally spaced and
distinct points having a constant interval length
k k
x x h − =
+1
between consecutive
collocation points.
A systematic introduction of the method of approach involves the introduction of some
difference operators. There are four basic difference operators: The Shift, Forward,
Backward and Central difference operators. These are defned as follows.
The Shift Operator E
The shift operator E is defned through the relation
) ( ) ( h x f x Ef + = in the case of a continuous variable x , and through the relation
1 +
=
k k
f Ef
in the case of a discrete variable
k
x .
Powers of the operator (positive or negative) are defned in a similar manner:
p k k
p p
f f E ph x f x f E
+
= + = ); ( ) (
The Forward Difference Operator Δ
The forward difference operator Δ is defined through the relation
) ( ) ( ) ( x f h x f x f − + = Δ in the case of a continuous variable x , and through the
relation
k k k
f f f − = Δ
+1
in the case of a discrete variable
k
x . (1)
Powers of the forward difference operator Δ can also be defned
r r k
p
k
p
k
p
f f p f f f = Δ = Δ − Δ = Δ
+
+ 0
1
1
,...; 12 , 0
for any value of r .
/lrcan vrrua unversr, 49
The Backward Difference Operator ∇
The backward difference operator ∇ is defned through the relation
) ( ) ( ) ( h x f x f x f − − = ∇ in the case of a continuous variable x , and through the
relation
1 −
− = ∇
k k k
f f f in the case of a discrete variable
k
x . (2)
Powers of the backward difference operator can also be defned
r r k
p
k
p
k
p
f f p f f f = ∇ = ∇ − ∇ = ∇
−
+ 0
1
1
,...; 12 , 0 for any value of r .
The Central Difference Operator δ
The central difference operator δ is defned through the relation
)
2
1
( )
2
1
( ) ( h x f h x f x f − − + = δ in the case of a continuous variable x , and
through the relation
∇f
k
= f
k
− f
k −1
in the case of a discrete variable
k
x . (3)
Powers of the central difference operator can also be defned
δ f
k +
1
2
−δ f
k −
1
2
for any value of r . (4)
Relationship between Difference Operators
The defnition of powers of the Shift Operator E enables us to relate the other three
difference operators with one another.
We frst note that:
2
1
2
1
+
=
k
k
f f E ; ;
2
1
2
1
−
−
=
k
k
f f E
1
1
−
−
=
k k
f f E
Using these three results, all of which are based on the valid defnition of the shift
operator we now establish the following relationships:
Because
k k k k k k
f E f Ef f f f ) 1 (
1
− = − = − = Δ
+
we conclude that
/lrcan vrrua unversr, 50
1 1 + Δ ≡ − ≡ Δ E or E
(5)
Again, because
k k k k k k
f E f E f f f f ) 1 (
1 1
1
− −
−
− = − = − = ∇ we conclude that
∇ −
≡ − ≡ ∇
−
1
1
1
1
E or E
(6)
Similarly, because
k k k
k k
k
f E E f E f E f f f ) (
2
1
2
1
2
1
2
1
2
1
2
1
−
−
− +
− = − = − = δ
we
conclude that
2
1
2
1
−
− ≡ E E δ
(7)
In the case of the central difference operator δ it is not possible to express the shift
operator E in terms of the central difference operator δ
alone. However, we shall
do so by involving the other fnite difference operators. Specifcally we can relate the
forward and backward difference operators with one another by involving the shift
and central difference operators.
(i) Multiplying both sides of equation (7) with
2
1
E and taking note of the result in
equation (5) we get
Δ ≡ − = − =
−
1 ) (
2
1
2
1
2
1
2
1
E E E E E δ , therefore
Δ ≡ ⇒ ≡ Δ
−
2
1
2
1
, E E δ δ (8)
(ii) Multiplying both sides of equation (7) with
2
1
�
E and taking note of the result
in equation (6) we get
∇ ≡ − = − =
−
−
− − 1
2
1
2
1
2
1
2
1
1 ) ( E E E E E δ , therefore
∇ ≡ ⇒ ≡ ∇
−
2
1
2
1
, E E δ δ (9)
/lrcan vrrua unversr, 5'
Having established all these interrelationships between the operators δ , , , ∇ Δ E one
can now defne any powers of the δ , , ∇ Δ
operators.
A last useful operator, the Mean (or averaging) Operator μ is often used in
connection with some interpolation formulas that are based on the central difference
operator . δ
The mean operator is defned through the relationship
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛
+ =
− +
2
1
2
1
2
1
k k
k
f f f μ
(10)
2.8 Finite Difference Interpolation Polynomials
Armed with the fve difference operators ( E , Δ, ∇, δ, μ ) we are now ready
to list (not derive) a number of interpolation polynomials based on their use. Exactly
how they are used will be discussed after introduction of the concept of a table of dif
ferences. Instead of operating with the variable x , such polynomials are usually written
in terms of a digital variable s obtained from the transformation of variables
( )
0
1
x x
h
s − =
(1) Newton’s Forward Difference Interpolation Polynomial
0
0
0
3
0
2
0 0
... ) 2 )( 1 (
6
1
) 1 (
2
1
) (
f
k
s
f s s s f s s f s f s P
k
n
k
n
Δ
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛
=
+ Δ − − + Δ − + Δ + =
∑
=
(2) Newton’s Backward Difference Interpolation Polynomial
n
k
n
k
n n n n n
f
k
k s
f s s s f s s f s f s P
∇
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛ +
=
+ ∇ + + + ∇ + + ∇ + =
∑
=0
3 2
... ) 2 )( 1 (
6
1
) 1 (
2
1
) (
/lrcan vrrua unversr, 52
(3) Stirling’s Central Difference Interpolation Polynomial
P
n
(s) = f
0
+ sμδ f
0
+
1
2
s
2
δ
2
f
0
+
1
6
s(s
2
−1)μδ
3
f
0
+
1
24
s
2
(s
2
−1)δ
4
f
0
+ ..
(4) Bessel’s Central Difference Interpolation Polynomial
... ) 2 ( ) 1 (
24
1
)
2
1
)( 1 (
6
1
) 1 (
2
1
)
2
1
( ) (
2
1
4 2
2
1
3
2
1
2
2
1
2
1
+ − −
+ − − + − + − + =
f s s s
f s s s f s s f s f s P
n
μδ
δ μδ δ μ
(5) Everett’s Central Difference Interpolation Polynomials
....
5
2
3
1
....
5
2
3
1
) (
0
4
0
2
0
1
4
1
2
1
+
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛ +
+
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛ +
+ +
+
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛ +
+
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛ +
+ =
f
t
f
t
tf
f
s
f
s
sf s P
n
δ δ
δ δ
where s t − = 1
2.9 Tables of Differences
All fve fnite difference interpolation polynomials given above contain forward or
backward or central differences of powers exceeding one. It is therefore important to
know how these quantities can be got. The answer is not diffcult. These quantities
are obtained from tables of differences constructed using the given values of the
function ) (x f at the equidistant collocation points
k
x .
/lrcan vrrua unversr, 5J
The tables of values are obtained in a process similar to that taken in constructing the
Newton’s divided differences. The only difference here is that only differences of
function values are involved. Such differences are not divided by any quantity.
The following are typical examples of tables of differences.
Table 6: Forward Difference Table
FORWARD DIFFERENCES
x
) (x f
First Second Third Fourth Fifth
0
x
0
f
∆f
0
1
x
1
f
∆
2
f
0
∆f
1
∆
3
f
0
2
x
2
f
∆
2
f
1
∆
4
f
0
∆f
2
∆
3
f
1
∆
5
f
0
3
x
3
f
∆
2
f
2
∆
4
f
1
∆f
3
∆
3
f
2
4
x
4
f
∆
2
f
3
∆f
4
5
x
5
f
Observation
Note the forward slopping nature of the entries based at any point
k
x in the table
of forward differences. The Newton Forward Interpolation polynomial uses value
along such a path
/lrcan vrrua unversr, 54
Table 7: Backward Difference Table
BACKWARD DIFFERENCES
x
) (x f
First Second Third Fourth Fifth
0
x
0
f
∇f
1
1
x
1
f
∇
2
f
2
∇f
2
∇
3
f
3
2
x
2
f
∇
2
f
3
∇
4
f
4
∇f
3
∇
2
f
4
∇
5
f
5
3
x
3
f
∇
2
f
4
∇
5
f
4
∇f
4
∇
3
f
5
4
x
4
f
∇
2
f
5
∇f
5
5
x
5
f
Observation
Note also the backward slopping nature of the entries based at any point
k
x in the
table of backward differences. The Newton Backward Difference Interpolation Po
lynomial uses values along such a path.
/lrcan vrrua unversr, 55
Table 8: Central Difference Table
CENTRAL DIFFERENCES
x
) (x f
First Second Third Fourth Fifth
x
3
f
3
δf
2 ½
f
2
f
2
δ
2
f
2
δf
1 ½
δ
3
f
1 ½
f
1
f
1
δ
2
f
1
δ
4
f
1
δf
 ½
δ
3
f
 ½
δf
5
 ½
0
x
0
f
δ
2
f
0
δ
4
f
0
δf
½
δ
3
f
½
δ
5
f
½
1
x
1
f
δ
2
f
1
δ
4
f
1
δf
1 ½
δ
3
f
1 ½
2
x
2
f
δ
2
f
2
δf
2 ½
3
x
3
f
Observation
Note further the horizontal slopping nature of the entries based at any point
k
x in
the table of central differences. Stirling’s, Bessel’s and Everret’s formulas use table
entries on and in the neighborhood of such a path.
/lrcan vrrua unversr, 56
DO THIS (2.4)
(i) In reference to Table 9 (Page 57) and taking 0 . 0
0
= x give the values of the
following fnite differences:
2 5
4
2
2
2
1
1
1
2
3
, , , , , f f f f f f μδ δ ∇ Δ ∇ Δ
(ii) Using appropriate equivalences express
8
6
f δ in terms of forward and backward
differences.
2.10 Application Of Difference Tables In Interpolation
We are now ready to illustrate both how to construct a table of differences and also
how to use it for interpolation purposes.
Worked Example 4
(i) Construct a table of differences for the function tabulated bellow.
x 0 0.2 0.4 0.6 0.8 1.0
f(x) 1.0000 0.9801 0.9211 0.8253 0.6967 0.5403
(ii) Use the resulting table to interpolate ) (x f
• At 1 . 0 = x using Newton’s forward difference formula
• At 9 . 0 = x using Newton’s backward difference formula and
• At 5 . 0 = x using Stirling’s central difference formula.
/lrcan vrrua unversr, 57
Solution
(i)
Table 9: Table of differences
Differences
x f(x) First Second Third Fourth
Fifth
0.0 1.0000
0.0199
0.2 0.9801 0.0391
0.0590 0.0023
0.4 0.9211 0.0368 0.0017
0.0958 0.0040
0.0007
0.6 0.8253 0.0328 0.0010
0.1286 0.0050
0.8 0.6967 0.0278
0.1564
1.0 0.5403
(ii) Interpolation
Application of Newton’s forward difference formula
We take 0 . 0
0
= x . Since the interval length being used is 2 . 0 = h the value of the
parameter s is calculated and found to be 5 . 0
2 . 0
0 . 0 1 . 0
=
−
= s
Newton’s forward difference formula is given by
.. ) 3 )( 2 )( 1 (
24
1
) 2 )( 1 (
6
1
) 1 (
2
1
) (
0
4
0
3
0
2
0 0
+ Δ − − − + Δ − − + Δ − + Δ + = f s s s s f s s s f s s f s f x f
The table entries needed for this calculation are highlighted in the above table of
differences based on 0 . 0
0
= x Substitution of these values and the calculated value
of s gives the following result
9950 . 0 5 0000664062 . 0 00014375 . 0 0048875 . 0 00995 . 0 0000 . 1 ) 1 . 0 ( = − + + − ≈ f
Application of Newton’s backward difference formula
We take 0 . 1 =
n
x . Again since the interval length is 2 . 0 = h the value of the para
meter s is calculated and found to be
5 . 0
2 . 0
0 . 1 9 . 0
− =
−
= s
/lrcan vrrua unversr, 58
Newton’s backward difference formula is given by
.. ) 3 )( 2 )( 1 (
24
1
) 2 )( 1 (
6
1
) 1 (
2
1
) (
0
4
0
3
0
2
0 0
+ ∇ + + + + ∇ + + + ∇ + + ∇ + = f s s s s f s s s f s s f s f x f
The table entries needed for this calculation are highlighted in the above table of
differences based at 0 . 1 =
n
x . Direct substitution of these values and the calculated
value of s gives
6216 . 0 0000390625 . 0 0003125 . 0 003475 . 0 0782 . 0 5403 . 0 ) 9 . 0 ( = − − + + ≈ f
rounded correct to four signifcant fgures.
Application of Stirling’s central difference formula
We take 4 . 0
0
= x . Since the interval is 2 . 0 = h the value of the parameter s is
calculated and found to be 5 . 0
2 . 0
4 . 0 5 . 0
=
−
= s
Stirling’s central difference formula is given b
.. ) 1 (
24
1
) 1 (
6
1
2
1
) (
0
4 2 2
0
3 2
0
2 2
0 0
+ ∇ − + − + + + = f s s f s s f s f s f x f μδ δ μδ
The table entries needed for this calculation are not highlighted in the above table
but are relatively easy to pick up. For the inexperienced learner the teething problem
may lie in fnding the averaged values. To maximize transparency in the calculations
we point out the following:
⎥
⎦
⎤
⎢
⎣
⎡
+ =
⎥
⎦
⎤
⎢
⎣
⎡
+ =
− −
2
1
3
2
1
3
0
3
2
1
2
1 0
2
1
;
2
1
f f f f f f δ δ μδ δ δ μδ
With this clarifcation we now perform the calculations and fnd
8776 . 0 5 0000132812 . 0 000196875 . 0 0046 . 0 0387 . 0 9211 . 0 ) 5 . 0 ( = − − − − = f
/lrcan vrrua unversr, 59
DO THIS (2.5)
Using the entries in Table 9 apply Everret’s central difference formula based on
4 . 0
0
= x to interpolate the function ) (x f at 45 . 0 = x .
References for the Learning Activity
A.C. Bajpai, I.M. Calus and J.A. Fairley, Numerical Methods for Engineers and
Scientists, Taylor & Francis Ltd., London 1975.
R.L. Burden and D. Faires, Numerical Analysis, PWSKent Publishing Co. Boston,
Fifth Edition 1989.
Solutions To Formative Evaluation Questions
DO THIS (2.1)
The load 1.35 kg lies between the loads 1 kg and 2 kg. We therefore take and subs
titute into the two linear interpolation formulas:
(i) 24 . 2030 ) 35 . 0 )( 4 . 2 ( 4 . 2029 ) ( ) (
0
0 1
0 1
0 1
= + = −
⎥
⎦
⎤
⎢
⎣
⎡
−
−
+ = x x
x x
f f
f x P
(ii)
24 . 2030 ) 8 . 2031 )( 35 . 0 ( ) 4 . 2029 )( 65 . 0 ( ) (
1
0 1
0
0
1 0
1
1
= + =
⎥
⎦
⎤
⎢
⎣
⎡
−
−
+
⎥
⎦
⎤
⎢
⎣
⎡
−
−
= f
x x
x x
f
x x
x x
x P
/lrcan vrrua unversr, 60
DO THIS (2.2)
) ( 35 . 0 ) ( 01 . 0 ) ( 58 . 0 ) ( 54 . 1 ) (
3 2 1 0 3
x L x L x L x L x P + + + =
At 6 . 2 = x the values of the Lagrangean coeffcients are found to be
064 . 0 ) 3 6 . 2 )( 2 6 . 2 )( 1 6 . 2 (
6
1
) 6 . 2 (
672 . 0 ) 4 6 . 2 )( 2 6 . 2 )( 1 6 . 2 (
2
1
) 6 . 2 (
448 . 0 ) 4 6 . 2 )( 3 6 . 2 )( 1 6 . 2 (
2
1
) 6 . 2 (
056 . 0 ) 4 6 . 2 )( 3 6 . 2 )( 2 6 . 2 (
6
1
) 6 . 2 (
− = − − − =
= − − − − =
= − − − =
− = − − − − =
L
L
L
L
Substitution into the expression for ) 6 . 2 (
3
P gives the result 15792 . 0 ) 6 . 2 (
3
= P .
DO THIS (2.3)
(i) 2 ] , , [
4 3 2
− = x x x f
This result is obtained from the definition of divided differences as follows:
2 ) 12 8 (
2
1
) ( ) ( ) ( ) ( 1 ] , [ ] , [
] , , [
2 3
2 3
3 4
3 4
2 4 2 4
3 2 4 3
4 3 2
− = − =
⎭
⎬
⎫
⎩
⎨
⎧
−
−
−
−
−
−
=
−
−
=
x x
x f x f
x x
x f x f
x x x x
x x f x x f
x x x f
(i) Interpolation of ) (x f at 3 . 0 − = x using Newton’s 4
th
degree divided differences
interpolation polynomial.
Here 0 . 1
0
− = x
/lrcan vrrua unversr, 6'
6279 . 0 ] , , , , [ ) )( )( )( (
092 . 1 ] , , , [ ) )( )( (
42 . 0 ] , , [ ) )( (
6 . 5 ] , [ ) (
13 ) (
] , , , , [ ) )( )( )( (
] , , , [ ) )( )( (
] , , [ ) )( (
] , [ ) (
) ( ) (
4 3 2 1 0 3 2 1 0
3 2 1 0 2 1 0
2 1 0 1 0
1 0 0
0
4 3 2 1 0 3 2 1 0
3 2 1 0 2 1 0
2 1 0 1 0
1 0 0
0 4
− = − − − −
= − − −
= − −
= −
− =
− − − −
+ − − −
+ − −
+ −
+ =
x x x x x f x x x x x x x x
x x x x f x x x x x x
x x x f x x x x
x x f x x
x f
x x x x x f x x x x x x x x
x x x x f x x x x x x
x x x f x x x x
x x f x x
x f x P
We then get the answer
5159 . 6 6279 . 0 092 . 1 42 . 0 6 . 5 0 . 13 ) 3 . 0 (
4
− = − + + + − = − P
On the other hand, the function 5 4 3 2 ) (
2 3 4
− + − + = x x x x x f is found to have
the same value (6.5159) at 3 . 0 − = x .
DO THIS (2.4)
(i) One fnds
0774 . 0
2
1
, 0007 . 0
, 0391 . 0 , 0590 . 0 , : , 1286 . 0
2
1
1
2
1
2
2 5
4
2
2
2
1
1
1
2
3
− =
⎥
⎦
⎤
⎢
⎣
⎡
+ = − = ∇
− = Δ − = − ∇ − = Δ
f f f f
f f existent Non f f
δ δ μδ
δ
/lrcan vrrua unversr, 62
(ii) This is solved using the equivalence relations
∇ ≡ Δ ≡
−
2
1
2
1
, E E δ δ . One
fnds:
11
6
3 8
6
8
6 3
8
6
2
1
5
6
3 8
6
8
6 3
8
6
2
1
8
6
f f f E f E
f f f E f E f
∇ = ∇ = ∇ =
⎥
⎦
⎤
⎢
⎣
⎡
∇ =
Δ = Δ = Δ =
⎥
⎦
⎤
⎢
⎣
⎡
Δ =
+
−
−
−
δ
DO THIS (2.5)
Using the entries in Table 9 apply Everret’s central difference formula based on
4 . 0
0
= x to interpolate the function ) ( x f at 45 . 0 = x .
We are given the quantities 45 . 0 , 2 . 0 ; 4 . 0
0
= = = x h x and therefore the two pa
rameters required in the application of the Everret method are
75 . 0 1 , 25 . 0
2 . 0
4 . 0 45 . 0
0
= − = =
−
=
−
= s t
h
x x
s
9004 . 0 ... ) 0368 . 0 )( 25 . 0 )( 75 . 0 )( 75 . 1 (
6
1
) 0328 . 0 )( 75 . 0 )( 25 . 0 )( 25 . 1 (
6
1
) 9211 . 0 )( 75 . 0 ( ) 8253 . 0 )( 25 . 0 ( ) 45 . 0 (
= + − −
+ − − + + = f
African Virtual University 63
Learning Activity # 3
Numerical Integration
Summary
In this learning activity we focus on numerical integration methods. A major portion
of the presentation is devoted to the NewtonCotes category of formulae. However,
we also dwell on the more accurate family of numerical integration methods clas
sifed as Gaussian integration methods. Specifc attention is given to the two best
known Newton Cotes methods: Trapezoidal rule, Simpson’s rule and the application
of Richardson’s extrapolation technique on both methods in deriving the Romberg
integration method. As for Gaussian integration methods we limit our discussion
to the Gaussian method based on Legendre polynomials. The Learning Activity is
presented under the following headings:
• The need for numerical integration
• Classifcation of methods
• NewtonCotes formulae
• The Trapezoidal Rule
• Simpson’s rule
• Error terms in the Trapezoidal and Simpson’s rules
• Romberg integration
• Gaussian integration methods
At the end of this learning activity the learner will be able to:
1. Classify numerical integration methods
2. Derive and apply the Trapezoidal rule and Simpson’s rules.
3. Derive and apply Romberg’s integration method based on either the Tra
pezoidal or Simpson’s rule
4. Apply the Gaussian integration method based on Legendre polynomials.
List of relevant readings
Fundamental Numerical Methods and Data Analysis, George W. Collins, chapter 4.
Wikipedia: Numerical Methods/Numerical Integration
African Virtual University 64
List of relevant useful links
Wolfram MathWorld (visited 03.04.07)
http://mathworld.wolfram.com
Students should search for the entry covering the unit title. Also, search for
any key words in the text. Mathworld gives a detailed reference in all cases.
Wikipedia (visited 03.04.07)
http://en.wikipedia.org/wiki
As with mathworld, students should search for the entry covering the unit title.
Also, search for any key words in the text. Wikipedia generally gives shorter
and less complete entries. However, they can be easier to read.
MacTutor History of Mathematics (visited 03.03.07)
http://wwwhistory.mcs.standrews.ac.uk/Indexes
The MacTutor Archive is the most comprehensive history of mathematics on
the internet. Students should search for their unit title and read the history of
the subject. This gives a helpful overview of the importance and context of
the topic being studied.
Key Words
• Antiderivative of f (x)
A function F (x) is called an antiderivative of another function f (x) if
dF
dx
= f (x).
• Order of an integration method
A numerical integration method is said to be of order p if it gives exact values of the
integral for all polynomial functions f (x) of degree m≤ p.
African Virtual University 65
Learning Activity: Numerical Integration
Introduction
In this Learning Activity we give the features that distinguish the family of New
tonCotes methods from the Gaussian integration methods. We use a geometrical
approach to derive the Trapezoidal (Trapezium) rule and Simpson’s rule. Because at
this juncture the Learner has not been exposed to the concept of orthogonal polyno
mials, we have presented without deriving, the Gaussian integration method based
on the Legendre orthogonal polynomials. Illustrative examples are given and solved
to assist the learner experience the applications of the methods presented.
3.1 Need for Numerical Integration Methods
In the frst learning activity (Section 1.6 (b)) we gave two examples to demonstrate
why we need to learn and be able to apply numerical methods in solving some ma
thematical problems. Part (ii) of the frst Example 1 and the whole of the second
example were purposely chosen to illustrate the need to learn numerical methods for
evaluating some defnite integrals.
3.2 Classification of Numerical Integration Methods.
Numerical methods for approximating the defnite integral f (x)dx
a
b
∫
have the ge
neral form
f (x)dx ≅ W
k
k = 0
n
∑
a
b
∫
f (x
k
) .
The coeffcients W
k
are called weighting coeffcients and x
k
are the abscissas or nodes
taken from the range [a, b] of integration at which the integrand is to be evaluated.
3.3 Order of an integration method
A numerical integration method is said to be of order p if it gives exact values of the
integral for all polynomial functions f (x) of degree m≤ p.
African Virtual University 66
The general numerical integration formula given above has n+1 nodes x
k
and
n+1 corresponding weights, giving a total of 2n+ 2 unknown parameters. Since
a polynomial of degree m is completely determined by giving its values at m+1
distinct points, it follows that the order of the general numerical integration formula
given above is at most 2n+1.
3.4 NewtonCotes Numerical Integration Methods
The NewtonCotes integration methods are derived from the general formula by:
(i) Requiring the n+1 nodes x
k
to be uniformly distributed over the range of in
tegration [a, b] such that x
k
= x
0
+ kh, k = 0,1, 2,...n, where x
0
= a , x
n
= b
and
h =
b − a
n
.
(ii) Determining the n+1 weights W
k
such that the formula gives exact values of
the integral for all polynomial functions f (x) of degree at most n.
The Trapezoidal rule and Simpson’s rule fall in this category of methods.
(a) The Trapezoidal Rule
DO THIS (3.1)
(i) What kind of a geometrical fgure is a trapezium?
(ii) What sides of a trapezium determine its area?
(iii) How is the area of a trapezium determined?
The Trapezoidal rule (sometimes referred to simply as the Trapezium rule) is the sim
plest practical numerical integration method. It is based on the principle of fnding
the area of a trapezium. The principle behind the method is to replace the curve
y = f (x) by a straight line (linear approximation) as shown in the fgure 3.1.
African Virtual University 67
Typically, we approximate the area A under the curve ) ( x f y = between the or
dinates at
0
x and
1
x by ( )
1 0
2
f f
h
A + ≅ , where ) (
0 0
x f f = , ) (
1 1
x f f = and
h
is the distance between
0
x and
1
x .
Figure 3.1: Trapezoidal Rule
For the integral
∫
b
a
dx x f ) ( the trapezoidal rule can also be applied by subdividing
the interval ] , [ b a into n subintervals ] , [
1 k k
x x
−
, n k ,... 3 , 2 , 1 = , of equal length
1 −
− =
k k
x x h , with
0
x a = and
n
x b = , followed by applying the trapezoidal rule
over each subinterval. The area A under the curve ) ( x f y = between the ordinates
at
0
x a = and
n
x b = can then be approximated by the generalized
Trapezoidal rule
∫
≅ =
b
a
dx x f A ) (
( ) ( ) ( ) ( )
n n
f f
h
f f
h
f f
h
f f
h
+ + + + + + + +
−1 3 2 2 1 1 0
2
...
2 2 2
≅
( ) [ ]
n n
f f f f f f
h
+ + + + + +
−1 3 2 1 0
... 2
2
≅
( )
⎥
⎦
⎤
⎢
⎣
⎡
+ +
∑
−
=
1
1
0
2
2
n
k
i n
f f f
h
f (x
0
)
f (x
1
)
African Virtual University 68
Observation
In this generalized Trapezoidal Rule, the nodes are chosen to be the equidistant points
n k h k x x
k
,..., 3 , 2 , 1 , ) 1 (
0
= − + =
while the weighting coeffcients
k
W have
been determined such that the formula gives exact value of the integral for all linear
functions of the form b ax x f y + = = ) ( . These turn out to be:
h W W W W
h
W W
n n
= = = = = = =
−1 3 2 1 0
... ;
2
Example 3.1
Approximate
∫
2
1
x
dx
by the Trapezoidal Rule with 10 = n ( 1 . 0 = h ).
Solution
In this example:
x
x f
1
) ( = and 1 . 0 = h
We evaluate the function at the points, x
i
= 1+ (i −1)0.1, i = 1, 2, 3,...10 and
obtain the pairs of values:
Table 3.1: Value of the function
x
x f
1
) ( =
x
) (x f
x
) (x f
0 . 1 0 . 1 6 . 1 625 . 0
1 . 1
0.9091
7 . 1 5882 . 0
2 . 1
8333 . 0 8 . 1 5556 . 0
3 . 1
7692 . 0 9 . 1 5263 . 0
4 . 1
7143 . 0
0 . 2
0.5
5 . 1
6667 . 0
Direct application of the generalized trapezoidal rule gives the approximate value
[ ] 69377 . 0 5 . 0 ) 1877 . 6 ( 2 0 . 1
2
1 . 0
2
1
= + + ≅
∫
x
dx
African Virtual University 69
(b) Simpson’s Rule
To obtain Simpson’s rule we subdivide the interval ] , [ b a into only two equal
subintervals using the points
2 1 0
, , x x x , where x
2
− x
1
= x
1
− x
0
= h, and replace the
curve of the general function ) (x f y = over the interval ] , [
2 0
x x by the quadratic
Lagrangean interpolation polynomial
2
1 2 0 2
1 0
1
2 1 0 1
2 0
0
2 0 1 0
2 1
) )( (
) )( (
) )( (
) )( (
) )( (
) )( (
f
x x x x
x x x x
f
x x x x
x x x x
f
x x x x
x x x x
y
− −
− −
+
− −
− −
+
− −
− −
=
⎥
⎦
⎤
⎢
⎣
⎡
− − + − − − − − =
2 1 0 1 2 0 0 2 1
2
) )( (
2
1
) )( ( ) )( (
2
1 1
f x x x x f x x x x f x x x x
h
The general definite integral f (x)dx
x
0
x
2
∫
is then approximated by the integral
ydx
x
0
x
2
∫
. Without loss of generality, one takes x
0
= 0 and gets the formula
ydx = ydx =
h
3
0
2 h
∫
x
0
x
2
∫
f
0
+ 4 f
1
+ f
2
[ ]
Because the formula uses values at three points (two equal subintervals), a generalized
Simpson’s Rule is only possible when the number nof subintervals is even:
[x
0
, x
2
], [x
2
, x
4
], [x
4
, x
6
], ..., [x
n− 2
, x
n
].
One applies the formula over each subinterval and adds the results to get the gene
ralized Simpson’s Rule formula
f (x)dx =
h
3
a
b
∫
f
0
+ 4 f
1
+ f
2
[ ]
+ f
2
+ 4 f
3
+ f
4
[ ]
+ ... + f
n− 2
+ 4 f
n−1
+ f
n
[ ]
=
h
3
f
0
+ 4( f
1
+ f
3
+ ... + f
n−1
) + 2( f
2
+ f
4
+ ... + f
n− 2
) + f
n
[ ]
=
h
3
( f
0
+ f
n
) + 4 f
2 k −1
k =1
n/ 2
∑
+ 2 f
2 k
k =1
( n− 2 ) / 2
∑
⎡
⎣
⎢
⎤
⎦
⎥
African Virtual University 70
Example 3.1
Approximate
dx
x
1
2
∫
using Simpson’s rule with n = 10 ( h = 0.1).
Solution
This is the same problem solved above using the Trapezoidal Rule. We certainly can
apply Simpson’s Rule because the number of subintervals is even (n = 10). Using
the values given in the Table 3.1 one obtains
dx
x
1
2
∫
≅
0.1
3
1.0 + 4(3.4595) + 2(2.7282) + 0.5 [ ] = 0.693147 .
DO THIS (3.2)
(i) What is the exact value of the integral
dx
x
1
2
∫
?
(ii) Which of the two approximations of the integral obtained using the Trapezoidal
rule and using Simpson’s rule is more accurate?
(iii) How is the accuracy of the approximations of either the Trapezoidal Rule or
Simpson’s Rule affected by taking a smaller interval h (increasing the number of
subintervals / refning the partitioning of the range of integration)?
3.5 Error Terms in the Trapezoidal Rule and in Simpson’s Rule
With an exact value of 0.69314718 which is the value of ln2 , your answers to the
other two questions are expected to have been that Simpson’s Rule is more accurate
than the Trapezoidal Rule, and that the accuracy of both methods increases with
decreasing interval length h. These results are made more vivid by the error terms
of the respective methods.
African Virtual University 71
(i) Error Term in the Trapezoidal Rule
For reasonably behaved functions f (x) it can be shown (Fox and Mayers, 1958) that
the exact (true) value I of the integral f (x)dx
a
b
∫
is related to the value T (h) obtained
by the Trapezoidal Rule with an interval of length h through the expression
I − T (h) = A
T
h
2
+ B
T
h
4
+ C
T
h
6
+ ...
where A
T
, B
T
, C
T
,... are constants whose values are independent of the
interval length h.
(ii) Error Term in Simpson’s Rule
Similarly, the error in Simpson’s approximation S(h) of the integral I is given by
I − S(h) = A
S
h
4
+ B
S
h
6
+ C
S
h
8
+ ...
where A
S
, B
S
, C
S
,... are again constants whose values do not depend on the
interval length h.
The leading error term in the Trapezoidal Rule is A
T
h
2
while that of the Simpson
Rule is A
S
h
4
. This explains why Simpson’s Rule is appreciably more accurate than
the Trapezoidal Rule for the same interval length h.
3.6 Romberg Integration
Strictly speaking, Romberg integration is not a Newton Cotes method. Romberg
integration is a postprocessing technique. It is a method which uses previously
computed values to produce more accurate results.
The method takes advantage of the knowledge of the error terms in either the Tra
pezoidal Rule or the Simpson’s Rule to produce a much more accurate approximation
of the integral using previously calculated approximate values.
African Virtual University 72
(a) Romberg Integration Using the Trapezoidal Rule
Let h
1
and h
2
be two different intervals used with the Trapezoidal Rule. From the
above form of the error term for the method we can write
I − T (h
1
) = A
T
h
1
2
+ B
T
h
1
4
+ C
T
h
1
6
+ ...
I − T (h
2
) = A
T
h
2
2
+ B
T
h
2
4
+ C
T
h
2
6
+ ...
Eliminating the constant A
T
from these two formulae and solving for I we get
I = T (h
2
) +
h
2
2
h
1
2
− h
2
2
T (h
2
) − T (h
1
) { } − B
T
h
1
4
h
2
4
+ ...
Specifcally, if we choose h
2
=
1
2
h
1
(halving the interval) we get
I = T (
1
2
h
1
) +
1
3
T (
1
2
h
1
) − T (h
1
)
⎧
⎨
⎩
⎫
⎬
⎭
−
1
4
B
T
h
1
4
+ ...
The quantity
T (h
1
,
1
2
h
1
) = T (
1
2
h
1
) +
1
3
T (
1
2
h
1
) − T (h
1
)
⎧
⎨
⎩
⎫
⎬
⎭
is an approximation of the integral I with a much smaller error than either of the
two approximations T (h
1
) andT (h
2
) . Its value is called the Romberg value of the
integral with respect to the Trapezoidal Rule.
(b) Romberg Integration Using Simpson’s Rule
Derivation of a Romberg integration formula based on Simpson’s Rule follows the
path as that used in connection with the Trapezoidal Rule.
Let h
1
and h
2
be two different intervals used with Simpson’s Rule. From the above
form of the error term for the method we can write
African Virtual University 73
I − S(h
1
) = A
S
h
1
2
+ B
S
h
1
4
+ C
S
h
1
6
+ ...
I − S(h
2
) = A
S
h
2
2
+ B
S
h
2
4
+ C
S
h
2
6
+ ...
Eliminating the constant A
S
from these two formulae and solving for I we get
I = S(h
2
) +
h
2
4
h
1
4
− h
2
4
S(h
2
) − S(h
1
) { } −
h
1
4
h
2
4
(h
2
2
− h
1
2
)
h
1
4
− h
2
4
B
S
+ ...
I = S(h
2
) +
h
2
4
h
1
4
− h
2
4
S(h
2
) − S(h
1
) { } −
h
1
4
h
2
4
(h
2
2
− h
1
2
)
h
1
4
− h
2
4
B
S
+ ...
Specifcally, if we choose h
2
=
1
2
h
1
(halving the interval) we get
I = S(
1
2
h
1
) +
1
15
S(
1
2
h
1
) − S(h
1
)
⎧
⎨
⎩
⎫
⎬
⎭
−
h
6
20
B
S
+ ...
The quantity S(h
1
,
1
2
h
1
) = S(
1
2
h
1
) +
1
15
S(
1
2
h
1
) − S(h
1
)
⎧
⎨
⎩
⎫
⎬
⎭
is an approximation of the integral I with a much smaller error than either of the
two approximations S(h
1
) and S(h
2
) . Its value is called the Romberg value of the
integral with respect to Simpson’s Rule.
African Virtual University 74
Example 3.3
Approximate
∫
2
1
x
dx
by Romberg integration based on the Trapezoidal Rule with
2 . 0
1
= h and 1 . 0
2
= h
Solution
All the values required for the calculations are given in Table 3.1 One fnds
[ ] 69564 . 0 5 . 0 ) 7282 . 2 ( 2 0 . 1
2
2 . 0
) 2 . 0 ( = + + = T
[ ] 69377 . 0 5 . 0 ) 1877 . 6 ( 2 0 . 1
2
1 . 0
) 1 . 0 ( = + + = T .
Therefore
{ } 693147 . 0 ) 2 . 0 ( ) 1 . 0 (
3
1
) 1 . 0 ( ) 1 . 0 , 2 . 0 ( = − + = T T T T
The Romberg value we have obtained by combining two fairly inaccurate values
using the Trapezoidal rule has the same high accuracy as the one obtained using
Simpson’s Rule with 1 . 0 = h
DO THIS (3.3)
(i) Is it possible to apply Simpson’s Rule on the integral
∫
2
1
x
dx
using the interval
2 . 0 = h ?
(ii) If your answer is YES, apply the method. If your answer is NO explain carefully
why not.
African Virtual University 75
Example 3.4
Construct a table of values of the function
x
x f
1
) ( = at the equidistant points
9 ,..., 3 , 2 , 1 ); 1 ( 125 . 0 1 = − + = k k x
k
. Then approximate the integral
∫
2
1
x
dx
by
applying Romberg integration based on Simpson’s Rule with interval lengths
25 . 0
1
= h and 125 . 0
2
= h .
Solution
Table 3.2: Value of the function
x
x f
1
) ( =
x
) (x f
x
) (x f
1.0
0 . 1
1.625 0.615385
1.125 0.888889 1.75 0.571429
1.25 0.8 1.875 0.533333
1.375 0.727273 2.0 0.5
1.5 0.666667
With these values one fnds:
[ ] 693254 . 0 5 . 0 ) 666667 . 0 ( 2 ) 371429 . 1 ( 4 0 . 1
3
25 . 0
) 25 . 0 ( = + + + = S
[ ] 693155 . 0 5 . 0 ) 038096 . 2 ( 2 ) 764880 . 2 ( 4 0 . 1
3
125 . 0
) 125 . 0 ( = + + + = S
Using these two Simpson approximations of the integral, Romberg integration leads
to the much more accurate value
. [ ] 6931484 . 0 ) 25 . 0 ( ) 125 . 0 (
15
1
) 125 . 0 ( ) 125 . 0 , 25 . 0 ( = − + = S S S S
African Virtual University 76
3.7 Gaussian Integration Methods
Gaussian integration methods are derived from the general integration formula
) ( ) (
0
k
b
a
n
k
k
x f W dx x f
∫
∑
=
≅
by assuming that all the 2 2 + n parameters in the
formula (the 1 + n nodes
k
x and their corresponding 1 + n weights
k
W ) are to be
determined so that the resulting integration formula gives exact values for all poly
nomial functions ) (x f of degree at most 1 2 + n .
For functions ) (x f defned over the range ] 1 , 1 [− Gauss developed a numerical
integration formula
∫
∑
−
=
=
1
1
1
) ( ) (
n
k
k k
x f W dx x f
where the nodes are the roots of some special polynomial (Legendre orthogonal po
lynomials) which are symmetrically positioned about the origin and all the weighting
coeffcients are positive.
The above mentioned restriction of the range of integration for the Gaussian integra
tion methods is not a serious one because we can transform any fnite interval ] , [ b a
to ] 1 , 1 [− using the transformation
2
1 +
=
−
− t
a b
a x
or ) 1 (
2
+
−
+ = t
a b
a x
and hence obtain the transformed integral on the right hand side of the equation
dt t
a b
a f
a b
dx x f
b
a
∫ ∫
−
⎟
⎠
⎞
⎜
⎝
⎛
+
−
+
−
=
1
1
) 1 (
2 2
) (
on which the Gaussian integration method can be applied.
African Virtual University 77
Extensive tables giving values of the Gaussian nodes and their corresponding weight
for different values of n have been constructed ready for use in solving any given
defnite integral over a fnite range.
We reproduce here a table of the weights and nodes for the Gaussian integration
method based on Legendre polynomials for . 5 , 4 , 3 , 2 , 1 = n
Nodes and Weights for GaussLegendre Integration Method
n
Nodes
k
t
Weights
k
W
1
±
0.577 350 1.000 000
2
±
0.000 000
0.774 597
0.888 889
0.555 556
3
±
±
0.339 981
0.861 136
0.652 145
0.347 855
4
±
±
0.000 000
0.538 469
0.906 180
0.568 889
0.478 629
0.236 927
5
±
±
±
0.238 619
0.661 209
0.932 470
0.467 914
0.360 762
0.171 324
Example 3.5
Approximate the integral
∫
+
=
4
2
2
1 x
dx
I by the Gaussian integration method using
the GaussLegendre nodes and weights for . 4 = n
Solution
With 2 = a and 4 = b the transformation of variables from ] 4 , 2 [ ∈ x to ] 1 , 1 [− ∈ t
gives: 3 + = t x and dt dx =
African Virtual University 78
∫ ∫ ∫
− −
=
+ +
=
+
1
1
1
1
2
4
2
2
) (
) 3 ( 1 1
dt t F
t
dt
x
dx
Direct calculations yield the following values:
568889 . 0
0
= W ; 1 . 0 ) 0 ( = F
0568889 . 0 ) 0 (
0
= F W
; 478629 . 0
1
= W 073960 . 0 ) 538469 . 0 ( = + F ; 141660 . 0 ) 538469 . 0 ( = − F
[ ] 1032020 . 0 ) 538469 . 0 ( ) 538469 . 0 (
1
= − + F F W
; 236927 . 0
2
= W 061507 . 0 ) 906180 . 0 ( = + F ; 185733 . 0 ) 906180 . 0 ( = − F
[ ] 0585778 . 0 ) 906180 . 0 ( ) 906180 . 0 (
2
= − + F F W
Adding the three products together gives the value
218667 . 0 = I
This is an astonishingly accurate result for, the true value of the integral is
218669 . 0 107149 . 1 325818 . 1 ) 2 ( tan ) 4 ( tan
1 1
= − = −
− −
DO THIS (3.4)
Approximate the integral dx x e
x
∫
−
−
2
1
) cos( by the Gaussian integration method
using the GaussLegendre nodes and weights for 4 n = .
African Virtual University 79
References for the Learning Activity
Fox, L. and Mayers, D.F., Computing Methods for Scientists and Engineers,  Oxford
University Press, London (1958).
Solutions To Formative Evaluation Questions
DO THIS (3.1)
(i) A trapezium is a quadrilateral which has a pair of parallel sides.
(ii) The sides of a trapezium that determine its area are the pair of parallel sides.
(iii) The area of a trapezium is given by: [ ]
2 1
2
L L
h
A Area + = , where
2 1
, L L
are the lengths of the parallel sides and h is the perpendicular distance between
them.
DO THIS (3.2)
(i) The exact value of the integral
∫
2
1
x
dx
is 693147 . 0 ) 2 ln( = .
(ii) The approximation obtained using Simpson’s rule is more accurate (has a smaller
error) than that obtained using the trapezoidal (trapezium) rule.
(iii) The accuracy of both the trapezoidal rule and Simpson’s rule become more
accurate as the interval length h gets smaller.
DO THIS (3.3)
(i) It is not possible to apply Simpson’s rule on the integral
∫
2
1
x
dx
using the interval
2 . 0 = h .
(ii) The reason why it is not possible is because with 2 . 0 = h the number of subin
tervals over the range ] 2 , 1 [ of integration would be odd (5) while Simpson’s rule
can only be applied when the number of subintervals is even.
African Virtual University 80
DO THIS (3.4)
The integral dx x e
x
) cos(
2
1
∫
−
−
is frst transfor
med into
∫
−
1
1
) ( dt t F
using the change of variables:
dt dx t t t F t x
2
3
, 1 ) 1 (
2
3
cos ) 1 (
2
3
1 exp ) ( ; 1 ) 1 (
2
3
= ⇒
⎟
⎠
⎞
⎜
⎝
⎛
− +
⎟
⎠
⎞
⎜
⎝
⎛
+ − = ⇒ − + =
One uses the following nodes and weighting coeffcients
861136 . 0 , 861136 . 0 , 347855 . 0
339981 . 0 , 339981 . 0 , 652145 . 0
2 2 2
1 1 1
− = − = =
− = − = =
t t W
t t W
One fnds
( ) ( ) [ ] 967614 . 1 ) ( ) ( ) ( ) (
2
3
) cos(
2 2 2 1 1 1
2
1
= − + + − + =
∫
−
−
W t F t F W t F t F dx x e
x
African Virtual University 81
Learning Activity # 4
Roots of Functions
Summary
This is the fourth and fnal learning activity for this module. In this learning activity
we shall discuss a frequently occurring problem in mathematics: the root fnding
problem for either a nonlinear equation
0 ) ( = x f
involving a single independent variable x or for a coupled system of two nonlinear
equations
0 ) , ( = y x f , 0 ) , ( = y x g
in two independent variables ) , ( y x .
At the end of this learning activity the learner is expected to be able to derive, apply
and prove that the bisection method always converges; derive and apply both the
Secant method and the Regula Falsi method; derive and apply the Newton Raphson
method and also derive and apply Newton’s method for a coupled system of nonlinear
equations. At the end of our presentation we discuss briefy the concept of fxed points
of a function and the theorems which guarantee their existence and uniqueness and
relate these results to the root fnding problem in a manner which allows the learner
to derive her/his own convergent iteration methods.
List of required readings
Wikipedia: Numerical Methods/Equation Solving
List of relevant useful links
Wolfram MathWorld (visited 03.04.07)
http://mathworld.wolfram.com
Students should search for the entry covering the unit title. Also, search for
any key words in the text. Mathworld gives a detailed reference in all cases.
Wikipedia (visited 03.04.07)
http://en.wikipedia.org/wiki
As with mathworld, students should search for the entry covering the unit title.
Also, search for any key words in the text. Wikipedia generally gives shorter
and less complete entries. However, they can be easier to read.
African Virtual University 82
MacTutor History of Mathematics (visited 03.03.07)
http://wwwhistory.mcs.standrews.ac.uk/Indexes
The MacTutor Archive is the most comprehensive history of mathematics on
the internet. Students should search for their unit title and read the history of
the subject. This gives a helpful overview of the importance and context of
the topic being studied.
Key Words, Theorems
[Full defnitions are given in the text]
Root or zero of a function: A value of x at which the function has a value of zero.
Fixedpoints of a function: A value of x for which the function has the same value
of x (e.g. f(2)=2)
Intermediate value theorem for continuous functions: A continuous function takes
all values lying between two values of the function.
African Virtual University 83
Learning Activity : Roots of Functions
4.1 Introduction
Five numerical methods for fnding roots of functions will be presented in this lear
ning activity. The frst four methods are for solving the nonlinear equation 0 ) ( = x f
The ffth method is for solving a coupled system of two nonlinear equations in two
variables 0 ) , ( , 0 ) , ( = = y x g y x f .
The bisection method will be derived. We prove that the method is always convergent.
This will be followed by the method of Regula Falsi, which has a signifcant simi
larity with the bisection method but converges slightly faster. The Secant method is
immediately presented after the Regula Falsi method because the two methods share
a common mathematical formula. However, the Secant method is computationally
more effcient. The NewtonRaphson method is presented last and is shown to be a
generalized form of the Secant and Regula Falsi methods.
4.2 Roots or Zeros of a Function
For a function of a single independent variable ) (x f y = , a point ρ = x is called
a root or a zero of ) (x f if the value of the function is zero at the point, meaning.
0 ) ( = ρ f
In Figure 4.1 the points
3 2 1
, , x x x x x x = = = are all roots of
the function ). (x f
x
1
x
2
x
3
0 ) (
0 ) (
0 ) (
3
2
1
=
=
=
x f
x f
x f
) (x f y =
y
x
Figure 4.1: Roots of a Function ) (x f
African Virtual University 84
4.3 Numerical Methods
(a) The Bisection Method
The bisection method for approximating roots of functions is a typical example of
an iteration method.
In its simplest form, an iteration method may be defned as a repetitive process of
applying a function ) (x g on one or several previous approximate values
1 − n
x … to
produce a new and hopefully more accurate approximation
n
x of the specifc quantity
being sought. In mathematical symbolism we write
,...) , , (
3 2 1 − − −
=
n n n n
x x x g x
The bisection method is based on the intermediate value theorem for continuous
functions. If ) (x f is continuous on an interval ] , [ b a and if the values ) (a f and
) (b f differ in sign, ( 0 ) ( ) ( < b f a f ), then the equation 0 ) ( = x f has at least one
real root
] , [ b a ∈ ρ .
Assuming that the points a and b were chosen to contain only one root we can
bisect the interval ] , [ b a into two halves at the point ) (
2
1
b a c + = and conclude
that the root lies either in the interval ) , ( c a or in the interval ) , ( b c provided that
0 ) ( ≠ c f , in which case c is the required root.
The Bisection method repeats the process of bisecting the interval which contains the
root ρ until we are satisfed that we are close enough to the root.
The above process can be summed up by the following algorithm (Kendal E. Atkin
son, 1989 pp 56).
African Virtual University 85
Algor ithm “ Bisect ( ε ρ, , , ), ( b a x f )”
Steps:
1. Set a x = :
1
and b x = :
2
2. Define [ ]
2 1 3
2
1
x x x + =
3. If ε ≤ −
3 2
x x , then accept
3
x = ρ and exit.
4. If 0 ) ( ) (
3 2
≤ x f x f then
3 1
: x x = ; otherwise
3 2
: x x = .
5. Go back to step 2.
Convergence of the Bisection Method
Convergence of any iteration method implies that the error in the approximation is
tending to zero as the number of iteration increases.
For the Bisection method, the absolute value of the error is bounded by the length of
the interval in which the root lies at that particular stage.
Error bound after 1
st
bisection [ ] a b x − ≤ = −
2
1
1 3
ε ρ .
Error after 2
nd
bisection
2
2 4
2 2 2
1 a b a b
x
−
=
⎟
⎠
⎞
⎜
⎝
⎛ −
≤ = − ε ρ
Error after 3
rd
bisection
3 2
3 5
2 2 2
1 a b a b
x
−
=
⎟
⎠
⎞
⎜
⎝
⎛ −
≤ = − ε ρ
Error after
th
n bisection
n n
n
a b a b
x
2 2 2
1
1
6
−
=
⎟
⎠
⎞
⎜
⎝
⎛ −
≤ = −
−
ε ρ
Because 0
2
lim lim =
⎟
⎠
⎞
⎜
⎝
⎛ −
= ∈
∞ → ∞ →
n
n
n
n
a b
we conclude that the bisection method always
converges.
Example 4.1
Verify that the function 10 4 ) (
2
− + = x x x f has a root inside the interval ) 2 , 1 ( and
use the limits of the interval as starting values of the bisection method to approximate
the root in 10 bisections.
lim
n→ ∞
ε
n
African Virtual University 86
Solution
We evaluate the function at the two end points of the given interval and fnd 5 ) 1 ( − = f
and 2 ) 2 ( = f . Since ) (x f is a continuous function and 0 ) 2 ( ) 1 ( < f f , the interme
diate value theorem asserts that f has at least one root in the interval 2 1 ≤ ≤ x . We
can therefore carry out the bisection method to fnd the results tabulated hereunder.
Table 4.1: Bisection Method for the function 10 4 ) (
2
− + = x x x f
n
a
) (a f
b
) (b f
c
) (c f
1 5 2 2 1.5 1.75
1 1.5 1.75 2 1.5 1.75 0.0625
2 1.5 1.75 1.75 0.0625 1.625 0.859375
3 1.625 0.859375 1.75 0.0625 1.6875 0.402344
4 1.6875 0.402344 1.75 0.0625 1.71875 0.170898
5 1.71875 .170898 1.75 0.0625 1.734375 0.054443
6 1.734375 0.054443 1.75 0.0625 1.742188 0.003971
7 1.734375 0.054443 1.742188 0.003971 1.738282 0.025248
8 1.738282 0.025248 1.742188 0.003971 1.740235 0.010642
9 1.740235 0.010642 1.742188 0.003971 1.741212 0.003333
10 1.741212 0.003333 1.742188 0.003971 1.741700 0.000319
The sequence of values under the ccolumn in the table is convergent. The true
value of the root being approached by this sequence (use the quadratic formula) is
... 741657 . 1 = ρ
DO THIS (4.1)
Verify that the function ) cos( ) ( x x x f − = has a root in the interval ] 1 , 0 [ and hence
apply the bisection method, in only fve iterations, to approximate the root.
(b) The Regula Falsi Method
The Bisection method we have just presented was a bit wasteful. In it one spends
great efforts at calculating values of the function f at two points which are only
used for deciding in which subinterval the root lies but are never used in the actual
calculation of the approximate value of the root.
African Virtual University 87
The method known as Regula Falsi (or rule of false position) rectifes this anomaly.
The method retains the principle of enclosure characteristic of the Bisection method
but also makes direct use of the function values at the two points which enclose the
root of the function.
The general approach for this and subsequent methods (Secant method and the Newton
Raphson method) is to replace the curve of ) (x f y = in the interval where the root
lies by the straight line joining the two points.
Specifcally, let the root ρ lie in the interval ] , [
2 1
x x . The equation of the secant line
joining the two points ) , (
1 1
f x A and ) , (
2 2
f x B is
. ) (
1
1 2
1 2
1
x x
x x
f f
f y −
−
−
+ =
Figure 4.2 Regula Falsi Method
y
x
1
x
2
x
Secant
3
x
A
B
This line intersects the xaxis at the point with coordinates ) 0 , (
3
x where
African Virtual University 88
1 2
1 2 2 1
1
1 2
1 2
1 3
f f
f x f x
f
f f
x x
x x
−
−
=
⎥
⎦
⎤
⎢
⎣
⎡
−
−
− =
Unlike the Bisection method, the Regula Falsi assumes that the two values
1
x and
2
x enclose the root being sought by requiring that 0
2 1
< f f and at the same time
involves the same function values in calculating a new approximation to the root.
The above process can be repeated several times in an iterative process using the
following algorithm.
Algorithm “Regula Falsi ( ε ρ, , , ), ( b a x f )”
Steps:
1. Deine
1
1 2
1 2
1 3
f
f f
x x
x x
⎥
⎦
⎤
⎢
⎣
⎡
−
−
− =
2. If ε ≤ −
3 1
x x and ε ≤ −
3 2
x x then accept
3
x = ρ and exit.
3. If 0
3 2
≤ f f then
3 1
: x x = ; otherwise
3 2
: x x = .
4. Go back to step 1.
Example 4.2
Starting with the values 2 , 1
2 1
= = x x apply the Regula Falsi method on the function
10 4 ) (
2
− + = x x x f to obtain an approximate value of the root enclosed in the
interval ) , (
2 1
x x in only four (4) iterations.
Table 4.2: The Regula Falsi Method for the function 10 4 ) (
2
− + = x x x f
1 5 2 2 1.714286 0.204080
1 1.714286 0.204080 2 2 1.740741 0.006857
2 1.740741 0.006857 2 2 1.741627 0.000227
3 1.741627 0.000227 2 2 1.741656 0.000010
4 1.741656 0.000010 2 2 1.741657 0.000003
n
1
x
) (
1
x f
2
x
) (
2
x f
1 2
1 2 2 1
3
f f
f x f x
x
−
−
=
) (
3
x f
African Virtual University 89
Examination of the values of
3
x against the background of the exact value of the
root ... 741657387 . 1 = ρ demonstrates the faster convergence of the Regula Falsi
method compared to the Bisection method.
Observation
The requirement in both the Bisection and the Regula Falsi methods that the two
values involved in the calculations,
2 1
, x x must enclose the root is computationally
very restrictive and signifcantly reduce the effciency of both methods. In a pro
grammed algorithm, the process of checking whether or not 0 ) ( ) (
2 1
< x f x f is time
consuming. As a result, efforts have been made to do without it. Our next method
achieves just that.
(c) The Secant Method
The Secant method is essentially the same as the Regula Falsi method. The only dif
ference is that in the Secant method the requirement that the two values
1
x and
2
x
must enclose the root is dropped. All one needs is to require the two values used in
the computation be close enough to the required root. The algorithm for the Secant
method is as given hereunder.
Algorithm “Secant Method ( ε ρ, , , ), ( b a x f )”
Steps:
1. Defne
1
1 2
1 2
1 3
f
f f
x x
x x
⎥
⎦
⎤
⎢
⎣
⎡
−
−
− =
5. If ε ≤ −
3 1
x x and ε ≤ −
3 2
x x
then accept
3
x = ρ and exit.
6. Otherwise set
2 1
: x x = and
3 2
: x x =
7. Go back to step 1.
African Virtual University 90
DO THIS (4.2)
Starting with 1 , 0
1 0
= = x x , perform 5 iterations using the secant method to ap
proximate the root of the function
) cos( ) ( x x x f − = .
(d) The NewtonRaphson Method
The Newton Raphson method is by far the most popular numerical method for
approximating roots of functions. The method assumes that the function ) (x f
is differentiable in the neighborhood of the root and that the derivative is not zero
anywhere in that neighborhood.
Assuming that
0
x is a point which is suffciently close to the root of the function,
the graph of the function ) (x f y = is approximated by the tangent to the curve at
the point.
y
x
1
x
2
x
Tangent
Fig ure 4.3: Newton Rap hson M ethod
The equation of the tangent through point )) ( , (
0 0
x f x on the curve ) (x f y = is
) ( ) (
0
/
0 0
x f x x f y − + =
This tangent intersects with the x  axis at the point
1
x whose value is
) (
) (
0
/
0
0 1
x f
x f
x x − =
African Virtual University 91
The value
1
x is then accepted as a new approximation to the root. The point
)) ( , (
1 1
x f x can be taken as a new point to draw a tangent through. Its intersection
with the x  axis, given by
) (
) (
1
/
1
1 2
x f
x f
x x − = is also accepted as a new approximation
to the root. This process can be repeated over and over, leading to the iteration method
given by the
NewtonRaphson formula ,... 2 , 1 , 0 ,
) (
) (
/
1
= − =
+
n
x f
x f
x x
n
n
n n
Each iteration using the Newton Raphson method requires one function evaluation
and one frst derive evaluation. Compared to the previous three numerical methods,
the Newton Raphson method converges very rapidly to the root.
Example 4.3
Starting with 1
0
= x approximate a root of the function 10 4 ) (
2
− + = x x x f correct
to 6 decimal places.
Solution
10 ) 4 ( 10 4 ) (
2
− + = − + = x x x x x f
4 2 ) (
/
+ = x x f
The requirement that we obtain an answer correct to 6 decimal places simply means
that we carry out the iteration until the 7
th
decimal digit in the values being calculated
is no longer changing.
African Virtual University 92
Table 4.3: The NewtonRaphson Method for the function 10 4 ) (
2
− + = x x x f
n
n
x ) (
n
x f
10 ) 4 ( − +
n n
x x
) (
/
n
x f
4 2 +
n
x ) (
) (
/
1
n
n
n n
x f
x f
x x − =
+
0 1 5 6 1.833 333 3
1 1.833 333 3 0.6944442 7.6666666 1.742 753 6
2 1.742 753 6 0.0082045 7.4855072 1.741 657 5
3 1.741 657 5 0 7.483315 1.741 657 5
Because the value of the function at
3
x is for all purposes zero, we can conclude that
the required approximation is 741657 . 1 = x rounded to six decimal places. The true
value of the root to the same degree of accuracy is 741657 . 1 = ρ
DO THIS (4.3)
Starting with 0
0
= x apply the NewtonRaphson method in only four iterations to
approximate the root of the function ) cos( ) ( x x x f − = .
4.4 Newton’s Method for a Coupled System
Our ffth and last numerical method will focus on solving a system of two simulta
neous nonlinear equations of the general form
0 ) , ( , 0 ) , ( = = y x g y x f .
A typical example of such a system is to fnd the coordinates of the point in the frst
quadrant where the parabola 7 2
2
− = x y intersects with the circle 6
2 2
= + y x .
Here, we are looking for the pairs of values ) , ( y x which satisfy the two nonlinear
equations
0 6 ) , ( , 0 7 2 ) , (
2 2 2
= − + ≡ = − − ≡ y x y x g y x y x f
African Virtual University 93
To obtain a NewtonRaphson type method for approximating the solution of the ge
neral problem stated above, we let ) , (
0 0
y x be an approximation to the exact solution
) , ( β α
of the coupled system. To obtain an improved solution ) , (
1 1
y x we assume
that the exact coordinates of the point are obtained by making adjustments h and k
to our initial values, such that
h x + =
0
α ; k y + =
0
β .
and hence, 0 ) , (
0 0
= + + k y h x f 0 ) , (
0 0
= + + k y h x g .
Expanding f and g in a Taylor Series about the point ) , (
0 0
y x one gets
... ) , ( ) , ( ) , ( ) , ( 0
... ) , ( ) , ( ) , ( ) , ( 0
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
+
∂
∂
+
∂
∂
+ = + + =
+
∂
∂
+
∂
∂
+ = + + =
y x
y
g
k y x
x
g
h y x g k y h x g
y x
y
f
k y x
x
f
h y x f k y h x f
where we have deliberately left out all higher order terms and retained only the terms
linear in the increments h and k .
If we truncate the series on the right hand side of each equation after the linear terms
we still get
0 ) , ( ) , ( ) , ( ) , (
0 ) , ( ) , ( ) , ( ) , (
0 0 0 0 0 0 0 0
0 0 0 0 0 0 0 0
=
∂
∂
+
∂
∂
+ = + +
=
∂
∂
+
∂
∂
+ = + +
y x
y
g
k y x
x
g
h y x g k y h x g
y x
y
f
k y x
x
f
h y x f k y h x f
but α ≠ + h x
0
and
β ≠ + k y
0
. We denote the values of x and y which satisfy
the above pair of equations with
h x x + =
0 1
; k y y + =
0 1
.
African Virtual University 94
Solving the resulting system of two linear equations:
0 ) , ( ) , ( ) , (
0 ) , ( ) , ( ) , (
0 0 0 0 0 0
0 0 0 0 0 0
=
∂
∂
+
∂
∂
+
=
∂
∂
+
∂
∂
+
y x
y
g
k y x
x
g
h y x g
y x
y
f
k y x
x
f
h y x f
for the unknown value h and k
The values of h and k are found to be
D
D
k
D
D
h
k h
= = ,
where
k h
D D D , , are the three determinants
g
x
g
f
x
f
D
y
g
g
y
f
f
D
y
g
x
g
y
f
x
f
D
h h
−
∂
∂
−
∂
∂
=
∂
∂
−
∂
∂
−
=
∂
∂
∂
∂
∂
∂
∂
∂
= ; ;
in which all the quantities (function values and partial derivatives) which appear
therein are evaluated at the point ). , (
0 0
y x
Once these quantities have been calculated, the values of the new approximate solu
tion can be calculated .
The above analysis carried out using the initial approximate solution
(x
1
, y
1
) can now
be repeated using the new pair ) , (
2 1
y x to lead to a new approximate solution ) , (
2 2
y x ,
and so on, and so on in an obvious iterative manner,
) , (
1 1
y x
African Virtual University 95
The method described above is known as Newton’s method for a system of simulta
neous nonlinear equations. Its speed of convergence is the same as its counterpart in
solving the single nonlinear equation 0 ) ( = x f .
Example 4.4
(a) Using analytical methods fnd the true solutions of the coupled system of equa
tions
0 6 ) , ( , 0 7 2 ) , (
2 2 2
= − + ≡ = − − ≡ y x y x g y x y x f
(b) Perform two iterations with Newton’s method to approximate a solution of the
coupled pair of equations which is believed to lie close to the point ) 1 , 2 ( .
Solution
(a) Solving the equation 0 ) , ( = x g for
2
x one gets
2 2
6 y x − = , and substituting this
expression of
2
x into the equation 0 ) , ( = y x f one gets [ ] 0 7 6 2
2
= − − − y y
This leads to the quadratic equation
0 5 2
2
= − + y y
Whose roots are
850781 . 1 , 350781 . 1
) 2 ( ) 1 (
− = = y y
The corresponding values for x are found to be
604559 . 1 ; 043377 . 2
) 2 ( ) 1 (
± = ± = x x
(b) 6 ) , ( ; 7 2 ) , (
2 2 2
− + = − − = y x y x g y x y x f
. 2 ; 2 ; 1 ; 4 y
y
g
x
x
g
y
f
x
x
f
=
∂
∂
=
∂
∂
− =
∂
∂
=
∂
∂
African Virtual University 96
First Iteration
1 , 2
0 0
= = y x
1 ) , ( , 8 ) , ( , 0 ) , (
0 0 0 0 0 0
− =
∂
∂
=
∂
∂
= y x
y
f
y x
x
f
y x f
2 ) , ( , 4 ) , ( , 1 ) , (
0 0 0 0 0 0
=
∂
∂
=
∂
∂
− = y x
y
g
y x
x
g
y x g
8 , 1 , 20 = = =
k h
D D D
0.05, 0.4
h k
D D
h k
D D
= = = =
4 . 1 , 05 . 2
0 1 0 1
= + = = + = k y y h x x
Second Iteration
4 . 1 , 05 . 2
1 1
= = y x
1 ) , ( , 2 . 8 ) , ( , 005 . 0 ) , (
1 1 1 1 1 1
− =
∂
∂
=
∂
∂
= y x
y
f
y x
x
f
y x f
8 . 2 ) , ( , 1 . 4 ) , ( , 1625 . 0 ) , (
1 1 1 1 1 1
=
∂
∂
=
∂
∂
= y x
y
g
y x
x
g
y x g
312 . 1 , 1765 . 0 , 06 . 27 − = − = =
k h
D D D
0.006523, 0.048485
h k
D D
h k
D D
= = − = = −
351515 . 1 , 043477 . 2
1 2 1 2
= + = = + = k y y h x x
African Virtual University 97
DO THIS (4.4)
Perform 2 iterations with Newton’s method to approximate the solution of the coupled
system of equations
0
0
2 2
2 2
= + −
= − −
y x y
y x x
that lies near the point with coordinates ) 4 . 0 , 8 . 0 ( .
(4.5) FixedPoint Iterations
Defnition
A number ρ is called a fxed point of a function ) (x g if ρ ρ = ) ( g .
The mathematical problem of fnding values of x which satisfy the equation
) (x g x = is called the fxed point problem.
(a) Existence Theorem
If ) (x g is continuous over ] , [ b a and
] , [ ] , [ ) ( b a x b a x g ∈ ∀ ∈ , then ) (x g has
at least one fxed point in ] , [ b a
To prove this theorem we need the Intermediate Value Theorem for continuous
functions.
Proof
If a a g = ) ( or b b g = ) ( then the proof is complete because then, a or b , or both are
fxed points of ) (x g . However, if a a g ≠ ) ( and b b g ≠ ) ( then from the assumption
] , [ ) ( b a x g ∈
made above, the function ) (x g satisfes b x g a < < ) ( . We defne
a function x x g x h − = ) ( ) ( for
] , [ b a x ∈ . Like ) (x g , the function ) (x h is also
continuous over ] , [ b a . By evaluating ) (x h at a x = and b x = we fnd
0 ) ( ) ( > − = a a g a h , 0 ) ( ) ( < − = b b g b h .
The intermediate value theorem asserts that the function ) (x h must vanish (have
zero value) at an intermediate point ) , ( b a ∈ ρ . At such a point ρ = x we have,
0 ) ( ) ( = − = ρ ρ ρ g h
which implies ρ ρ = ) ( g a result which implies that ) (x g
has a fxed point ) , ( b a ∈ ρ .
African Virtual University 98
(b) Uniqueness Theorem
The above theorem establishes the existence of at least one fxed point. There could
therefore be several fxed points. To guarantee that there is only one fxed point we
have the following theorem.
If in addition to the assumptions made above, the function ) (x g is differentiable in
) , ( b a and its derivative satisfes the condition
1
) , (
< = K
dx
dg
Max
b a
Then, ) (x g has a unique fxed point in ) , ( b a .
Proof
Assume that ) (x g has two different fxed points:
1
ρ ,
2
ρ
with
2 1
ρ ρ ≠ . Then,
1 1
) ( ρ ρ = g
and
2 2
) ( ρ ρ = g .
Through subtraction and using the Mean Value Theorem for differentiation we get
) )( ( ) ( ) (
1 2
/
1 2 1 2
ρ ρ ξ ρ ρ ρ ρ − = − = − g g g , where
ξ ∈(ρ
1
, ρ
2
)
By taking absolute values on both sides of this equation and observing the above
condition on ) (
/
x g we fnd
1 2 1 2 1 2
/
1 2
)( ( ρ ρ ρ ρ ρ ρ ζ ρ ρ − < − ≤ − = − K g
This is a contradiction which can only result from the assumption we made that
2 1
ρ ρ ≠ . We therefore conclude that under the stated assumptions, the function
) (x g has a unique (only one) fxed point.
(c) Relationship between Root fnding and Fixed point Problems
We introduced the concept of a fxed point for the purpose of using it in solving our
rootfnding problem. The relationship between the two problems is simple.
African Virtual University 99
In the rootfnding problem we want to fnd all values of x which satisfy the equa
tion 0 ) ( = x f .
Let us assume that we are able to express (split) the function ) (x f in the form
) ( ) ( x g x x f − = .
It is obvious that this splitting can be done in many ways. The particular choice of
) (x g will be critical in converting the rootfnding problem into a useful fxedpoint
problem.
If ρ is a root (zero) of ) (x f then
ρ ρ ρ ρ ρ ρ ρ = ⇒ = − ⇒ = − = ) ( 0 ) ( 0 ) ( ) ( g g g f
This result implies that the roots of ) (x f are the fxed points of ) (x g .
What we now need to do is to fnd the best splitting of the function ) (x f .
Such a splitting must result in a function ) (x g which has a unique fxed point in a
given interval. We shall demonstrate the splitting process on a typical example.
Example 4.5
Consider the rootfnding problem
0 10 4 ) (
2
= − + ≡ x x x f . Using the Intermediate
Value Theorem we can show that ) (x f has roots in the intervals ] 2 , 1 [ , ] 5 , 6 [ − −
For our purposes we shall be interested in fnding the root that lies in ] 2 , 1 [ .
The equation 0 10 4
2
= − + x x can be written in many different ways. The following
are but a few alternate ways of expressing the equation.
2
2
10 4 ) (
10 ) 4 ( ) (
4 10 ) (
x x iii
x x ii
x x i
− =
= +
− =
African Virtual University 100
We solve each of these three equations for x and get
) ( :
4
10
) (
) ( :
4
10
) (
) ( : 4 10 ) (
3
2
2
1
x g
x
x iii
x g
x
x ii
x g x x i
=
−
=
=
+
=
= − =
These are three possible fxedpoint problems for the given rootfnding problem
given above. The question is which one of these fxedpoint problems is most suited
for solving the rootfnding problem?
To answer this question we find which of the three fixedpoint functions
) ( ), ( ), (
3 2 1
x g x g x g satisfes the criteria stated by the uniqueness theorem with
respect to the root in ] 2 , 1 [ . Using direct substitution we fnd that
50 . 1 ) 2 ( , 25 . 2 ) 1 (
67 . 1 ) 2 ( , 00 . 2 ) 1 (
41 . 1 ) 2 ( , 45 . 2 ) 1 (
3 3
2 2
1 1
= =
= =
= =
g g
g g
g g
From the above results we conclude that, only ) (
2
x g satisfes the existence criteria.
Questions
Why do the other two functions fail the test?
Does ) (
2
x g satisfy the uniqueness criteria?
The Learner is expected to answer the frst question by checking whether or not
) ( , ) (
3 1
x g x g meet the existence criterion for possessing a fxed point in ] 2 , 1 [ . To
answer the second question we note that
28 . 0 ) 2 ( , 40 . 0 ) 1 ( ;
) 4 (
10
) (
/
2
/
2
2
/
2
− = − = ⇒
⎥
⎦
⎤
⎢
⎣
⎡
+
− = g g
x
x g
African Virtual University 101
Since 1 4 . 0
2
) 2 , 1 (
< =
dx
dg
Max we conclude that ) (
2
x g has a unique fxed
point ) 2 , 1 ( ∈ ρ which is automatically a root of the function ) (x f .
Approximation of the root
The root ρ can be approximated iteratively using the iteration
n n
x
x g x
n
n n
..., , 2 , 1 , 0 ;
4
10
) (
1
=
+
= =
+
for any starting value
0
x taken
from the interval ). 2 , 1 ( The following ten iterates were obtained using the starting
value 0 . 1
0
= x
n
n
x ) (
2 n
x g
0 1.000 000 2.000 000
1 2.000 000 1.666 667
2 1.666 667 1.764 706
3 1.764 706 1.734 694
4 1.734 694 1.743 772
5 1.743 772 1.741 016
6 1.741 016 1.741 852
7 1.741 852 1.741 598
8 1.741 598 1.741 675
9 1.741 675 1.741 652
10 1.741 652 1.741659
We note that the last value 741659 . 1 ) (
10 2
= x g
is very close to the true value of the
root of ) (x f which is 741657 . 1 = ρ rounded to 6 decimal places.
x
n+1
= g
2
(x
n
) =
10
4 + x
n
African Virtual University 102
DO THIS (4.5)
(i) Show that the function ) cos( ) ( x x g = satisfes the conditions for the existence
of a unique fxed point inside the interval ] 1 , 0 [ .
(ii) Use the result obtained in part (a) to fnd in only ten iterations, the point of in
tersection of the two curves ) cos( , x y x y = = . Start the iteration process
with 1
0
= x .
Reference for the Learning Activity
Kendall E. Atkinson, An Introduction to Numerical Analysis,  John Wiley & Sons,
Second Edition (1989).
African Virtual University 103
Solutions To Formative Evaluation Questions
DO THIS (4.1)
Application of the bisection method in 5 iterations on
) cos( ) ( x x x f − =
459698 . 0 ) 1 ( , 1 ) 0 ( = − = f f . Because ) (x f is continuous over ] 1 , 0 [ and
0 ) 1 ( ) 0 ( < f f , then by the Intermediate Value Theorem for continuous functions it
follows that ) (x f has at least one root in the interval ). 1 , 0 ( The bisection method
gives the following iterates:
0
0
= x 0 ) (
0
< x f
1
1
= x 0 ) (
1
> x f
5 . 0
2
= x 0 ) (
2
< x f
75 . 0
3
= x 0 ) (
3
> x f
625 . 0
4
= x 0 ) (
4
< x f
6875 . 0
5
= x
5
( ) 0 < f x
71875 . 0
6
= x 0 ) (
6
< x f
DO THIS (4.2)
Application of the secant method in 5 iterations on ). cos( ) ( x x x f − =
Formula to be used:
1
1
1
1 1 −
−
−
− +
⎟
⎟
⎠
⎞
⎜
⎜
⎝
⎛
−
−
− =
n
n n
n n
n n
f
f f
x x
x x
Starting values given: 459698 . 0 , 1 ; 1 , 0
1 0 1 0
= − = ⇒ = = f f x x
One obtains the following iterates:
African Virtual University 104
000000 . 0 , 739085 . 0
000683 , 0 , 738677 . 0
007979 . 0 , 743847 . 0
505751 . 0 , 410979 . 0
089300 . 0 , 685073 . 0
6 6
5 5
4 4
3 3
2 2
+ = =
− = =
+ = =
− = =
− = =
f x
f x
f x
f x
f x
DO THIS (4.3)
Application of NewtonRaphson’s method in three iterations on ) cos( ) ( x x x f − =
Formula to be used is
) (
) (
/
1
n
n
n n
x f
x f
x x − =
+
.
Starting value given 0
0
= x ; ) sin( 1 ) (
/
x x f + =
One gets the iterates
000047 . 0 ) ( , 739113 . 0
681905 . 1 ) ( , 018923 . 0 ) ( , 750364 . 0
841471 . 1 ) ( , 459698 . 0 ) ( , 000000 . 1
000000 . 1 ) ( , 000000 . 1 ) ( , 000000 . 0
3 4
2
/
2 2
1
/
1 1
0
/
0 0
+ = =
= + = =
= + = =
= − = =
x f x
x f x f x
x f x f x
x f x f x
DO THIS (4.4)
y g x g y x y y x g
y f x f y x x y x f
y x
y x
2 1 , 2 , ) , (
2 , 2 1 , ) , (
2 2
2 2
+ = − = ⇒ + − =
− = − = ⇒ − − =
Starting values
4 . 0 , 8 . 0
0 0
= = y x
African Virtual University 105
First iteration
420339 . 0 , 772881 . 0
1 1
= = y x
Second iteration
419644 . 0 , 771846 . 0
2 2
= = y x
DO THIS (4.5)
Given: ] 1 , 0 [ , ) cos( ) ( ∈ = x x x g
Checking existence of a fxed point
) ( x g is continuous over ] 1 , 0 [ .
] 1 , 0 [ ] 1 , 0 [ ) ( ; 459698 . 0 ) 1 ( , 1 ) 0 ( ∈ ∀ ∈ ⇒ = − = x x g g g
Therefore the existence criterion is fulflled.
Checking uniqueness of a fxed point
) sin( ) (
/
x x g − =
 g
/
(x) <1 ∀x ∈[0,1]
Therefore the uniqueness criterion is fulflled.
Computations
) cos( ) (
1 n n n
x x g x = =
+
Starting value: 0 . 1
0
= x
The following iterates are obtained
African Virtual University 106
744237 . 0 ) cos(
731404 . 0 ) cos(
750418 . 0 ) cos(
722102 . 0 ) cos(
763960 . 0 ) cos(
701369 . 0 ) cos(
793480 . 0 ) cos(
654290 . 0 ) cos(
857553 . 0 ) cos(
540302 . 0 ) cos(
9 10
8 9
7 8
6 7
5 6
4 5
3 4
2 3
1 2
0 1
= =
= =
= =
= =
= =
= =
= =
= =
= =
= =
x x
x x
x x
x x
x x
x x
x x
x x
x x
x x
African Virtual University 107
XI. Compiled List of all Key Concepts
(Glossary)
Key Concepts
Each of the (four) learning activities has key concepts, theorems and principles specifc
to its contents. However, to give the learner an opportunity to have a glimpse at what
lies ahead in terms of the general framework and contents of the module we list here,
a priori, all the key concepts, theorems and principles relevant to the module.
Reproduction of these concepts under their respective learning activities is meant
to enhance the learner’s understanding and appreciation of their importance in the
overall understanding of the course.
1. Error in an approximation
Let X be the exact (true) value of some quantity Q and
*
X be an approximate value
of Q obtained through some numerical process. The difference (deviation) between
the exact value X and its approximation
*
X is called the error in
*
X , and is denoted
by Error (
*
X ) =
*
X X −
2. Absolute error
The error in an approximation may be positive or negative, depending on whether
one has underestimated or overestimated the true value of the quantity Q being ap
proximated. In practice, what matters more is the size of the error rather than its sign.
In order to ignore the sign and concentrate on the size of the error, one introduces the
concept of absolute error, which is defned by: Absolute error in
*
X =
*
X X − .
3. Relative error
The absolute error gives the size of the error and thereby serves as a measure of the
accuracy of the approximation
*
X . However, by not relating the error to the true value
being approximated one may not be able to gauge the seriousness of the error. To
achieve this one introduces the concept of relative error or percentage error. This is
defned by: Relative error in (
*
X ) =
X
X X
*
−
provided that 0 ≠ X . Percentage
African Virtual University 108
error in (
*
X ) =
X
X X
*
100
−
%provided that
0 ≠ X .
Since the true value X is normally not known, one replaces it with the approximate
value
*
X in the denominator of the relative (percentage) error.
4. Arithmetic progression
An arithmetic progression (AP) is a special sequence { } ,... 2 , 1 , 0 : = n a
n
of numbers.
The essential elements of such a sequence are its frst element
0
a and a constant dif
ference d . Except for the frst element, the th k −
element of the sequence is given
as d k a a
k
) 1 (
0
− + = , ,... 3 , 2 , 1 = k
The sum of the frst n terms of an AP is easily shown to be
S
n
= na
0
+
1
2
n(n−1)
5. Geometric progression.
A geometric progression (GP) is a special sequence { } ,... 2 , 1 , 0 : = n a
n
of numbers.
The essential elements of such a sequence are its frst element
0
a and a constant
multiplication factor
1 ≠ r . Except for the frst element, the th k −
element of the
sequence is given by
1
0
−
=
k
k
r a a , ,... 3 , 2 , 1 = k
The sum of the frst n terms of a GP is
⎥
⎦
⎤
⎢
⎣
⎡
−
−
= =
−
=
∑
1
1
0
1
1
0
r
r
a r a S
n
k
n
k
n
6. Limit of a function
A function ) (x f is said to approach the value (have the limit) L as x approaches
a value c in the domain of f , and we write
lim
x → c
f (x) = L
if for every choice of a
small positive number ε one can fnd a corresponding small positive number ) (ε δ
such that whenever
x − c < δ(ε)
then
f (x) − L < ε
. Essentially this statement
African Virtual University 109
implies that values of the function ) (x f will be arbitrarily close to the number L
provided the corresponding values of x are close enough to point c .
7. Continuity
A function ) (x f is said to be continuous at a point c x = if the limit of the values
) (x f is the value ) (c f , that is if
lim
x → c
f (x) = f (a)
. Essentially what this defnition
of continuity implies is that, for ) (x f to be continuous at point c x = the following
three conditions must hold:
(i) The function must be defned at the point: ) (c f must exist.
(ii) The function must have a limit at the point:
lim
x → c
f (x) = L
(iii) The limit must be equal to the function value: L c f = ) (
8. Derivative
The derivative of a function ) (x f at an arbitrary point x in its domain is the limit
of the difference quotient
x
x f x x f
x
f
Δ
− Δ +
=
Δ
Δ ) ( ) (
as the change x Δ in x tends
to zero, that is
⎥
⎦
⎤
⎢
⎣
⎡
Δ
− Δ +
→ Δ
x
x f x x f
x
) ( ) (
lim
0
. If the limit exists one denotes it by
dx
df
or ) (
/
x f and calls it the frst derivative of f .
9. Antiderivative
An antiderivative of a function ) (x f is itself a function ). (x F The function
F has the property that its derivative must be the function ) (x f , meaning that
) ( ) (
/
x f x F = .
Essentially, the process of fnding an antiderivative of ) (x f is the reverse process
to that of differentiating a function. For this reason, one also speaks of antidifferen
tiation when fnding ) (x F . Symbolically one writes
∫
= dx x f x F ) ( ) ( .
African Virtual University 110
10. Convergence of a sequence
A sequence of numbers, written { }
n
a is a well defned and ordered fnite or infnite
set of numbers. The individual members (elements) of the set must be unambiguously
defned. Essentially a set is a special function defned over the set of natural (counting)
numbers N or over a subset of N . A set { }
n
a is said to converge to a limit L if
for every 0 > ε one can fnd a corresponding positive integer number ) (ε N such
that ε < − L a
n
if only ) (ε N n > .
11. Fixed point of a function
Given a continuous function ) (x g over a closed interval ] , [ b a any value ρ = x
which satisfes the relation ρ ρ = ) ( g is called a fxed point of the function ) (x g
. The process of fnding fxed points of a function is closely related to that of deter
mining roots of functions.
12. Secant line
A secant is a line which passes through two given points ) , (
1 1
y x P and ) , (
2 2
y x Q
and is given by the equation ) (
1
1 2
1 2
1
x x
x x
y y
y y −
−
−
− = . The secant equation is
used in deriving the Regula Falsi and the Secant methods for approximating roots
of functions.
African Virtual University 111
Key Theorems and Principles
1. Intermediate Value Theorem
If f is continuous on a closed interval ] , [ b a and if k is any number lying between
the two values ) (a f and ) (b f , then there is at least one number c in ) , ( b a such
that . ) ( k c f = This theorem is the basis upon which two important numerical
methods for fnding roots of a function ) (x f , the bisection method and the Regula
Falsi (Rule of false position).
2. Mean Value Theorem of Differentiation (MVT)
If f is a continuous function on the closed interval ] , [ b a and is differentiable on
the open interval ) , ( b a , then there exists at least one value of ) , ( b a c x ∈ = such
that
a b
a f b f
c f
−
−
=
) ( ) (
) (
/
.
3. Taylor’s Theorem
Let f be a function whose frst n derivatives are continuous on the closed interval
] , [ h c c + (or ] , [ c h c + if h is negative) and assume that
) 1 ( + n
f exists in ] , [ h c c +
(or ] , [ c h c + if h is negative). Then, there exists a number , ϑ with 1 0 < < ϑ
such that
) , ( ) (
!
) (
1
) (
0
ϑ h c f
k
h
h c f
Rn
k
n
k
k
+
=
+ = +
∑
, ) (
)! 1 (
) , (
) 1 (
1
1
h c f
n
h
c
n
n
n R
ϑ ϑ +
+
=
+
+
+
4. Fundamental Theorem of Calculus
If f is continuous on [ , ] a b and ( ) ( )
x
a
F x f t dt =
∫
for each x in [ , ] a b , then ( ) F x
is continuous on [ , ] a b and differentiable on ( , ) a b and
African Virtual University 112
( )
dF
f x
dx
= . In other words, ( ) F x is an antiderivative of ( ) f x .
Corollary: If ( ) f x is continuous on a closed and bounded interval [ , ] a b , and
'
( ) g x = ( ) f x , then
( ) ( ) ( )
b
a
f x dx g b g a = −
∫
.
5. Fixed Point Theorem
If the function ) (x g is continuous over b x a ≤ ≤ and ] , [ ) ( b a x g ∈ ] , [ b a x ∈ ∀
then there exists at least one fxed point ] , [ b a x ∈ = ρ such that ρ ρ = ) ( g .
If, in addition to the above assumptions, ) (x g is differentiable in b x a < < and
1 < ≤ L
dx
dg
for all ) , ( b a x ∈ , then ) (x g has a unique (only one) fxed point
). , ( b a ∈ ρ
African Virtual University 113
XII. Compiled List Of Compulsory Readings
Wikipedia: Numerical Analysis
Wikipedia: Interpolation
Fundamental Numerical Methods and Data Analysis, George W. Collins, II, chapter
4. (see: http://bifrost.cwru.edu/personal/collins/numbk/)
Wikipedia: Numerical Methods/Numerical Integration
Wikipedia: Numerical Methods/Equation Solving
African Virtual University 114
XIII. Compiled List of (Optional) Multimedia
Resources
Reading # 1: Wolfram MathWorld (visited 03.11.06)
Complete reference : http://mathworld.wolfram.com
Abstract : Wolfram MathWorld is a specialised online mathematical encyclopedia.
Rationale: It provides the most detailed references to any mathematical topic. Stu
dents should start by using the search facility for the module title. This will fnd a
major article. At any point students should search for key words that they need to
understand. The entry should be studied carefully and thoroughly.
Reading # 2: Wikipedia (visited 03.11.06)
Complete reference : http://en.wikipedia.org/wiki
Abstract : Wikipedia is an online encyclopedia. It is written by its own readers.
It is extremely uptodate as entries are contunally revised. Also, it has proved to be
extremely accurate. The mathematics entries are very detailed.
Rationale: Students should use wikipedia in the same way as MathWorld. However,
the entries may be shorter and a little easier to use in the frst instance. Thy will,
however, not be so detailed.
Reading # 3: MacTutor History of Mathematics (visited 03.11.06)
Complete reference :http://wwwhistory.mcs.standrews.ac.uk/Indexes
Abstract : The MacTutor Archive is the most comprehensive history of mathematics
on the internet. The resources are organsied by historical characters and by historical
themes.
Rationale: Students should search the MacTutor archive for key words in the topics
they are studying (or by the module title itself). It is important to get an overview
of where the mathematics being studied fts in to the hostory of mathematics. When
the student completes the course and is teaching high school mathematics, the cha
racters in the history of mathematics will bring the subject to life for their students.
Particularly, the role of women in the history of mathematics should be studied to
help students understand the diffculties women have faced while still making an
important contribution.. Equally, the role of the African continent should be studied
to share with students in schools: notably the earliest number counting devices (e.g.
the Ishango bone) and the role of Egyptian mathematics should be studied.
African Virtual University 115
XIV. Synthesis of the Module
Completion of the fourth learning activity marks the end of this module. At this
juncture, and before presenting oneself for the summative evaluation, it is desirable
and appropriate that the learner refects back on the mission, objectives, activities
and attempts to form a global picture of what he/she is expected to have achieved as
a result of the collective time and efforts invested in the learning process.
As laid out in the module overview in Section 6, the learner is expected to have
acquired knowledge of the basic concepts relating to numerical approximation of
numbers and functions.
The learner is now expected to be able to comfortably defne the concept of an er
ror in mathematics, identify the sources of errors, the different types of errors and
methods of reducing the impact of errors on our fnal numerical approximation to a
mathematical problem.
After the opening learning activity on errors three substantive learning activities on
the core issue of approximation were presented. One of these three core learning ac
tivity was on numerical approximation of functions using interpolation polynomials.
Specifcally the learner is now expected to be reasonably comfortable in using linear
interpolation in its various forms and derive an error bound for linear interpolation. The
activity also presents the important topic of interpolation polynomials, concentrating
on Lagrangean, Newton’s divided differences and the all important fnite difference
interpolation polynomials.
The remaining two core learning activities (the third and fourth) are on numerical
methods for approximating numbers (roots of functions and values of defnite inte
grals). In this regard the learner is expected to have appreciated the need for resorting
to numerical methods, but also be able to apply the methods learnt, including the
Bisection, RegulaFalsi, Secant and the NewtonRaphson methods for approximating
roots of a nonlinear function of a single variable. One is also expected to solve a
evaluate limits of functions, sequences and infnite series. One is also expected to be
able to apply Newton’s method to approximate solutions of a couples system of two
nonlinear equations in two variables.
The module has been structured with a view to escorting and guiding the learner
through the material with carefully selected examples and references to the core
references. A reasonable number of worked out examples have been included in
every learning activity to serve as beacons of reference both in understanding the text
before them as well as serving as points of reference while solving related formative
evaluation problems that appear in the text in the form of DO THIS. The degree of
mastery of the module contents will largely depend on the learner’s deliberate and
planned efforts to monitor his/her progress by solving the DO THIS problems.
African Virtual University 116
XV. Summative Evaluation
Questions
1. (a) Defne the concept of an error in mathematics.
(b) Give the main types of mathematical errors and mention their sources.
(c) Distinguish between absolute and relative errors and attempt to relate them
to the concepts of accuracy and precision.
2. (a) The error ) (x E in linear interpolation of a function ) (x f using
the values ) ( , ) (
1 1 0 0
x f f x f f = = where h x x = −
0 1
is given by
) (
2
1
) )( ( ) (
//
1 0
ξ f x x x x x E − − = , where ) , (
1 0
x x ∈ ξ . Derive an upper bound
for E .
(b) Use the error bound obtained in part (a) to determine the smallest interval
size h for which linear interpolation of ) cos(x will give approximate values
with errors not exceeding
01 . 0 .
3. The following table gives values of a function ) (x f at a number of equally
spaced points
k
x .
x 0.0 0.125 0.25 0.375 0.5
f(x) 1.000000 0.984615 0.941176 0.876712 0.800000
x 0.625 0.75 0.875 1.0
f(x) 0.719101 0.640000 0.566372 0.500000
Approximate ) (x f by a quadratic Lagrangean interpolation polynomial using the
points ) 876712 . 0 , 375 . 0 ( , ) 941176 . 0 , 25 . 0 ( , ) 984615 . 0 , 125 . 0 ( and hence,
interpolate ) (x f at 3 . 0 = x .
African Virtual University 117
4. (a) Construct a table of fnite differences for the function ) (x f tabulated in
Question 3 (a).
(b) With the aid of the table of fnite differences interpolate the function at 4 . 0 = x
using Bessel’s interpolation formula centered at 375 . 0
0
= x
... ) 2 )( 1 (
24
1
)
2
1
)( 1 (
6
1
) 1 (
2
1
)
2
1
( ) (
2
1
4 2
2
1
3
2
1
2
2
1
2
1
+ − − =
+ − − + − + − + =
f s s s
f s s s f s s f s f s f
μδ
δ μδ δ μ
where ) (
1
0
x x
h
s − =
5. Apply Newton’s interpolation based on divided differences to interpolate the
function tabulated in Question 4 at the point 4 . 0 = x
6. (a ) Derive a NewtonRaphson iteration formula for approximating the
th
r root
of a positive real number A.
(b) If 7 = A apply the formula you have derived to approximate the square root
of 7 correct to six decimals. Start the iteration with . 2
0
= x
7. (a) Defne the concept of a fxed point for a function ) (x g which is known to be
continuous over ] , [ b a and differentiable in ). , ( b a
(b) State without proof, the existence and uniqueness theorem for fxed points
of ). (x g
(c) Discuss whether or not the function
g(x) =
4
6 − x
has a unique fxed
point in the interval ] 1 , 0 [ .
African Virtual University 118
8. (a) Using an analytical method calculate all the solutions of the coupled system
2 2 , 5 2
2 2 2 2
= − = + y x y x
correct to 6 decimal places.
(b) Starting with 5 . 0 , 5 . 1
0 0
= = y x approximate one of the solutions by
carrying out two iterations with Newton’s method for systems of nonlinear
equations.
9. (a) Find the antiderivative ) (x F of the function
2 3
) (
2
+ +
=
x x
x
x f and use
it to evaluate the integral dx
x x
x
∫
+ +
1
0
2
2 3
correct to 6 decimals.
(b) Evaluate the above integral using the NewtonCotes formula
[ ] ) ( ) ( 3 ) ( 3 ) (
8
3
) (
3 2 1 0
3
0
x f x f x f x f
h
dx x f
x
x
+ + + =
∫
with
6
1
= h .
10. (a) Evaluate the integral ( )dx x e
x
∫
−
1
0
) cos( analytically correct to 6 decimal
places accuracy.
(b) Tabulate values of the integrand in (a) at the points k x
k
125 . 0 =
8 ,... 2 , 1 , 0 = k and use the values obtained with the Trapezoidal rule to
approximate the integral, taking 25 . 0 = h and 125 . 0 = h , respectively.
(c ) Apply Romberg integration on the two Trapezoidal values obtained in (b)
to obtain a better approximation of the integral in (a).
African Virtual University 119
SOLUTIONS
1. (a) If
*
X is an approximation to an exact (true) quantity X , then the deviation
*
X X −
is called the error in the approximation
*
X .
(b) The main types of mathematical errors are:
• Initial errors. These are errors in the initial data supplied with a mathematical
problem.
• Discretization errors. These are errors caused by the process of converting
a mathematical problem having a continuous solution to a numerical model
whose solution is a discrete function in the form of a sequence of numbers.
• Truncation errors. These are errors introduced through unavoidable termina
tion (truncation) of an otherwise infnite process such an infnite series or a
convergent iteration.
• Rounding errors. These are errors introduced because of limitations on the
part of the instruments we use in performing arithmetic operations (addition,
subtraction, multiplication or division).
(c) The absolute error is the magnitude or size of an error. The absolute error, denoted
by
*
X X − is always nonnegative.
The relative error is the ratio between the absolute error and the absolute value
of the true (exact) quantity being approximated. The relative error is denoted by
X
X X
*
−
.
The absolute error is a measure of the accuracy in the approximation, while the relative
error is a measure of the precision and relates to the seriousness of the error.
2. (a) To obtain a bound on the error ) (x E in linear interpolation one needs to
fnd the maximum value of the functions ) )( ( ) (
1 0
x x x x x g − − = and ) (
//
ξ f
over the interval
1 0
x x x < < . With ) ( 2 ) (
0 0
/
x x x x g + − = we fnd that ) (x g
has a critical point at ) (
2
1
1 0
*
x x x + = , and because 2 ) (
//
= x g is always
positive we conclude that
4
) (
4
1
) (
2
2
0 1
*
h
x x x g − = − − =
Assuming that
African Virtual University 120
M x f Max = ) (
//
over the interval in question we can then write
[ ]
8
) ( ) (
2
M h
x g Max M x E = ≤
(b) The function being approximated is ). cos( ) ( x x f = In this case, ) cos( ) (
//
x x f − =
and in this case 1 = M . We now must determine the step length h such that
01 . 0
8 8
2 2
≤ =
h Mh
. This gives the result 3 . 0 ≤ h
3. The quadratic Lagrangean interpolation polynomial passing through three points
) , ( ), , ( ), , (
2 2 1 1 0 0
f x f x f x is given by the expression
2 2 1 1 0 0 2
) ( ) ( ) ( ) ( f x L f x L f x L x P + + = where ) ( ), ( ), (
2 1 0
x L x L x L are theLa
grangean coeffcients of degree 2. In this case we have the following values:
) )( (
) )( (
) ( , 876712 . 0 , 375 . 0
) )( (
) )( (
) ( , 941176 . 0 , 250 . 0
) )( (
) )( (
) ( , 984615 . 0 , 125 . 0
1 2 0 2
1 0
2 2 3
2 1 0 1
2 0
1 1 1
2 0 1 0
2 1
0 0 0
x x x x
x x x x
x L f x
x x x x
x x x x
x L f x
x x x x
x x x x
x L f x
− −
− −
= = =
− −
− −
= = =
− −
− −
= = =
With 3 . 0 = x , direct substitution of the various values of involved into the expressions
for the Lagrangean coeffcients gives:
28 . 0 ) 3 . 0 ( , 84 . 0 ) 3 . 0 ( , 12 . 0 ) 3 . 0 (
2 1 0
= = − = L L L ,
results which lead to the solution
917913 . 0 ) 876712 . 0 )( 28 . 0 ( ) 941176 . 0 )( 84 . 0 ( ) 984615 . 0 )( 12 . 0 (
) 3 . 0 ( ) 3 . 0 ( ) 3 . 0 ( ) 3 . 0 (
2 2 1 1 0 0 2
= + + − =
+ + = f L f L f L P
African Virtual University 121
4. (a) Table of Differences
Differences
x f(x) First Second Third Fourth
0.000 1.000000
0.015385
0.125 0.984615 0.028054
0.043439 0.007029
0.250 0.941176 0.021025 0.001748
0.064464 0.008777
0.375 0.876712 0.012248 0.000716
0.076712 0.008061
0.500 0.800000 0.004187 0.005672
0.080899 0.002389
0.625 0.719101 0.001798 0.001286
0.079101 0.003675
0.750 0.640000 0.005473 0.005458
0.073628 0.001783
0.875 0.566372 0.007256
0.066372
1.000 0.500000
(b) Since
0
0.375, 0.4, 0.125 = = = x x h , then value of the parameter
1
(0.4 0.375) 0.2
0.125
= − = s
African Virtual University 122
With the aid of the table of fnite differences interpolate the function at 4 . 0 = x
using Bessel’s interpolation formula:
0000459936 . 0 ) 006388 . 0 (
2
1
) 0144 . 0 ( ) 2 )( 1 (
24
1
000064488 . 0 ) 008061 . 0 )( 008 . 0 ( )
2
1
)( 1 (
6
1
0006574 . 0 ) 012248 . 0 004187 . 0 (
2
1
) 08 . 0 0 ( ) 1 (
2
1
0230136 . 0 ) 076712 . 0 )( 3 . 0 ( )
2
1
(
838356 . 0 ) (
2
1
2
1
4 2
2
1
3
2
1
2
2
1
0 1
2
1
= = − −
= = − −
= − − − = −
= − − = −
= + =
f s s s
f s s s
f s s
f s
f f f
μδ
δ
μδ
δ
μ
Addition of all these terms leads to the answer 862137 . 0 ) 4 . 0 ( = P .
5. First one constructs the table of Newton’s divided differences. Then one applies
the interpolation polynomial
... ] , , [ ) )( ( ] , [ ) ( ) (
2 1 0 1 0 1 0 0 0
+ − − + − + = x x x f x x x x x x f x x f x P
n
Table of Newton’s Divided Differences
Divided Differences
x f(x) First Second Third Fourth
0.0 1.000000
0.12308
0.125 0.984615 0.897728
0.347512 0.599808
0.25 0.941176 0.672800 0.298326
0.515712 0.748971
0.375 0.876712 0.391936 0.122198
0.613696 0.687872
0.5 0.800000 0.133984 0.354304
0.647192 0.510720
0.625 0.719101 0.057536 0.394240
0.632808 0.0.313600
0.75 0.640000 0.175136 1.251670
0.589024 0.312235
0.875 0.566372 0.058048
0.530976
1.0 0.500000
African Virtual University 123
Direct application of the formula based on 375 . 0
0
= x and using the values of va
rious divided differences highlighted in the table together with the value 4 . 0 = x
gives the following results:
000077616 . 0 ] , , , , [ ) )( )( )( (
00028728 . 0 ] , , , [ ) )( )( (
00033496 . 0 ] , , [ ) )( (
0153424 . 0 ] , [ ) (
876712 . 0 ) (
4 3 2 1 0 3 2 1 0
3 2 1 0 2 1 0
2 1 0 1 0
1 0 0
= − − − −
= − − −
= − −
− = −
=
x x x x x f x x x x x x x x
x x x x f x x x x x x
x x x f x x x x
x x f x x
x f
Therefore
= + + + − ≈ 000078 . 0 000287 . 0 000335 . 0 015342 . 0 876712 . 0 ) 4 . 0 (
4
P , 0.862070
6. (a) If
r
A x = then, 0 = − A x
r
.
One may therefore take the function whose roots are being sought to
be A x x f
r
− = ) ( .
The derivative of ) (x f is
1 /
) (
−
=
r
rx x f .
Substituting these quantities into the NewtonRaphson formula
) (
) (
/
1
n
n
n n
x f
x f
x x − =
+
we obtain the general NewtonRaphson formula
⎥
⎥
⎦
⎤
⎢
⎢
⎣
⎡
+ − =
⎥
⎥
⎦
⎤
⎢
⎢
⎣
⎡
+ −
=
+ −
=
−
− =
−
− − −
+
1
1 1 1
1
) 1 (
1
) 1 ( 1
r
n
n
r
n
r
n
r
n
r
n
r
n
r
n
r
n
n n
x
A
x r
r
x
A x r
r
rx
A x rx
rx
A x
x x
African Virtual University 124
(b) The NewtonRaphson formula for fnding the square root of a number 7 = A
and 2 = r . This gives the special formula
⎥
⎦
⎤
⎢
⎣
⎡
+ =
+
n
n n
x
x x
7
2
1
1
.
Taking 0 . 2
0
= x the following iterates are obtained from the formula:
6457513 . 2
6457513 . 2
6457520 . 2
6477273 . 2
75 . 2
0 . 2
6
5
4
3
1
0
=
=
=
=
=
=
x
x
x
x
x
x
Since the 7
th
decimal digit remains constant in the last two iterates we accept
645751 . 2 = x as the desired approximation of 7 correct to 6 decimals.
7. (a) A number ρ
is said to be a fxed point of a function ) (x g if ρ ρ = ) ( g .
(b) If ) (x g is a function which satisfes the conditions
• ) (x g is continuous over a closed interval ] , [ b a
• ] , [ ] , [ ) ( b a x b a x g ∈ ∀ ∈
• ) (x g is differentiable in ) , ( b a
• ) , ( 1 ) (
/
b a x L x g Max ∈ ∀ < =
Then ) (x g has a unique fxed point ) , ( b a ∈ ρ .
(c) Consider the function
g(x) =
4
6 − x
over the interval ] 1 , 0 [ .
Since the only point of discontinuity for the function is 6 = x , the function is
defnitely continuous over the interval ] 1 , 0 [ .
African Virtual University 125
With both
6
4
) 0 ( = g and
5
4
) 1 ( = g lying in ) 1 , 0 ( we also note that all the function
values lie inside the given interval.
The function is also differentiable and
g(x) = −
4
(6 − x)
2
. The maximum value of .
g
/
(x) = g
/
(0) =
4
36
=
1
9
<1
This result proves that the function has a unique fxed
point in the interval 1 0 < < x .
8. (a) Analytical Solution
To obtain the true (analytical) solution one eliminates one of the variables and
solves the resulting quadratic equation in the retained variable.
From the frst equation one fnds
2 2
2 5 x y − =
We use this result to eliminate y from the second equation.
⎪
⎩
⎪
⎨
⎧
− =
+ =
= = ⇒ = ⇒ = − −
549193 . 1
549183 . 1
4 . 2 12 5 2 ) 2 5 ( 2
2
1
2 2 2
x
x
x x x x
The corresponding values of y is obtained from the relation
⎪
⎩
⎪
⎨
⎧
− =
+ =
= = − =
447213 . 0
447213 . 0
2 . 0 2 5
2
1
2
y
y
x y
The four possible solutions to the coupled system are
) 447213 . 0 , 549183 . 1 ( , ) 447213 . 0 , 549163 . 1 (
) 447213 . 0 , 549183 . 1 ( , ) 447213 . 0 , 549183 . 1 (
−
− − −
African Virtual University 126
(b) Approximation of the roots using Newton’s method
Let
0 2 2 ) , (
0 5 2 ) , (
2 2
2 2
= − − ≡
= − + ≡
y x y x g
y x y x f
The partial derivatives of ) , ( y x f and ) , ( y x g are
y g
y
g
x g
x
g
y f
y
f
x f
x
f
y x
y x
4 ; 2
2 ; 4
− = =
∂
∂
= =
∂
∂
= =
∂
∂
= =
∂
∂
Newton’s method states t that, starting from an approximate solution ) , (
n n
y x an
improved approximation ) , (
1 1 + + n n
y x can be obtained by setting
n n n n n n
k y y h x x + = + =
+ + 1 1
, .
The increments
n n
k h , are obtained by solving the linear system of equations
⎟
⎟
⎟
⎠
⎞
⎜
⎜
⎜
⎝
⎛
−
−
=
⎟
⎟
⎟
⎠
⎞
⎜
⎜
⎜
⎝
⎛
⎟
⎟
⎟
⎠
⎞
⎜
⎜
⎜
⎝
⎛
g
f
k
h
g f
g f
n
n
y y
x x
Application of Newton’s method:
First Iteration
0 . 2 , 0 . 3 , 25 . 0
0 . 1 , 0 . 6 , 25 . 0
5 . 0 , 5 . 1
0
0
0 0
− = = − =
= = − =
= =
y x
y x
g g g
f f f
y x
African Virtual University 127
Substituting these quantities into the linear system and solving the resulting system
one gets 083333 . 0 , 083333 . 0
0 0
− = = k h
and therefore
416667 . 0 , 583333 . 1
0 0 1 0 0 1
= + = = + = k y y h x x
Second Iteration
666668 . 1 , 166666 . 3 , . 159721 . 0
833334 . 0 , 333333 . 6 , . 187498 . 0
416667 . 0 , 583333 . 1
1
1
1 1
− = = =
= = =
= =
y x
y x
g g g
f f f
y x
Substituting these quantities into the linear system and solving the resulting system
one gets 031667 . 0 , 033772 . 0
1 1
= − = k h and therefore
448334 . 0 , 549561 . 1
1 1 2 1 1 2
= + = = + = k y y h x x
9. (a) The antiderivative of the function
2 3
) (
2
+ +
=
x x
x
x f
t Cons
x
x
x x
dx
x x
x x
x x
dx
x x
x x d
x x
dx
dx
x x
x
dx
x x
x
x x
xdx
tan
2
1
ln
2
3
) 2 3 ln(
2
1
2
1
1
1
2
3
) 2 3 ln(
2
1
) 2 )( 1 ( 2
3
2 3
) 2 3 (
2
1
2 3 2
3
2 3
3 2
2
1
2 3
3 3 2
2
1
2 3
2
2
2
2
2 2 2 2
+
⎟
⎠
⎞
⎜
⎝
⎛
+
+
− + + =
⎟
⎠
⎞
⎜
⎝
⎛
+
−
+
− + + =
+ +
−
+ +
+ +
=
+ +
−
+ +
+
=
+ +
− +
=
+ +
∫
∫ ∫
∫ ∫ ∫ ∫
Therefore, dx
x x
x
∫
+ +
1
0
2
2 3
=
[ ] 117783 . 0 431523 . 0 549306 . 0
2
1
ln
3
2
ln
2
3
) 2 ln( ) 6 ln(
2
1
= − =
⎥
⎦
⎤
⎢
⎣
⎡
− − −
African Virtual University 128
(b) To approximate the same integral dx
x x
x
I
∫
+ +
=
1
0
2
2 3
using the special
NewtonCotes formula [ ] ) ( ) ( 3 ) ( 3 ) (
8
3
) (
3 2 1 0
3
0
x f x f x f x f
h
dx x f
x
x
+ + + =
∫
One frst tabulates the function:
k
x
0
0
= x
6
1
1
= x
6
2
2
= x
6
3
3
= x
6
4
4
= x
6
5
5
= x
0 . 1
6
= x
k
f
0 . 0 065934 . 0 107143 . 0 133333 . 0
15 . 0
160428 . 0 166667 . 0
While the given formula involves values of the function over three consecutive inter
vals, the specifed interval length
6
1
= h results in a pair of such consecutive intervals,
] , , , [
3 2 1 0
x x x x and ] , , , [
6 5 4 3
x x x x . Therefore, the integral will be approximated by
the expression
( ) ( ) { } 117741 . 0 3 3 3 3
8
3
6 5 4 3 3 2 1 0
= + + + + + + + = f f f f f f f f
h
I
10. (a) The value of the integral ( )dx x e
x
∫
−
1
0
) cos( is
[ ] [ ] 876811 . 0 ) 0 sin( ) 1 sin(
0 1
= − − − e e
(b) Table of values of the integrand ) cos( ) ( x e x f
x
− =
for values at the
equidistant points: 0 . 1 ) 125 . 0 ( 0 . 0 = x :
) 177980 . 2 , 0 . 1 ( , ) 757878 . 1 , 875 . 0 ( , ) 385311 . 1 , 75 . 0 (
) 057283 . 1 , 625 . 0 ( , ) 771139 . 0 , 5 . 0 (
) 524484 . 0 , 375 . 0 ( ), 315113 . 0 , 25 . 0 ( , ) 140951 . 0 , 125 . 0 ( , ) 0 . 0 , 0 . 0 (
African Virtual University 129
With the aid of the extended trapezoidal rule one fnds:
880144 . 0 ) 125 . 0 ( , 890138 . 0 ) 25 . 0 ( = = T T
(c) Application of Romberg integration on the two Trapezoidal values obtained
above gives
[ ] 876813 . 0 ) 25 . 0 ( ) 125 . 0 (
3
1
) 125 . 0 ( ] 125 . 0 , 25 . 0 [ = − + = T T T R
African Virtual University 130
XVI. References
G. Stephenson, 1973, Mathematical Methods for Science Students – Second Edition,
Pearson Education Ltd.
Brian Bradie, A friendly Introduction to Numerical Analysis, Pearson Education
International.
A.C. Bajpai, I.M. Calus and J.A. Fairley, 1975, Numerical Methods for Engineers
and Scientists, Taylor & Francis Ltd., London.
Burden and Faires, 1985, Numerical Analysis – Fifth Edition, PWS – KENT Pu
blishing Company.
Fox, L. and Mayers, D.F., 1958, Computing Methods for Scientists and Engineers,
 Oxford University Press, London.
Kendall E. Atkinson, 1987, An Introduction to Numerical Analysis, John Wiley &
Sons.
M.K. Jain, S.R.K. Iyengar & R.K. Jain, 1993, Numerical Methods – Problems and
Solutions, Wiley Eastern Ltd.
Walter Jennings, 1964. First Course in Numerical Methods, Collier – Macmillan
Ltd.
Lay, 2002, Linear Algebra and its Applications – Third Edition, Addison Wesley.
African Virtual University 131
XVII. Author of the Module
Dr. Ralph W.P. Masenge is Professor of Mathematics in the Faculty of Science,
Technology and Environmental Studies at the Open University of Tanzania. A graduate
in Mathematics, Physics and Astronomy from the Bavarian University of Wuerzburg
in the Federal Republic of Germany in 1968, Professor Masenge obtained a Masters
degree in Mathematics from Oxford University in the United Kingdom in 1972 and
a Ph. D in Mathematics in 1986 from the University of Dar Es Salaam in Tanzania
through a sandwich program carried out at the Catholic University of Nijmegen in
the Netherlands.
For almost 33 years (May 1968 – October 2000) Professor Masenge was an acade
mic member of Staff in the Department of Mathematics at the University of Dar Es
Salaam during which time he climbed up the academic ladder from Tutorial Fellow
in 1968 to full Professor in 1990. From 1976 to 1982, Professor Masenge headed
the Department of Mathematics at the University of Dar Es Salaam. He also served
as Associate Dean in the Faculty of Science and was Acting Chief Administrative
Offcer of the University of Dar e salaam for one year (1995).
Born in 1940 at Maharo Village situated on the slopes of Africa’s tallest mountain,
The Killimanjaro, Professor Masenge retired in 2000 and left the services of the
University of Dar Es Salaam to join the Open University of Tanzania where he
now heads the Directorate of Research and Postgraduate Studies as well as being in
charge of a number of Mathematics Courses in Calculus, Mathematical Logic and
Numerical Analysis.
Professor Masenge is married and has four children. His main hobby is working on
his small banana and coconut farm at Mlalakuwa Village, situated some 13 km from
the City Centre on the outskirts of Dar Es Salaam, the commercial capital of the
United Republic of Tanzania.
African Virtual University
Notice
This document is published under the conditions of the Creative Commons http://en.wikipedia.org/wiki/Creative_Commons Attribution http://creativecommons.org/licenses/by/2.5/ License (abbreviated “ccby”), Version 2.5.
African Virtual University
Table of ConTenTs
I. II. Numerical Methods _________________________________________ 3 Prerequisite Course or Knowledge _____________________________ 3
III. Time ____________________________________________________ 3 IV. Materials _________________________________________________ 3 V. Module Rationale __________________________________________ 3
VI. Content __________________________________________________ 4 6.1 Overview ___________________________________________ 4 6.2 Outline _____________________________________________ 5 6.3 Graphic Organizer _____________________________________ 6
VII. General Objective(s) ________________________________________ 7 VIII. Specific Learning Activities ___________________________________ 8 IX. Teaching and Learning Activities ______________________________ 9 _ X. Learning Activities ________________________________________ 16 _
XI. Compiled List of all Key Concepts (Glossary) ___________________ 107 XII. Compiled List of Compulsory Readings _______________________ 113 XIII. Compiled List of Multimedia Resources ______________________ 114 _ XIV. Synthesis of the Module ___________________________________ 115 XV. Summative Evaluation ____________________________________ 116 _ XVI. References _____________________________________________ 130 XVII. Main Author of the Module _________________________________ 131
numerical Methods by Dr. difficult to solve analytically either because of the complex nature of the analytical solutions or because such solutions cannot be expressed in terms of combinations of known mathematical functions. Also. Time The total time for this module is 120 study hours. they will need a computer to gain full access to the core readings. Material Students should have access to the core readings specified later. Module Rationale A key attribute of mathematics is its applicability in problem solving. Unfortunately. III.African Virtual University I. IV. Additionally. celestial mechanics and in navigation. mathematical formulations (models) of most problems in science and engineering are. students should be able to install the computer software wxMaxima and use it to practice algebraic concepts. numerical integration and finding roots of functions. The history of the subject is full of evidence that the driving force in its early development was based in trying to solve problems in plane geometry. in general. In all such cases. The mathematics or science student is therefore expected to have a working knowledge of and ability to apply numerical methods in solving some basic mathematical problems such as interpolation. Prerequisite Courses or Knowledge Calculus 2 is prerequisite. V.P Masenge II. Figure 3: Surfing on the Internet is a key to e‑learning . Ralph W. numerical methods have to be resorted to.
Both linear and higher order polynomial interpolation methods.1 Overview First Learning Activity: Types and Causes of Errors The first learning activity aims at making the learner appreciate the need for numerical methods. g(x. y) = 0 . Figure 4: A Baobab Tree. Newton’s divided differences and finite difference interpolation techniques are presented. Specific attention is given to the Trapezoidal and Simpson’s rules and the application of Richardson’s extrapolation technique on both the Trapezoidal and Simpson’s rules in deriving Romberg integration schemes. based on Lagrange. Content 6. point out the sources and types of errors and mention some practical ways of reducing their cumulative effect on the numerical solution. Third Learning Activity: Numerical Integration The third learning activity looks at the problem of numerical integration. y) = 0 . It is also felt that this is the right moment to define the concept of a mathematical error. Number of roots equals number of twigs . Fourth Learning Activity: Roots of functions The fourth and final learning activity presents the root finding problem associated with solving the nonlinear equation f (x) = 0 and solving the coupled system of two nonlinear equations f (x.African Virtual University VI. The discussion is limited to Newton‑Cotes formulae. Second Learning Activity: Interpolation The second learning activity deals with the concept of interpolation.
The timings show the length of time the Learner is recommended to spend learning each of its components. Mathematics Module 3 is its prerequisite course. The timings shown are suitable for students following a unit level course allowing 35 hours per unit. 4: Roots of functions. taking and review for PreAssessment (4 hrs) Learning Activity No. (25 hrs) Bisection method Convergence of the bisection method The Regula Falsi or False Position method Secant method NewtonRaphson’s method Solving a coupled system of two nonlinear equations Fixed point iterations . [Students following a module level course should allow 120 hours for the complete module].3: Numerical integration (25 hrs) Newton Cote’s formulae Derivation of the trapezoidal and Simpson’s rules Romberg integration Gaussian quadrature formulae Learning Activity No. The following is a detailed outline of the contents of each Learning Activity.2: Interpolation (35 hrs) Linear interpolation Lagrangian interpolation Newton’s divided differences Finite difference operators Finite difference tables Finite difference interpolation polynomials Learning Activity No.2 Outline: Syllabus (include specific timings here if needed).1: Types and Causes of Errors (25 hrs) Types and sources of errors Need for numerical methods Error sources and types Strategies for reducing errors Learning Activity No.African Virtual University 6. This is a two unit course offered at Level 2 with priority rating A. Preperation.
3 Graphic Organiser Figure 5: Graphic Organizer .African Virtual University Preperation and taking Summative Assessment (6 hrs) 6.
University of Dar Es Salaam . Specifically you will be able to: (1) Distinguish between numerical and analytical methods/solutions (2) Appreciate the need for learning and applying numerical methods (3) Identify the main sources of errors and take measures to eliminate or reduce such errors (4) Derive and apply a number of interpolation methods (5) Derive and apply a number of numerical integration methods (6) Derive and apply a number of numerical methods for finding roots of function (7) Solve a coupled system of two nonlinear equations in two variables. General objective(s) At the end of this module: You will be equipped with knowledge and understanding of the properties of elementary functions and their various applications necessary to confidently teach these subjects at the secondary school level.African Virtual University VII. You will have secure knowledge of the related contents of school mathematics to enable you confidently teach these subjects at the secondary school level. You will acquire knowledge of and the ability to apply available ICT to improve the teaching and learning of school mathematics. Figure 6: Internet Dish at the AVULearning Center.
understand and apply both the Secant and the Regula Falsi methods Derive. Simpson’s rule and any other NewtonCotes type numerical integration formula Derive. understand and apply the Newton Raphson method Derive. understand and apply Romberg’s numerical integration scheme based on either the Trapezoidal or Simpson’s rule. We are stating them here in advance with a view to enable the learner have a global overview of what lies ahead in terms of what s/he will be able to do on completion of the module. Each learning activity has a set of specific learning objectives. understand and apply the Newton’s method on a pair of nonlinear simultaneous equations. backward. central and mean difference operators Construct tables of differences for a given function or given data Derive and apply Newton’s forward. Newton’s backward. and Stirling’s central difference interpolation polynomials. understand and apply the Trapezoidal rule. the learner will be able to: S/N Learning Activity Types and sources of errors Specific Learning Objectives 1 • • • • List the chief sources of computational errors and the practical steps to be taken to eliminate or reduce their cumulative effect on the numerical solution Appreciate the difference between the size (accuracy) and the seriousness (precision) of an error. Derive and apply the bisection method Prove convergence of the bisection method Derive. Understand and apply linear interpolation on a given table of function values Estimate the error in linear interpolation for a known smooth function Explain why numerical methods are essential in solving mathematical problems Write down and apply the Lagrange interpolation polynomial for equally spaced data Write down and apply Newton’s interpolation based on divided differences Define and manipulate the shift. At the end of the module. specific learning objectives As already mentioned in the Module Outline given in Section VI.African Virtual University VIII. Derive. this is a two units module and its contents will be presented using four learning activities. forward. 2 Interpolation • • • • • • 3 Numerical Integration Roots of functions • • • • • • • 4 .
038462 ⎩ 3. Preassessment If x is an exact measurement of a certain quantity and x0 is its approximation. Teaching and learning activities 9. One valid reason why the function ⎧1 if ⎪ f (x) = ⎨ ⎪0 if ⎩ x >0 x=0 .299462 ⎪ ⎨ ⎪ (c) 0. x0 − x x − x0 x − x0 x − x0 The absolute error in approximating the exact quantity x = 104 by the approximate value x0 = 107 is given by ⎧(a) 4 ⎪ (b) 3 ⎪ ⎨ ⎪ (c) 7 ⎪(d)104 ⎩ The relative error in the approximation x0 given in Question 1 is ⎧(a) 0.African Virtual University IX.002885 ⎪(d) 0.1 1.028846 ⎪ (b) 0. the concept of error in the approximation is defined by ⎧(a) ⎪ (b) ⎪ ⎨ ⎪ (c) ⎪(d) ⎩ 2.
The truncated cubic Maclaurin series expansion of the function f (x) = 1 + x is (a) :1 − x x 2 3x 3 + − 2 4 8 2 x x 3x 3 (b) :1 + − + 2 4 8 2 x x x3 (c) :1 − + − 2 8 16 x x2 x3 (d) :1 + − + 2 8 16 . The continuous function x 3 − 3x − 3 must have a zero (root) at some point in the interval 2 < x < 3 because ⎧(a) f (2) f (3) = 0 ⎪ (b) f (2) f (3) < 0 ⎪ ⎨ f (2) > 0 f (3) < 0 ⎪ (c) ⎪(d) f (2) = 0 f (3) = 0 ⎩ ⎧(a) (1 + ln(x)) x x ⎪ (b) xx ⎪ ⎨ x x ln(x) ⎪ (c) ⎪(d) (1 − ln(x))x x ⎩ 5. The first derivative of the function y = x x is 6.African Virtual University 0 is not continuous at x = 0 is lim ⎧(a) x → 0 f (x) = f (0) ⎪ (b) lim f (x) = 0 ⎪ x→ 0 ⎨ (c) lim f (x) = 1 ⎪ x→ 0 ⎪(d) lim f (x) ≠ f (0) ⎩ x→ 0 4.
Working throughout with six decimal places accuracy. Working under the same conditions.African Virtual University 7.416560 1.146083 ⎪ ⎨ ⎪ (c) :1.146185 1.25 is ⎧(a) ⎪ (b) ⎪ ⎨ ⎪ (c) ⎪(d) ⎩ 1.146580 10. the approximate value of the integral given in Question 8 using Simpson’s rule is found to be ⎧(a) :1. The general antiderivative of the function f (x) = ln(x) is given by ⎧(a) x ln(x) + C ⎪ (b) ln(x) − x + C ⎪ ⎨ ⎪ (c) x ln(x) − x + C ⎪(d) x ln(x) + x + C ⎩ 8.416039 ⎪ (b) :1.146581 1.146038 ⎪(d) :1.146580 ⎩ .164581 9.146038 1.146850 1. The value of the integral ∫ 2 3 1 ⎧(a) ⎪ (b) 1+ x ⎪ dx is ⎨ x 2 + 2x + 5 ⎪ (c) ⎪(d) ⎩ 1.145681 1. the approximate value of ∫ 2 3 2 1 x + 2x + 5 1+ x dx using the Trapezoidal rule with h = 0.
y0 ) and Q(x1 . If the 3rd and 13th terms of an arithmetic sequence of numbers are 7 and 27 .axis is ⎨ ⎪ (c) x0 y1 − x1 y0 ⎪ y1 − y0 ⎪ y1 − y0 ⎪(d) ⎪ x0 y1 − x1 y0 ⎩ . y1 ) . then the 52nd element of the sequence is ⎧(a) ⎪ (b) ⎪ ⎨ ⎪ (c) ⎪(d) ⎩ 103 105 107 106 3(1 + xn ) xn 12. Given two points P (x0 . the xcoordinate of the point where the x1 y0 − x0 y1 ⎧ ⎪(a) y1 − y0 ⎪ y1 − y0 ⎪ (b) ⎪ x1 y0 − x0 y1 ⎪ secant line AB cuts the x . Starting with x0 = 2 .130731 ⎪(d) : 2. the value of x4 using the iteration formula xn + 1 = is ⎧(a) : 2. respectively.104255 ⎪ (b) : 2.103731 ⎪ ⎨ ⎪ (c) : 2.103713 ⎩ 13.African Virtual University 11.
⎪ (c) ⎪(d) ⎩ x3 x3 x3 x3 after the third .4.183) and (0.115 = 2.3 is found to be ⎧(a) ⎪ (b) ⎪ ⎨ ⎪ (c) ⎪(d) ⎩ y = 1.225 ⎧(a) ⎪ (b) ⎪ 3 the function x − 3x − 3 gives the value ⎨ bisection process. f (x0 )) on the curve of a differentiable function y = f (x) . the approximate value of y at x = 0.2.342) . is a reasonable approximation of c . The Bisection method is based on the principle that a continuous function which is positive at one point x = a and negative at another point x = b has a root (zero) at some point x = c in the interval a < c < b and that the point x = with the two points a = 2.5262 y = 1. Given a point P (x0 .6225 y = 1.125 = 2.2265 y = 1.b] .2625 15. .axis is (a) : x0 − f (x0 ) f ' (x0 ) f (x ) (b) : x0 + ' 0 f (x0 ) f ' (x0 ) (c) : x0 − f (x0 ) (d) : x0 + f ' (x0 ) f (x0 ) 16. which bisects the interval [a.1. By using the straight line which joins the two points to approximate the curve of the function in the given interval.African Virtual University 14. the x coordinate of the point where the tangent at P cuts the x . Starting a+b 2 b = 3 .215 = 2.1. application of the bisection method on = 2. The curve of a function y = f (x) passes through two points whose coordinates are (0.
y0 = 1.1.African Virtual University 17. Starting with x0 = 1.130836 = 2. y3 = 1..322875.. 2.224745.. x 2 − y2 = 1 intersect each other and which lies in the first quax = 1.224745 x = 1.. y = 1.2 .561139 ⎧(a) ⎪ (b) ⎪ ⎨ ⎪ (c) ⎪(d) ⎩ 19.1. y3 = 1. 2.562050 = 1.562050.. y = 1. y3 = 1.233875. yn + 1 = xn 2 − 1 n = 0.227445 x = 1. The coordinates of the point where the curves representing the functions drant are x 2 + y2 = 4 . The Newton Raphson method for approximating a root of a function f (x) uses the iteration formula xn + 1 = xn − f (xn ) f ' (xn ) n = 0.526050.322875 = 1.581139. the values x3 and y3 obtained using the pair formulae xn + 1 = 4 − yn 2 .103386 = 2.5 . 242745..511839. y = 1. are ⎧(a) ⎪ (b) ⎪ ⎨ ⎪ (c) ⎪(d) ⎩ x3 x3 x3 x3 = 1.301836 = 2. then application of the NewtonRaphson method on the function gives the value of x2 as: ⎧(a) ⎪ (b) ⎪ ⎨ ⎪ (c) ⎪(d) ⎩ x2 x2 x2 x2 = 2.562050 . y3 = 1. If x0 = 2 is an approximation of one of the roots of the function f (x) = x 3 − 3x − 3 .322875 = 1.561139 x = 1.103836 18. y = 1.
Here. one should work through the relevant section in your Higher Level Mathmatics books. 17.18 and 19 relate to the concept of iterations and simulatneous equations. 15. (d) 11. . The same tip holds if you experience difficulties in solving Questions 8. (b) 3. With an above average score (61 – 90) the learner should confidently embark on the module in the knowledge that he/she has the required background knowledge to start and successfully complete it. If you fail to solve any of them then work through the relevant Sections of the prerequisite Module (Mathematics Module 3). Questions 15. (a) 6. 14. In case one faces some problems in solving any of these. (d) 8. A score in the range 41 – 60 is average. (d) 7. differentiation and the antiderivative. Questions 4. An average score may mean you can start the module but with frequent cross reference to some prerequisite materials. 16. giving a maximum score of 90 marks. Each correct solution has 5 marks. Questions 12. simply study carefully the given formulae and apply them faithfully. (b) (b) (c) (d) (a) (c) (d) (b) (c) Pedagogical Comment For Learners The learner’s confidence to embark on this module will greatly be enhanced by solving these preassessment questions. (c) 2.13.10 and 11 on integration. (c) 10. 13.5.9.2 are on errors and 3 is on continuity. continuity. (c) 9. If you have problems in solving them you are advised to look up the definitions given in the Module Glosary. A below average score (0 – 40) probably implies that you need a thorough go at the relevant prerequisite material before starting the module.6 and 7 are on the concepts of limits. 19.17. 12. Questions 1. (d) 4.African Virtual University Solutions 1. 18. (b) 5. 16 and 17 are on linear approximation of a function.16.
search for any key words in the text. We conclude the activity by defining the concept of errors in computational mathematics.com Students should search for the entry covering the unit title. This is followed by discussion of some typical mathematical problems specifically selected to convince the learner why numerical methods are needed.African Virtual University X. We begin by making a distinction between analytic and numerical solutions. . pointing out their main causes.wolfram. Specific Learning objectives At the end of this learning activity the learner will be able to: • Define the concept of errors in computational mathematics • Distinguish between absolute and relative errors and appropriately relate them to the concepts of accuracy and precision • List the chief sources of computational errors and the practical steps to be taken to eliminate or reduce their cumulative effect on the numerical solution • Appreciate the difference between the size (accuracy) and the seriousness (precision) of an error.07) http://mathworld. • Understand and apply linear interpolation on a given table of function values • Estimate the error in linear interpolation for a known smooth function List of required readings Wikipedia: Numerical Methods/Errors Introduction List of relevant useful links Wolfram MathWorld (visited 03.04. Also. learning activities LEARNING ACTIVITY # 1 Types and Sources of Errors Summary In this learning activity we discuss three important introductory topics. types and presenting practical ways of eliminating or reducing their effect on numerical solutions. Mathworld gives a detailed reference in all cases.
07) http://wwwhistory.org/wiki As with mathworld. . truncation and rounding errors: Different types of errors caused by different sources of error. they can be easier to read. Absolute error: The error without consideration of the sign (positive or negative). MacTutor History of Mathematics (visited 03.standrews. Initial.04.uk/Indexes The MacTutor Archive is the most comprehensive history of mathematics on the internet.ac. Key Words [Full defintions are given in the text] Error in an approximation: The difference between the exact and the approximate value.wikipedia. Wikipedia generally gives shorter and less complete entries.mcs. students should search for the entry covering the unit title. search for any key words in the text. Also. However. discretization.African Virtual University Wikipedia (visited 03.03. This gives a helpful overview of the importance and context of the topic being studied.07) http://en. Students should search for their unit title and read the history of the subject. Relative error: The ratio between the absolute error and the exact quantity.
also known as numerical solution. Numerical Methods and Errors. a numerical method may result in an exact solution. To answer the questions on errors we define the concept of an error and list a number of sources of errors. Analytic Methods. (1) What is a numerical solution and how does such a solution differ from an exact (true) or analytical solution? (2) Why should one learn numerical methods? Are numerical methods needed? (3) What are errors in the context of mathematics? What are the main sources of computational errors? How can one eliminate errors or reduce their effect on numerical solutions? We begin the activity by explaining the difference between an analytic and a numerical solution. In some very rare cases. in most cases. In the sequel we also suggest for each type and source of error practical steps to be taken to reduce the error and hence its impact on numerical solution. also known as analytic solution. (a) Analytic versus numerical methods What is a numerical solution and how does such a solution differ from an exact (true) or analytical solution? An analytic method for solving a given mathematical problem is any method based on rigorous mathematical analysis and whose application leads to the true (exact) solution. can only lead to an approximate (nonexact) solution.African Virtual University Learning Activity 1: Types and Sources of Errors Introduction This first learning activity of the module is intended to provide the learner with answers to the following important questions. A numerical method for solving a given mathematical problem is any method based on rigorous mathematical analysis whose application. questions raised by many students taking a numerical methods course for the first time. In order to establish the need for numerical methods we discuss a number of mathematical problems specifically selected with a view to convince the learner that there is a real need for learning numerical methods either because analytical solutions cannot be found or they are too complex to be of any practical use. .
.. 2. 2 This gives the analytic solutions x1.. . the difference between analytical and numerical solutions can be summed up by the statement: Analytical solutions are exact while numerical methods are only approximate. h = x2 − x1 = x1 − x0 (i) The trapezoidal rule gives exact values of the integral function f ( x ) = ax + b . the iteration formula (numerical method) xn + 1 = 5xn − 3.1. x1.. ∫ x2 x1 x0 f ( x ) dx for any linear (ii) Simpson’s rule gives exact values of the integral function : f ( x) = ax + bx + cx + d 3 2 ∫ x0 f ( x ) dx for any cubic . 2 = −b ± b2 − 4ac 2a 5 ± 13 .5 may also be applied to approximate one of the two solutions of the given quadratic equation.1 The exact solutions of the nonlinear equation x 2 − 5x + 3 = 0 can be obtained using the well known quadratic formula (analytic method) .African Virtual University Example 1. In general. 0 1 0 1 2 h h = x1 − x0 Simpson’s rule: Verify that: x0 h ∫ f ( x)dx = 3 [f ( x ) + 4 f ( x ) + f ( x )]. 2 = On the other hand. This method can only give an approximate numerical solution. DO THIS Given the numerical integration formulas x1 Trapezoidal rule: x2 x0 ∫ f ( x)dx = 2 [f ( x ) + f ( x )]. x0 = 4. n = 0.
For some problems the analytical solution may not be known.5 1.0 1. is perfectly defined but the anti‑derivative of the integrand f ( x) = e x cannot be expressed using known mathematical functions.0 1.1180 1. In some cases. A typical examples is given by the following cases.75 1. This complicated result makes the 2 evaluation of a typical associated definite integral carry out with any meaningful degree of accuracy.25 1. one finds the general anti‑ derivative 3 1 ⎛ x2 + 2x + 4 ⎞ −1 ⎛ x + 1 ⎞ ⎟+C F ( x) = tan ⎜ ⎟ + ln⎜ 2 ⎜ ⎟ 12 3 ⎠ 24 ⎜ x − 4 x − 4 ⎟ ⎝ ⎝ ⎠ where C is an arbitrary constant of integration. In other words. We need to learn numerical methods for the following three main reasons. 8 − x3 After some tedious manipulations involving factorization of the denominator followed by application of the method of partial fractions.African Virtual University 0 (b) Need for numerical methods Why should one learn numerical methods? Are numerical methods needed? Because of the above distinction between analytic and numerical solutions one can easily be tempted to conclude that one should only use analytic methods in solving mathematical problems.1180 1.0000 1. x f (x) 1. A typical problem is that of finding an anti‑derivative of the function f ( x ) = 1 . ∫8− x 1 dx 3 almost impossible to . An integral. it may be possible to find a mathematical expression for the analytical solution of a given problem. Such a conclusion is misguided.3229 2. 1. However. 2 2 0 3. there is no need to learn numerical methods because they can only give approximate solutions.4142 1 2. the expression may be computationally too complicated to handle numerically. such as ∫ e x dx .
one replaces it with the approximate value X * in the denominator of the expression for the relative and percentage errors. The absolute error in X * is defined by X − X * The error in X * is defined by X − X . absolute errors. initial errors. This includes the definitions of errors. Assumption Let X * be an approximation to an exact (true) quantity X . . (ii) By factorizing 8 − x 3 = ( 2 − x )( x 2 + 2 x + 4 ) and applying the method of partial fractions derive the expression for F (x) as an antiderivative of f (x) . For ease of reference we list them here. * The percentage error in X * is defined by 100 X −X X * % Since the exact (true) value X is normally not known. relative errors.African Virtual University DO THIS (i) Verify that dF dx = f ( x ) (using the function F in example 3 above). Precision and Accuracy Measurements and calculations can be characterized with regard to their accuracy and precision. (c) Errors What are errors in the context of mathematics? What are the main sources of computational errors? How can one eliminate errors or reduce their effect on numerical solutions? In the key words section you can find definitions of the key concepts and stated the key theorems and principles relevant to the topic of numerical methods. Then. discretization errors. truncation errors and rounding errors.
(i) Initial errors Any mathematical problem meriting to be solved numerically involves some initial data. The absolute error is therefore a measure of the precision of an approximation. numerical methods for solving such problems approximate the unknown continuous solution f (x) by a sequence {f ( x n )}of approximate values of the solution at a discrete set of points { n } in the domain of the solution function f (x) . Here. Such data may be in the form of coefficients in a mathematical expression or entries in a matrix. uncertainties in the initial data can have devastating effect on the final numerical solution to the problem. the continuous x function f ( x) = x + e− x is the solution of the initial value problem y / + y = 1 + x . (d) Types and Sources of Errors We now list the sources and types of errors and briefly discuss methods of eliminating or reducing such errors so that the numerical solution we get is not seriously affected by them to the extent of rendering it meaningless. what counts is not only the magnitude of the deviation X − X * but its size relative to the true value X . Accuracy is therefore measured by the relative error X −X X * .African Virtual University Precision refers to how big or how small the absolute error X − X * is. For example. (ii) Discretization error Most of the literature on the subject of computational errors does not make a distinction between discretization and truncation errors. In this presentation we separate the two because truncation errors are special types of discretization errors. In some problems. Accuracy refers to how closely the approximation X * agrees with the true value X . y (0) = 1 . If this initial data is not exact. then the deviations from their respective true values are called initial errors. The true (exact) solutions of some mathematical problems are continuous functions y = f (x) of their respective independent variables. In almost all cases. the reason being that the two types of errors are almost inseparable.
The error caused though this unavoidable termination of an infinite process is called a truncation error. if we multiply two numbers. Unfortunately some calculating devices may not be able to display all twelve decimal digits. The x0 = 0. Since such infinite processes cannot be carried out indefinitely. error resulting from such a discretization process is called discretization error. this is the case with all convergent iteration methods and convergent infinite series. (i) How to reduce initial error Initial errors can have a devastating effect on numerical solutions. x x  y 1. Shaum Outline Series.. Such errors are essentially algorithmic errors and one can predict the extent of the error that will occur in the method. 1968 page 342 involving the solution of the following two simultaneous linear equations. yn = (1 − h) yn−1 + (1 + xn−1 )h.00001 y = = 1 0 . the solution obtained using some numerical methods may involve infinite processes. one is forced to stop (truncate) the process and hence accept an approximate solution. For instance... Numerical Analysis. which occurs because some infinite process is stopped prematurely (truncated) to a fewer number of terms or iterations in the process. The term truncation error refers to the error in a method. h being a constant distance between two consecutive discrete values of the variable x .3. (iv) Rounding error Rounding errors are errors introduced during numerical calculations due to the inability of calculating devices to perform exact arithmetic.2. The error so introduced is called a rounding error. For example. Specifically.African Virtual University A typical numerical method for solving this problem is given by the recurrence relation y 0 = 1. (iii) Truncation error Truncation errors are special types of discretization errors. We illustrate a typical case involving an example taken from Francis Sheid. each with six decimal digits. . n = 1. (e) Methods of reducing errors In the spirit of “prevention is better than cure” we shall attempt in this section to give practical suggestions of ways to eliminate or reduce the impact of various types of computational errors that are encountered in resorting to numerical methods. In such cases one is forced to work with fewer digits thereby necessitating dropping some of the (less significant) digits on the right of the product. the product will have twelve decimal digits.
785398 . to eliminate initial errors is by ensuring that all data given with or computed for use in solving a problem is as accurate as is humanly possible. correct to six decimal places is tan −1 (1) = 0. y = 100.000 .999 . The exact (analytical) value of the integral. the resulting system of equations x x  y 0.00001⎥ ⎣ ⎦ to − 0 .99999 y = = 1 0 has the drastically changed exact (analytical) solution x = − 99 . the only way to reducing or if possible. First we evaluate the integrand f ( x) = 1+ x2 get 1 . Thus.001 . Let us apply the trapezoidal method and Simpson’s rule using an interval length at the relevant points and h = 0 . the set of initial data consists of the elements of the coefficient matrix A = and the right hand side vector b = ⎛ 1 ⎞ ⎜ .African Virtual University The true (analytical) solution is x = 100.99999 while all other data items remain unchanged. Consider the problem of evaluating the definite integral: ∫ 1+ x 0 1 dx 2 . if the entry − 1 .000 This somewhat startling result demonstrates how a small change in the initial data can cause disproportionately large changes in the solution of some problems. (ii) How to reduce discretization errors Different numerical methods for approximating the solution of a given mathematical problem can result in numerical solutions with very different degrees of accuracy due to the magnitudes of their respective discretization errors. y = −100.⎟ ⎜0⎟ ⎝ ⎠ However.25 .00001 in the matrix A is changed −1 ⎤ ⎡1 ⎢1 − 1. In this example.
75 4 1 0. The size of the truncation error will therefore depend on the particular infinite process (numerical method) being used an on how far we are prepared to carry on with the infinite process. (iii) How to reduce truncation errors Truncation errors are caused by the unavoidable need to stop a convergent infinite process in efforts to get a solution.000000 1 0 . while the solution obtained using the trapezoidal rule is correct to only two decimal places.500000 0. This significant difference in the accuracy of the two numerical solutions is caused by the differences in the discretization errors of the two numerical methods. the solution obtained using Simpson’s rule is correct to four decimal places. . However. Simpson’s rule h {f ( x0 ) + 4[f ( x1 ) + f ( x3 )]+ 2 f ( x2 ) + f ( x4 )} leads to 3 the numerical solution 0.5 0.782794 .941176 0. discretization errors cannot be avoided. one can reduce them substantially by being careful in selecting a numerical method whose discretization error is known a priori to be relatively small.800000 3 0 .African Virtual University i xi f ( xi ) 0 0 1.785392. In general. Simpson’s rule has a smaller discretization error than the trapezoidal rule. One observes that.640000 The trapezoidal rule ⎫ h⎧ ⎨ f ( x0 ) + 2[f ( x1 ) + f ( x2 ) + f ( x3 )] + f ( x4 )⎬ 2⎩ ⎭ gives the numerical solution 0. The truncation error can be reduced either by (a) Choosing a numerical method with a small truncation error or (b) Carrying out the infinite process sufficiently far.25 2 0.
381966 These results demonstrate that in stopping the infinite process (iteration) after the third iteration. Method Bisection Initial Values x2 0. the truncation error of the Newton Raphson method is much smaller than that of the bisection method. . one gets the following sequence of approximations for each method. A number of iterative methods exist for approximating such a root.2 The continuous function f ( x) = x 2 − 3 x + 1 has a root which lies in the interval 0 < x < 1 (Why?).250000 0.381966 . 2 f (xn ) f / (xn ) . n The NewtonRaphson method x= x− If one performs only three iterations (truncation after three iterations) with each method using the starting values x0 = 0 and x1 = 1 for the bisection method and x1 = 0 for the NewtonRaphson method. provided f / (x ) ≠ 0 .500000 0.333333 x0 = 0 Newton Raphson x1 = 1 x1 = 0 x3 0.African Virtual University Example 1. Using the quadratic formula. the exact value of the root correct to six decimal places is ρ = 0.375000 0. provided f (xn ) f (xn − 1 ) < 0 .380952 x4 0. Here we consider two such methods: The bisection method xn + 1 = xn − xn − 1 .
2. 7. In the decimal system of real numbers. 3. • How many Significant Figures are in a given Number The number of significant figures in a given number is found using the following rule: Rule 1: The number of significant figures in a purely integer number (with no decimal digits) is obtained by counting. the words “figure” and “digit” are synonyms.00004507000 A number can be viewed as a measure of the size or magnitude of some real or imaginary quantity. They are used interchangeably to mean any one of the ten numerals in the set {0. How many more iterations did this require? (iv) How to Reduce Rounding Errors Before we discuss this important last task in our learning activity we shall first introduce a few terms that will frequently be mentioned and used in the process. Zeros at the rightmost end of a number are counted as significant only if the number contains a decimal point. • What are Figures or Digits In computational mathematics. 1. 4. 8. Intuitively we know that the leftmost digit 7 in the number N above is more significant than the rightmost digit 7. All zero digits positioned between nonzero digits are significant. The position of each digit in the string of digits has direct bearing on the importance or significance of that digit (figure) in the overall measure of the size or magnitude of the quantity the number represents. a number N is a string or an ordered sequence of figures or digits A typical example is the number N = 00073920600365. 4. . starting with the leftmost nonzero digit and ending with the rightmost nonzero digit. • Which digits in a number are Significant? The following rules apply in deciding which digits or figures in a given number are significant.African Virtual University DO THIS Continue applying the bisect method on the above example until the solution is correct to three decimal places. 5. 1. 3. Nonzero integers are always significant figures. 2. Any zeros on the leftmost part of a number are not significant. 9}. 6.
2 = 7.African Virtual University Example 1.3 + 1. has 9 significant figures NOTE: All zero digits at the end of a decimal number are significant. starting with the leftmost nonzero digit.2 = 8.35. has 6 significant figures Rule 2: The number of significant figures in a number having a decimal part is obtained by counting all the digits. Example 1. 4.4 + 1.48 + 4.07 If we neglect the second decimal digit from each term and form their sum we find the approximate sum S1 = 2.5 + 4. The exact sum is S = 2.5 Find the sum of the numbers 2. One obvious method of dealing with the problem of rounding errors is to work with the maximum allowable accuracy on our calculating device at each stage in our calculations.4 + 4.00213 6.48.3 The number The number 541500409 002507030 has 9 significant figures.00213000 has 6 significant figures.24 using a calculating device that can only handle numbers with two significant figures. Example 1.4 The number The number 6.17 A better approximation of S under the same limitations is S 2 = 2.1 . 1.35 + 1.24 = 8. (iv) How to Reduce Rounding Errors Armed with the concepts of digits/figures and significant figures in a number we can now comfortably discuss ways of reducing rounding errors.9 The absolute error in S1 is: S − S 1 = 0 .
3.24 was rounded to 4. the term 1.6 The sum S1 has been calculated using terms obtained from the original numbers by rounding off (chopping) the third decimal digit from each term.48 4. Each term has been obtained from its corresponding threedigit term by rounding.African Virtual University The absolute error in S 2 is: S − S 2 = 0 .35 was rounded to 2. the rounding this time is different. The learner will soon know how to round numbers What it means to round a number To round a number to a fixed number of figures or digits simply means leaving out (dropping) all digits on the right hand side of the number beyond a certain position.48.35 and 1. then one speaks of “rounding off or chopping the number”.4 and the term 4. This practice (or as yet unknown rule for rounding numbers) seems to have some significant advantage over rounding off manifested by the above example in which S 2 is more accurate than S1 . the last retained digit (the first decimal place) has not been adjusted in the process of rounding. not all the three terms have been rounded off! The term The term The term 2. Note The sum S 2 has also been obtained through rounding. In each case.24 has been rounded to has been rounded to has been rounded to 2.48 was rounded to 1. The third digit 4.4 1.03 This error is significantly smaller than that in S1 .35 1. Example 1.2. The immediate question expected to be raised by the learner is “How did one arrive at the two digit terms in the sum S 2 ?” The answer to the above question is simple.2 We observe that in rounding each of the first two terms 2.24 has simply been rounded off. Here. However. If a number is rounded simply by dropping all digits beyond a certain position on the right hand side of the number without making any adjustments to the last retained digit. the digit occupying the second decimal position has been dropped but the digit occupying the first decimal position has been adjusted by increasing it by one (unity). The term 2.5 4. .
450 8. then (i) The digit in position ( n ) is increased by 1 if it is an odd number (1.361 8.8) .6 0.056 0.3.0557 0.65 0. (c) If the digit in position ( n + 1 ) is less than 5 then the digit in position ( n ) is left unchanged.0 8. the rejection of digits beyond some predetermined position ( n ) is accompanied by making adjustments to the digit retained in position (n1).349 2.3 2.5.4 8.9) .0554 Rounded to 2 Significant figures 8.6 2. (ii) The digit in position ( n ) is retained unchanged if it is an even number (0. (a) If the digit in position ( n + 1 ) is greater than 5 then the digit in position ( n ) is increased by 1. The decision to retain or increase by 1 the digit occupying position (n1) is governed by the following rules.6.050 8. The adjustment involves either leaving the digit in position ( n ) unchanged or increasing it by one (unity).2.4 8.4.055 Rule Used (a) (b) (d) (i) (d) (ii) (d) (ii) (c) (d) (i) (d) (ii) (a) (b) . (d) If the digit in position ( n + 1 ) is 5 and all other digits to the right of position ( n + 1 ) zero.4 8.55 2. (b) If the digit in position ( n + 1 ) is 5 and at least one other digit to its right is non zero then the digit in position ( n ) is increased by 1.African Virtual University 0 Rules for Rounding Numbers In order to reduce the error in rounding numbers.4 8.350 8.7 Rounding a given number correct to two significant figures S/N 1 2 3 4 5 6 7 8 9 10 Number 8.7.351 8. Example1.
(c) Approximate value of X using three digit rounding arithmetic. 2. (b) Approximate value of X using three digit chopping arithmetic (rounding without making any adjustments).206 3.0004500 (b) Round each of the following numbers correct to five significant figures.905 (b) Round the values on the right hand side of each equation to two significant figures and then find the exact solution of the resulting system of linear equation. Questions 1. (i) 0123. . Given the quantity X = ⎜ + ⎛1 3 ⎞ 3 .395 (ii) 0123. (a) How many significant figures are in each of the following numbers: (i) 00001000020000 (ii) 10000200003004 (iii) 000123. (d) Calculate the absolute errors and percentage errors in the approximations obtained in parts (b) and (c).African Virtual University Formative Evaluation: Students should work through this exercise carefully writing full solutions for each problem.075 16 . (a) Using the method of substitution find the exact solution of the linear system of equations 5x 7x + + 7y 10 y = = 12 .205 (iii) 0123. They should check their work thoroughly using the solutions provided. (c) Use the solutions obtained from the two systems of equations to explain why initial errors need to be avoided as much as possible. perform the following calculations: ⎟− ⎝ 3 11 ⎠ 20 (a) Find the exact value of X correct to five significant figures.
i = 1. The truncation error E (x) in linearly interpolating a function f (x) between two points x0 and x1 . with x1 = x0 + h . (b) If a = 0 and Solutions b = 1 . 5.40 123. 2. (b) If f ( x) = sin( x) determine the value of h for which the truncation error will always be less than 0 .African Virtual University 4. y = 0 . 1 ( x − x0 )( x − x1 ) f // (ξ ) 2 h2 8 (a) Using the second derivative test.2.20 123. (c) Initial errors must be avoided because the solutions of some problems may be very sensitive to relatively small initial errors. x1 ) . f ( xi − 2 ) f ( xi −1 ) < 0 (a) Prove by mathematical induction that the error in the i th iterate xi is given by Ei = b− a 2i .3. (b) x = 1 ...415 . a ≤ x ≤ b the bisection method for approximating ρ uses the iteration formula x i − 2 + x i −1 2 xi = . how many bisection iterations will be needed to obtain an approximation with an error not greater than 10 − 3 ? 1.. where . is given by E ( x) = where ξ is some point in the interval I =: ( x0 . show that Max E ( x ) = M = Max f (x) // x ∈I x∈ I M . (a) (i) (ii) (iii) 6 14 10 (b) (i) (ii) (iii) 123. Assuming that the function f (x) has a single root ρ lying inside the closed interval..21 . x −1 = a . y = 1 . x0 = b . (a) x = 2.01 .
respectively.456 X − X b = 0 .00006 Percentage errors ⎛ X − Xb ⎜ ⎜ X ⎝ ⎛ X − Xc ⎜ ⎜ X ⎝ ⎞ ⎟100 = 0. and since g // (ς ) > 0 . we conclude that g (ς ) = (ς − x0 )(ς − x1 ) = ⎢ x0 + x1 − x0 ⎥ ⎢ x0 + x1 − x1 ⎥ 2 2 ⎣2 ⎦⎣ 2 ⎦ = 1 2 ⎡1 1 ⎤⎡ 1 1 ⎤ (x 1 − x0 ) 1 2 (x 0 − x1 ) = − h2 4 We therefore conclude that Max  g( x ) = Max  E ( x ) = h2 M 4 .23% ⎟ ⎠ ⎞ ⎟100 = 0.455 X c = 0.45606 X b = 0.00106 X − X c = 0 . (a) (b) (c) (d) Exact value Approximate value Approximate value Absolute error Absolute error X = 0.African Virtual University 3. h2 and hence the result that 4 . (a) Consider the function g( x) = ( x − x0 )( x − x1 ) whose first and second derivatives are: g / ( x) = 2 x − ( x0 + x1 ) and g // ( x) = 2 .013% ⎟ ⎠ Percentage errors 4. g (x) has a single critical point at ζ = x 0 + x1 2 .
i 2 i≥ ln(1000) = 10 ln(2) .d b = 1 .African Virtual University (b) With that h2 8 f ( x) = sin( x) . Q.e. 2 Assumption: Ek = b− a 2k Let the formula hold for i = k > 1 (fixed). then Ei = −3 1 . Induction: Error in x k +1 = E k +1 = 1 Ek 2 1 ⎡ b− a ⎤ b− a ⎢ ⎥ = k +1 2 ⎣ 2k ⎦ 2 (b) If a = 0 and = . (a)Mathematical induction 2i Test : Formula is true for i = 1 because the error in the first bisection is b− a Ei = b− a . This will not exceed 10 if .08 < 0 . This means .01 . This leads to the value h ≤ 5. we have M = 1 and therefore we need to find h such 0 .3 . ≤ 0 .
Newton’s divided differences and on finite differences. • Some functions may be known but the solution of the problem in which they appear may not have an obvious mathematical expression to work with. Specifically. We approximate functions for one or several of the following reasons: • A large number of important mathematical functions may only be known through tables of their values. Specific Learning objectives At the end of this Learning Activity the learner will be able to: • Explain why numerical methods are needed in solving interpolation problems. Numerical approximation addresses both the need to approximate numbers as well as approximating functions.African Virtual University Learning Activity 2: Interpolation Summary The concept of interpolation is important in any introductory course on numerical methods. Numerical interpolation approximates functions. • Some functions may be known to exist but are computationally too complex to manipulate numerically. This is followed by presenting special interpolation polynomials. This Learning Activity covers the following subtopics: • • • • Linear interpolation Lagrange interpolation polynomial Newton’s divided differences interpolation polynomial Finite differences interpolation polynomials We start off by defining the concept of interpolation. . Interpolation as it is presented in this Learning Activity will give the Learner an opportunity to experience first hand some practical applications of numerical methods in solving the mathematical problem of approximating a function f (x) which is known only through a set of values at a finite number of points. we discuss interpolation polynomials based on Lagrangian interpolation coefficients. Linear interpolation is used to illustrate the concept.
Wikipedia generally gives shorter and less complete entries. However. • Construct tables of differences for tabulated function values. This gives a helpful overview of the importance and context of the topic being studied.07) http://en. Divided Differences: Differences of the function values provided.wikipedia.ac. MacTutor History of Mathematics (visited 03. Also. Mathworld gives a detailed reference in all cases. List of required readings Wikipedia: Interpolation List of relevant useful links Wolfram MathWorld (visited 03. • Apply Newton’s divided differences interpolation polynomial. Students should search for their unit title and read the history of the subject. Also. Interpolation polynomial: a polynomial which interpolates a function using discrete values provided.03.04. Wikipedia (visited 03.07) http://wwwhistory.African Virtual University • Apply Lagrangean interpolation polynomials. they can be easier to read. search for any key words in the text. • Derive and apply Newton’s forward. and finally • Use finite difference interpolation polynomials in deriving some numerical integration methods. backward. Key Terms and Theorems Full definitions are given in the text.standrews. Newton’s backward and Stirling’s central difference interpolation polynomials.mcs. search for any key words in the text. students should search for the entry covering the unit title.com Students should search for the entry covering the unit title. • Define and manipulate finite difference operators (shift.04. central and mean difference operators). Interpolation: approximation of a function using discrete values. .wolfram. related to the differences between the discrete points provided. forward.org/wiki As with mathworld.uk/Indexes The MacTutor Archive is the most comprehensive history of mathematics on the internet.07) http://mathworld.
African Virtual University Finite difference operators: Mathematical operators used in constructing the differences in the function values. Higher order interpolation polynomials are then introduced. including • Lagrangian interpolation polynomials • Newton’s divided differences interpolation polynomials. mainly because polynomials are • Simple to evaluate • Simple to differentiate. Specifically. and • Simple to integrate. Another Learning Activity is on errors and a fourth Learning Activity is on numerical methods for approximating functions. liner interpolation. numerical methods are used both for approximating numbers as well as for approximating functions. Why are Polynomials Chosen to Approximate Functions? Functions are approximated using other functions deemed to be simple to manipulate numerically. We begin the presentation by defining the concept of interpolation and establishing the need for numerical methods for carrying out interpolation. Introduction How Many Learning Activities are in this Module? As stated in the summary above. and finally . one uses polynomials to approximate other complicated functions. The contents of this module are covered in four Learning Activities. This is followed by a detailed discussion of the simplest polynomial used in approximating functions. Finite difference tables: A table showing different orders of the differences in the function values. Two of these Learning Activities are on methods of approximating numbers (the definite integral and roots of functions).
Typically one is given the pairs of values ( x k . f ( x k )). Learning activity # 2 2. b] . At the end of the Learning Activity we briefly discuss the possible use of interpolation polynomials in deriving some numerical integration methods such as the Trapezoidal rule and Simpson’s rule. Typical Example (Bajpai et al 1975 pp 205) In an experiment carried out in a physics laboratory. where an algebraic expression for a function may not be known but its values for different values of its independent variable may be obtained experimentally through laboratory measurements. x 0 = a. The function f (x) to be approximated is usually defined through a set of its values at n + 1 distinct points lying in the interval [a.. k = 0. These types of problems are quite common in experimental physics and chemistry.0 . n.2.1.1 Meaning of Interpolation The mathematical concept of interpolation is concerned with the problem of approximating a function f (x) defined over a closed interval [a.4 2 2031.. xn = b The problem is then to find values (or even derivatives) of the function at some non tabular points lying inside the interval. The results of the experiment are as tabulated hereunder: Table 1: Load versus extension of a wire x : Load (kg) y : Length (mm) 0 2027.5 5 2039..1 4 2036.African Virtual University • Finite difference interpolation polynomials.1 1 2029.. the length y of a wire was measured for various loads x suspended from it. b] .8 3 2034.
Here we consider three forms: (i) The usual yintercept . f 1 ) on the curve of a (usually unknown) continuous function y = f (x) and that we now wish to approximate the value of the function at a point x ∈ ( x0 . This is known as interpolating the function y = f (x) .5] . (ii) The Lagrange form and (iii) The determinant form For computational purposes.slope or Newton’s form. Any attempt to use the data to calculate the length of the wire for a load outside the given range is called extrapolation. f 0 ) and B ( x1 . 2.African Virtual University From the data obtained above one may wish to know the length of the wire for any non tabulated load lying inside the range [0.2 Linear interpolation In linear interpolation we assume that we have two points A( x0 . . we approximate the function f (x) locally over the interval [ x0 . the determinant form is the best of the three forms given. x1 ) . DO THIS Revisit and learn the various forms of defining a straight line and writing the equation of the straight line for each form: • Twopoints given • A point and a slope is given Because a straight line is completely defined by giving two points which lie on it. The equation of the straight line can be given in different forms. where the functional dependence of y on the load x is not explicitly given here. x1 ] by the straight line through the two given points.
7 2034.41 which looks to be quite reasonable in that as may be expected.3 = 2033. f1 = 2034.8. it is closer to f 1 than it is to f 0 .1 0.7 kg Solution In this example we substitute the values x0 = 2.8 − 0.7 into the determinant form of the equation and obtain the value P1 (2.African Virtual University 0 ⎧ ⎪ (i ) ⎪ ⎪ ⎪ ⎪(ii ) ⎪ P1 ( x) = ⎨ ⎪ ⎪ ⎪ (iii ) ⎪ ⎪ ⎪ ⎩ ⎛ f − f0 f0 + ⎜ 1 ⎜x −x 0 ⎝ 1 ⎞ ⎟( x − x0 ) ⎟ ⎠ x − x0 x − x1 f0 + f1 x0 − x1 x1 − x0 f0 1 x1 − x0 f1 x0 − x x1 − x Worked Example 1 Using the data obtained from the laboratory experiment of suspending load from a wire and measuring its length. x1 = 3. f 0 = 2031. .1. apply the determinant form of linear interpolation to approximate the length of the wire when the load is 2. x = 2.7) = 2031.
35 kg 2. x1 ] . 2 E 1 ( x) = ( x − x0 )( x − x1 ) If M = Max f // ( x) over the interval [ x0 . x1 . n .2. P( x1 ) = f ( x1 ) . x1 . x) 2 1 // f (ξ ).African Virtual University DO THIS (2.. the error in linear interpolation assumes the form 1 // f (ξ ) where Min ( x0 . For linear interpolation this implies that P( x0 ) = f ( x0 ) . An important feature of interpolation polynomial Pn (x) of any degree is that Pn ( x k ) = f ( x k ) k = 0.3 Error in linear interpolation We now attempt to answer the question: How big is the error in linear interpolation? In other words.. In a subsequent section of this Learning Activity the value of C for a function f (x) which is assumed to be sufficiently differentiable is given as C = With this result..1) Apply the other two forms of the linear interpolation function P1 ( x) to approximate the length of the wire when the load is 1. then one can show that E 1 ( x) ≤ 1 1 M ( x1 − x0 ) 2 = Mh 2 8 8 . This further implies that the error E (x) at any point x ∈ [ x0 . x1 ] in linear interpolation must have the form E 1 ( x) = ( x − x)( x − x)C where C is a constant which is independent of x .1. we wish to know how accurate the answers obtained through the process of linear interpolation are.. x) < ξ < Max ( x0 .
. To ensure that Pn (x) satisfies the co‑location criteria given above.1. However there are different forms of representing the interpolation polynomial.2..... i = 0. + L n ( x) f n = ∑ L ( x) f i i =0 n i in which the terms Li ( x) . k = 0.5 Lagrangean interpolation polynomial The Lagrangean form of the interpolation polynomial has the general form Pn ( x) = L 0 ( x) f 0 + L1 ( x) f1 + L 2 ( x) f 2 + . n one is required to construct a polynomial Pn (x) of degree n such that it satisfies the following co‑location criteria Pn ( x k ) = f k ..African Virtual University 2. n are individually polynomials of degree n in x called are called the Lagrangean interpolation coefficients.... n One can show that this so called “Interpolation polynomial” does exist and is unique...2.2.4 Interpolation polynomials As already stated at the beginning of the Learning Activity the main problem of polynomial interpolation may be stated as follows: Given the values f ( x k ) = f k of some continuous function f (x) at n + 1 distinct points x k . In this Learning Activity we give four different forms of the interpolation polynomial.. the Lagrangean interpolation coefficients are constructed such that they satisfy the condition Li (x j ) = δ i.. k = 0.1. j ⎧1 if ⎪ =⎨ ⎪0 if ⎩ i= j i≠ j One can verify that the following definition of Li (x) meets this requirement: .1... 2.
( xi − xn ) With this definition of the Lagrangian interpolation coefficients one can now verify the colocation condition on the interpolation polynomial.35 xi fi P3 (x) = 1...( xi − xi −1 )( xi − xi +1 ).58 2 3 0. j = 0..58L 1 (x) + 0.01 3 4 0..African Virtual University L i ( x) = ( x − x0 )( x − x1 )..54L 0 (x) + 0.2..54 1 2 0.35L 3 (x) where ( x − 2)( x − 3)( x − 4) 1 = − ( x − 2)( x − 3)( x − 4) (1 − 2)(1 − 3)(1 − 4) 6 ( x − 1)( x − 3)( x − 4) 1 L 1 ( x) = = ( x − 1)( x − 3)( x − 4) (2 − 1)(2 − 3)(2 − 4) 2 ( x − 1)( x − 2)( x − 4) 1 L 2 ( x) = = − ( x − 1)( x − 2)( x − 4) (3 − 1)(3 − 2)(3 − 4) 2 ( x − 1)( x − 2)( x − 3) 1 L 3 ( x) = = ( x − 1)( x − 2)( x − 3) (4 − 1)(4 − 2)(4 − 3) 6 L 0 ( x) = .01L 2 (x) + 0.... n Worked Example 2 Construct the cubic Lagrangean interpolation polynomial which interpolates the function f (x) given by the following table of values: Table 2 i 0 1 1.( x − xi −1 )( x − xi +1 ).1. for n n Pn ( x j ) = ∑ L i ( x j ) f j i =0 = ∑δ i =0 ij fi = f j ....( x − xn ) ( xi − x0 )( xi − x1 ).
xk ] = f [ x1 .. x1 ... x1 . 2. k = 1.African Virtual University DO THIS (2. xk −1 ] x k − x0 .1) selfexercise problem is a typical example of the Lagrangean linear interpolation formula.2. x1 ] x 2 − x0 f [ x1 .2..1. x1 .. x2 . x2 ... x2 .. x2 ] x3 − x 0 f [ x0 . the quadratic Lagrangian interpolation polynomial. (ii) In changing from one degree Lagrangian interpolation polynomial to another. n as follows f [ x0 ....6 Observation (i) We note that the second form (ii) of the equation of a straight line given in the DO THIS (2. x2 .. none of the expressions used in the linear approximation case (the linear Lagrangian coefficients L0 ( x) L1 ( x) ) are useful in the construction of . x1 ] = f1 − f 0 x1 − x 0 f [ x1 . In what follows we shall present two interpolation polynomials in this category.. x2 ] − f [ x0 .2) Make use of the above Lagrangean interpolation polynomial to interpolate the function f (x) at x = 2.. x3 ] − f [ x0 .. x2 . xk ] − f [ x0 . x3 . x1 . x n such that f k = f ( x k ) ..6 Newton’s divided differences Let the function f (x) be given at n + 1 distinct points x0 . efforts have been made to construct interpolation polynomials that are iterative in the sense that.. k = 0. n We define what are known as Newton’s divided differences f [ x0 ... Because of the second observation. all calculations must be done afresh. a higher degree interpolation polynomial can be got simply by adding higherdegree terms to an existing lower degree interpolation polynomial. x1 .. x3 ] = • • f [ x0 . x2 ] = f [ x0 ... x k ] . For instance. x1 .... say from linear to quadratic. x1 ...
x 2 . x 4 .. x3 . x 4 ... x1 ] x1 f ( x1 ) f [ x1 .. x3 ] x3 f ( x3 ) f [ x3 . x5 ] f [ x1 .. x 2 ] f [ x0 .( x − xk ) f [ x0 . x3 . x5 ] f [ x 2 . x3 ] f [ x1 . x3 ] f [ x0 ..African Virtual University A typical table of divided differences would look as follows Table 3: Table of Divided Differences x x0 f (x) f ( x0 ) Divided Differences First Second Third Fourth f [ x0 . x 2 . x1 . x 4 ] f [ x 2 .. 1989 p 113) Pn ( x) = f ( x0 ) + ( x − x0 ) f [ x0 .. . xn ] OR Pn ( x) = f ( x0 ) + ∑ ( x − x0 )( x − x1 ). x 4 ] x4 f ( x4 ) f [ x 4 . x3 .. x 4 . x1 ] + ( x − x0 )( x − x1 ) f [ x0 . x2 . x 4 ] f [ x1 . n : (Burden and Faires. x3 . x 2 . x1 .. x2 ] + ( x − x0 )( x − x1 )( x − x2 ) f [ x0 . x1 .2. x5 ] x5 f ( x5 ) f [ x3 . k = 0. x 2 .. x1 .xk −1 ] k =1 n We shall illustrate this approach on the following example. x1 . x2 . x3 ] + ... + ( x − x0 )( x − x1 )( x − x2 ).. x3 .1. x 2 ...( x − xn+1 ) f [ x0 . x 2 ] x2 f ( x2 ) f [ x 2 . x1 .. x2 . x1 . x5 ] f [ x0 . x 4 ] Using these divided differences Newton derived the following nth degree polynomial Pn (x) which interpolates the function f (x) at the n + 1 distinct collocation points x k .
African Virtual University Worked Example 3 (i) Construct a table of divided differences for the function f (x) given by the following data: Table 4: Tabulated values of a function x f(x) 3 17 2 25 1 13 0 5 1 1 2 23 3 115 (ii) Use the resulting table of differences to interpolate f (x) at: x = − 2 .3 using Newton’s linear.0 . quadratic and cubic interpolation polynomials based at x0 = −3 Solution Table 5: Table of divided differences x 3 2 1 0 1 2 3 f (x) 17 Divided Differences First Second Third Fourth 8 25 12 13 8 5 4 1 24 23 92 115 34 10 8 2 4 1 2 0 1 10 4 1 Interpolation based on x = − 3 .
The additional term is ( x − x0 )( x − x1 )( x − x2 ) f [ x0 .6 − 2.3)(−1. x1 . Compare your answer with the value of the function f ( x) = x 4 + 2 x 3 − 3 x 2 + 4 x − 5 at x = − 0 .7 • Cubic interpolation Again we only need to calculate a correction to be made in the value obtained using quadratic interpolation.3) = f ( x0 ) + ( x − x0 ) f [ x0 .1 = −24. x2 .3 using a 4th degree Newton’s divided differences interpolation polynomial based on the point x = − 1 . f ( x0 ) = −17 .1 Adding this correction to the value obtained through linear interpolation we get f (−2.7)(−0. (ii) Interpolate f (x) at x = − 0 .792 DO THIS (2.3)(−4) = −1. x2 ] whose value at x = − 2 .3)(10) = −2. x = −2.092 . x3 ] whose value is (0.3) = −25.3) Using the above table of divided differences (i) Write down the value of the divided difference f [ x 2 . x3 .0 .7)(−0.African Virtual University • Linear Interpolation Here we take: x0 = −3.6 • Quadratic Interpolation Because we are interpolating at the same point x = − 2 . x1 ] = −22.3 we only need to consider the additional term ( x − x0 )( x − x1 ) f [ x0 . Making this correction in the value obtained by quadratic interpolation gives f (−2.3) = −22. f [ x0 .0 . x1 ] = −8 .3 and we get f (−2.3 is (0. x1 . x 4 ] and show exactly how it has been arrived at.3 .
. (1) Powers of the forward difference operator Δ can also be defined Δ p+1 f k = Δ p f k +1 − Δ p f k p = 0. and through the relation Ef k = f k +1 in the case of a discrete variable x k . A systematic introduction of the method of approach involves the introduction of some difference operators.. The Shift Operator E The shift operator E is defined through the relation Ef ( x ) = f ( x + h) in the case of a continuous variable x . The basic assumption here is that The function values f ( x k ) := f k are given at a number of equally spaced and distinct points having a constant interval length h = xk +1 − xk between consecutive collocation points. There are four basic difference operators: The Shift. Backward and Central difference operators.7 Finite Difference Operators The third and final set of interpolation polynomials are closely related to those based on Newton’s divided differences. Δ0 f r = f r for any value of r . These are defined as follows. E p fk = fk+ p The Forward Difference Operator Δ The forward difference operator Δ relation is defined through the relation Δf ( x) = f ( x + h) − f ( x) in the case of a continuous variable x . and through the Δ f k = f k +1 − f k in the case of a discrete variable x k .African Virtual University 2. ... Powers of the operator (positive or negative) are defined in a similar manner: E p f ( x) = f ( x + ph). Forward.12.
. and through the ∇ f k = f k − f k −1 in the case of a discrete variable x k . ∇ 0 f r = f r for any value of r .. The Central Difference Operator δ The central difference operator δ is defined through the relation δf ( x) = f ( x + through the relation 1 1 h) − f ( x − h) in the case of a continuous variable x . and 2 2 (3) ∇fk = fk − fk − 1 in the case of a discrete variable x k .. (4) Relationship between Difference Operators The definition of powers of the Shift Operator E enables us to relate the other three difference operators with one another. E −1 f k = f k −1 Using these three results. 2 E − fk = f k− 1 2 . (2) Powers of the backward difference operator can also be defined ∇ p+1 f k = ∇ p f k − ∇ p f k −1 p = 0.African Virtual University The Backward Difference Operator ∇ The backward difference operator ∇ is defined through the relation relation ∇f ( x) = f ( x) − f ( x − h) in the case of a continuous variable x .. Powers of the central difference operator can also be defined δf k+ 1 2 −δ f k− 1 2 for any value of r . all of which are based on the valid definition of the shift operator we now establish the following relationships: Because Δf k = f k +1 − f k = Ef k − f k = ( E − 1) f k we conclude that .12. We first note that: 1 1 2 E 2 fk = f k+ 1.
because δf k = f 1 − f 1 = E f k − E k+ k− 2 2 conclude that f k = (E − E − ) f k we 1 δ ≡E 2 −E − 1 2 (7) In the case of the central difference operator δ it is not possible to express the shift operator E in terms of the central difference operator δ alone. because ∇f k = f k − f k −1 = f k − E −1 f k = (1 − E −1 ) f k we conclude that ∇ ≡ 1 − E −1 or E ≡ 1 1− ∇ 1 2 1 −2 (6) 1 2 1 2 Similarly. However. ⇒ δ ≡ E 2∇ . we shall do so by involving the other finite difference operators. (i) Multiplying both sides of equation (7) with E equation (5) we get 1 2 and taking note of the result in E δ = E (E − E 1 2 1 2 1 2 1 2 − 1 2 ) = E − 1 ≡ Δ .African Virtual University 0 Δ ≡ E −1 or E ≡ Δ + 1 (5) Again. therefore − 1 2 Δ ≡ E δ. ⇒δ ≡ E Δ 1 (8) (ii) Multiplying both sides of equation (7) with E � 2 and taking note of the result in equation (6) we get E − 2δ = E − 2 (E 2 − E 1 1 1 1 1 − 1 2 ) = 1 − E −1 ≡ ∇ . therefore (9) ∇≡E − 2 δ. Specifically we can relate the forward and backward difference operators with one another by involving the shift and central difference operators.
δ one can now define any powers of the Δ . δ. 2 6 n ⎛s + k⎞ k ⎟∇ f n =∑⎜ ⎜ ⎟ k =0 ⎝ k ⎠ . μ ) we are now ready to list (not derive) a number of interpolation polynomials based on their use.African Virtual University Having established all these interrelationships between the operators E . 2 6 (2) Newton’s Backward Difference Interpolation Polynomial Pn ( s) = f n + s∇f n + 1 1 s( s + 1)∇ 2 f n + s( s + 1)( s + 2)∇ 3 f n + .. ∇ . Exactly how they are used will be discussed after introduction of the concept of a table of differences. the Mean (or averaging) Operator μ is often used in connection with some interpolation formulas that are based on the central difference operator δ ..8 Finite Difference Interpolation Polynomials Armed with the five difference operators ( E . such polynomials are usually written in terms of a digital variable s obtained from the transformation of variables s= 1 h (x − x ) 0 (1) Newton’s Forward Difference Interpolation Polynomial Pn ( s) = f 0 + sΔf 0 + n ⎛s⎞ = ∑ ⎜ ⎟Δk f 0 ⎜ ⎟ k =0 ⎝ k ⎠ 1 1 s( s − 1)Δ2 f 0 + s( s − 1)( s − 2)Δ3 f 0 + . ∇ . Δ . Δ. Instead of operating with the variable x . δ operators... The mean operator is defined through the relationship μf k = ⎞ 1⎛ ⎜f 1 + f 1⎟ k− ⎟ 2 ⎜ k+ 2 2 ⎠ ⎝ (10) 2. ∇. A last useful operator.
... The answer is not difficult.African Virtual University (3) Stirling’s Central Difference Interpolation Polynomial Pn (s) = f0 + sμδ f0 + 1 2 2 1 1 2 2 s δ f0 + s(s 2 − 1)μδ 3 f0 + s (s − 1)δ 4 f0 + ... ...9 Tables of Differences All five finite difference interpolation polynomials given above contain forward or backward or central differences of powers exceeding one. 2 6 24 (4) Bessel’s Central Difference Interpolation Polynomial 1 1 1 1 Pn ( s) = μf 1 + ( s − )δf 1 + s( s − 1) μδ 2 f 1 + s( s − 1)( s − )δ 3 f 1 + 2 2 2 6 2 2 2 2 1 2 ( s − 1) s( s − 2) μδ 4 f 1 + . ⎟ ⎝ ⎠ ⎝ ⎠ ⎛ t + 1⎞ 2 ⎛t + 2⎞ 4 + tf0 + ⎜ ⎜ 3 ⎟δ f 0 + ⎜ 5 ⎟δ f 0 + . It is therefore important to know how these quantities can be got.. These quantities are obtained from tables of differences constructed using the given values of the function f (x) at the equidistant collocation points x k .. ⎟ ⎜ ⎟ ⎝ ⎠ ⎝ ⎠ where t = 1 − s 2. 24 2 (5) Everett’s Central Difference Interpolation Polynomials ⎛ s + 1⎞ 2 ⎛ s + 2⎞ 4 ⎟δ f1 + ⎜ Pn ( s) = sf1 + ⎜ ⎜ 3 ⎟ ⎜ 5 ⎟δ f1 + .
The following are typical examples of tables of differences. The only difference here is that only differences of function values are involved. Such differences are not divided by any quantity.African Virtual University The tables of values are obtained in a process similar to that taken in constructing the Newton’s divided differences. Table 6: Forward Difference Table x x0 x1 f (x) f0 FORWARD DIFFERENCES First Second Third Fourth Fifth ∆f0 f1 ∆f1 ∆2f0 ∆3f0 ∆2f1 ∆f2 ∆3f1 ∆2f2 ∆f3 ∆3f2 ∆2f3 ∆f4 ∆4f1 ∆4f0 ∆5f0 x2 x3 f2 f3 x4 f4 x5 Observation f5 Note the forward slopping nature of the entries based at any point x k in the table of forward differences. The Newton Forward Interpolation polynomial uses value along such a path .
African Virtual University Table 7: Backward Difference Table BACKWARD DIFFERENCES First Second Third Fourth Fifth x x0 x1 f (x) f0 ∇f1 f1 ∇f2 ∇2f2 ∇3f3 ∇2f3 ∇f3 ∇2f4 ∇2f4 ∇f4 ∇3f5 ∇2f5 ∇f5 ∇5f4 ∇4f4 ∇5f5 x2 f2 x3 f3 x4 f4 x5 Observation f5 Note also the backward slopping nature of the entries based at any point x k in the table of backward differences. The Newton Backward Difference Interpolation Polynomial uses values along such a path. .
African Virtual University Table 8: Central Difference Table x x3 f (x) f3 CENTRAL DIFFERENCES First Second Third Fourth Fifth δf2 ½ f2 f2 δf1 ½ f1 f1 δf .½ δ2f0 δf½ δ3f ½ δ2f1 δf1 ½ δ3f1 ½ δ2f2 δf2 ½ δ4f1 δ4f0 δ5f½ δ2f2 δ3f1 ½ δ4f1 δf 5.½ x0 f0 x1 f1 x2 f2 x3 Observation f3 Note further the horizontal slopping nature of the entries based at any point x k in the table of central differences.½ δ2f1 δ3f . Stirling’s. . Bessel’s and Everret’s formulas use table entries on and in the neighborhood of such a path.
6 0. Worked Example 4 (i) Construct a table of differences for the function tabulated bellow.8 0.8253 0. ∇ 4 f 5 .2 0.10 Application Of Difference Tables In Interpolation We are now ready to illustrate both how to construct a table of differences and also how to use it for interpolation purposes.5403 (ii) Use the resulting table to interpolate f (x) • At x = 0. . x f(x) 0 1.African Virtual University DO THIS (2.0 give the values of the following finite differences: Δf 3 .0000 0.4 0.9211 0. δf 1 .1 using Newton’s forward difference formula • At x = 0. Δ2 f 2 .6967 1. μδf 2 1 2 (ii) Using appropriate equivalences express δ 6 f 8 in terms of forward and backward differences.0 0.5 using Stirling’s central difference formula. 2.9 using Newton’s backward difference formula and • At x = 0.9801 0.4) (i) In reference to Table 9 (Page 57) and taking x0 = 0. ∇ 2 f1 .
00006640625 = 0.0010 Differences First Second 0.0 = 0.0199 0.1286 0.8 1.1 − 0.9950 Application of Newton’s backward difference formula We take x n = 1.0 .0328 0.0278 0.0391 0..1) ≈ 1.00014375 − 0.9 − 1 .0050 0.0000 − 0.0007 (ii) Interpolation Application of Newton’s forward difference formula We take x0 = 0.0 Substitution of these values and the calculated value of s gives the following result f (0.1564 0.0590 0.0000 0.African Virtual University Solution (i) Table 9: Table of differences x 0.00995 + 0.5 .2 The table entries needed for this calculation are highlighted in the above table of 1 1 1 s( s − 1)Δ2 f 0 + s( s − 1)( s − 2)Δ3 f 0 + s( s − 1)( s − 2)( s − 3)Δ4 f 0 + .5403 0.0 f(x) 1.2 0. Since the interval length being used is h = 0.2 the value of the parameter s is calculated and found to be s = 0 .8253 0.5 0.0048875 + 0.0 .4 0.9211 0.2 = − 0 .0017 Third Fourth Fifth 0.0040 0. Again since the interval length is h = 0.0368 0.9801 0.0958 0.0 0.6967 0.0 0 .2 the value of the parameter s is calculated and found to be s = Newton’s forward difference formula is given by f ( x) = f 0 + sΔf 0 + 0. 2 6 24 differences based on x0 = 0.6 0.0023 0.
5403 + 0.000196875 − 0.African Virtual University Newton’s backward difference formula is given by f ( x) = f 0 + s∇f 0 + 1 1 1 s( s + 1)∇ 2 f 0 + s( s + 1)( s + 2)∇ 3 f 0 + s( s + 1)( s + 2)( s + 3)∇ 4 f 0 + .0000390625 = 0.2 the value of the parameter s is calculated and found to be s = = 0 . 2 6 24 The table entries needed for this calculation are not highlighted in the above table but are relatively easy to pick up.0782 + 0.0046 − 0.9211 − 0. Application of Stirling’s central difference formula We take x0 = 0..6216 rounded correct to four significant figures. Since the interval is h = 0.4 .003475 − 0. 2 6 24 The table entries needed for this calculation are highlighted in the above table of differences based at x n = 1.5) = 0.8776 .0387 − 0. To maximize transparency in the calculations we point out the following: μδf 0 = ⎤ 1⎡ ⎢δf 1 + δf − 1 ⎥ .9) ≈ 0.5 − 0 .5 0 . Direct substitution of these values and the calculated value of s gives f (0.00001328125 = 0.2 Stirling’s central difference formula is given b 0 .0003125 − 0.4 f ( x) = f 0 + sμδf 0 + 1 2 2 1 1 2 2 s δ f 0 + s( s 2 − 1) μδ 3 f 0 + s ( s − 1)∇ 4 f 0 + . 2⎣ 2 2⎦ μδ 3 f 0 = ⎤ 1⎡ 3 3 ⎢δ f 1 + δ f − 1 ⎥ 2⎣ 2 2⎦ With this clarification we now perform the calculations and find f (0. For the inexperienced learner the teething problem may lie in finding the averaged values..0 .
4)(0.5) Using the entries in Table 9 apply Everret’s central difference formula based on x0 = 0.L. Numerical Methods for Engineers and Scientists. London 1975.M. Bajpai. Fifth Edition 1989.35) = 2030.24 ⎣ x1 − x0 ⎦ ⎡ x − x1 ⎤ ⎡ x − x0 ⎤ P1 ( x) = ⎢ ⎥ f0 + ⎢ ⎥ f1 = (0. Taylor & Francis Ltd. We therefore take and substitute into the two linear interpolation formulas: (i) P1 ( x) = f 0 + ⎢ (ii) ⎡ f1 − f 0 ⎤ ⎥ ( x − x0 ) = 2029. Numerical Analysis.4 + (2.35 kg lies between the loads 1 kg and 2 kg. Calus and J. Faires.A.. Boston.65)(2029.C.4) + (0. PWSKent Publishing Co.45 . Burden and D.African Virtual University DO THIS (2. I.1) The load 1.4 to interpolate the function f (x) at x = 0 .8) = 2030. Fairley. References for the Learning Activity A. Solutions To Formative Evaluation Questions DO THIS (2.24 ⎣ x0 − x1 ⎦ ⎣ x1 − x0 ⎦ . R.35)(2031.
6) = 0.0 .056 6 1 L (2.6) = (2. x3 .6 − 4) = 0.6) = − (2.064 6 Substitution into the expression for P3 (2. x3 .6 − 2)(2.6 − 4) = 0.58 L1 ( x) + 0.6 − 2)(2. x 4 ] − f [ x 2 .2) P3 ( x) = 1.6) = − (2.15792 .6) = (2.6 − 1)(2.6 − 2)(2.54 L 0 ( x) + 0.35 L 3 ( x) At x = 2.672 2 1 L (2.6) gives the result P3 (2. Here x 0 = − 1 .3) (i) f [ x2 .6 − 1)(2. x3 ] 1 ⎧ f ( x 4 ) − f ( x3 ) f ( x3 ) − f ( x 2 ) ⎫ = − ⎨ ⎬ x4 − x2 x4 − x2 ⎩ x 4 − x3 x3 − x 2 ⎭ 1 = (8 − 12) = −2 2 (i) Interpolation of f (x) at x = − 0 .African Virtual University 0 DO THIS (2.6 − 3) = −0.6 − 4) = −0.6 − 1)(2.3 using Newton’s 4th degree divided differences f [ x 2 . x 4 ] = interpolation polynomial. DO THIS (2.448 2 1 L (2.01L 2 ( x) + 0.6 the values of the Lagrangean coefficients are found to be 1 L (2.6 − 3)(2.6 − 3)(2. x4 ] = −2 This result is obtained from the definition of divided differences as follows: f [ x3 .
African Virtual University
P4 ( x) = f ( x0 ) + ( x − x0 ) f [ x0 , x1 ] + ( x − x0 )( x − x1 ) f [ x0 , x1 , x2 ] + ( x − x0 )( x − x1 )( x − x2 ) f [ x0 , x1 , x2 , x3 ] + ( x − x0 )( x − x1 )( x − x2 )( x − x3 ) f [ x0 , x1 , x2 , x3 , x4 ] f ( x0 ) = −13 ( x − x0 ) f [ x0 , x1 ] = 5.6 ( x − x0 )( x − x1 ) f [ x0 , x1 , x2 ] = 0.42 ( x − x0 )( x − x1 )( x − x2 ) f [ x0 , x1 , x2 , x3 ] = 1.092 ( x − x0 )( x − x1 )( x − x2 )( x − x3 ) f [ x0 , x1 , x2 , x3 , x4 ] = −0.6279
We then get the answer
P4 (−0.3) = −13.0 + 5.6 + 0.42 + 1.092 − 0.6279 = −6.5159
On the other hand, the function f ( x) = x 4 + 2 x 3 − 3 x 2 + 4 x − 5 is found to have the same value (6.5159) at x = − 0 .3 .
DO THIS (2.4)
(i) One finds
Δf 3 = −0.1286 , ∇ 2 f1 : Non − existent, δf ∇ 4 f 5 = −0.0007 , μδf 2 =
1 1 2
= −0.0590 , Δ2 f 2 = −0.0391,
⎤ 1⎡ ⎢δf 2 1 + δf11 ⎥ = −0.0774 2⎣ 2 2⎦
African Virtual University
(ii) This is solved using the equivalence relations δ ≡ E finds:
−
1 2
1
Δ, δ ≡ E
2
∇ . One
⎡ −1 ⎤ δ f 8 = ⎢ E 2 Δ ⎥ f 8 = E −3 Δ6 f 8 = Δ6 f 8−3 = Δ6 f 5 ⎣ ⎦
6
6
⎡ 1 ⎤ = ⎢ E 2 ∇ ⎥ f 8 = E 3 ∇ 6 f 8 = ∇ 6 f 8+3 = ∇ 6 f11 ⎣ ⎦ DO THIS (2.5)
Using the entries in Table 9 apply Everret’s central difference formula based on x 0 = 0 .4 to interpolate the function f ( x ) at x = 0 .45 . We are given the quantities x0 = 0.4; h = 0.2, x = 0.45 and therefore the two parameters required in the application of the Everret method are
6
s=
x − x0 0.45 − 0.4 = = 0.25 , t = 1 − s = 0.75 h 0.2
1 f (0.45) = (0.25)(0.8253) + (0.75)(0.9211) + (1.25)(0.25)(−0.75)(−0.0328) + 6 1 (1.75)(0.75)(−0.25)(−0.0368) + ... = 0.9004 6
African Virtual University 63
Learning Activity # 3
Numerical Integration Summary
In this learning activity we focus on numerical integration methods. A major portion of the presentation is devoted to the NewtonCotes category of formulae. However, we also dwell on the more accurate family of numerical integration methods classified as Gaussian integration methods. Specific attention is given to the two best known Newton Cotes methods: Trapezoidal rule, Simpson’s rule and the application of Richardson’s extrapolation technique on both methods in deriving the Romberg integration method. As for Gaussian integration methods we limit our discussion to the Gaussian method based on Legendre polynomials. The Learning Activity is presented under the following headings: • • • • • • • • The need for numerical integration Classification of methods NewtonCotes formulae The Trapezoidal Rule Simpson’s rule Error terms in the Trapezoidal and Simpson’s rules Romberg integration Gaussian integration methods
At the end of this learning activity the learner will be able to:
1. Classify numerical integration methods 2. Derive and apply the Trapezoidal rule and Simpson’s rules. 3. Derive and apply Romberg’s integration method based on either the Trapezoidal or Simpson’s rule 4. Apply the Gaussian integration method based on Legendre polynomials.
List of relevant readings
Fundamental Numerical Methods and Data Analysis, George W. Collins, chapter 4. Wikipedia: Numerical Methods/Numerical Integration
Key Words • Antiderivative of f (x) A function F (x) is called an antiderivative of another function f (x) if dF = f (x).African Virtual University 64 List of relevant useful links Wolfram MathWorld (visited 03. Wikipedia generally gives shorter and less complete entries.wolfram. This gives a helpful overview of the importance and context of the topic being studied. students should search for the entry covering the unit title. Also. Wikipedia (visited 03. Mathworld gives a detailed reference in all cases.04. search for any key words in the text.com Students should search for the entry covering the unit title.wikipedia.uk/Indexes The MacTutor Archive is the most comprehensive history of mathematics on the internet. However.03. they can be easier to read.07) http://mathworld.standrews.04. Also.org/wiki As with mathworld. Students should search for their unit title and read the history of the subject.mcs.ac.07) http://wwwhistory. MacTutor History of Mathematics (visited 03.07) http://en. dx • Order of an integration method A numerical integration method is said to be of order p if it gives exact values of the integral for all polynomial functions f (x) of degree m ≤ p . search for any key words in the text. .
3.b] of integration at which the integrand is to be evaluated. we have presented without deriving. k=0 The coefficients Wk are called weighting coefficients and xk are the abscissas or nodes taken from the range [a. We use a geometrical approach to derive the Trapezoidal (Trapezium) rule and Simpson’s rule. Illustrative examples are given and solved to assist the learner experience the applications of the methods presented.6 (b)) we gave two examples to demonstrate why we need to learn and be able to apply numerical methods in solving some mathematical problems. Because at this juncture the Learner has not been exposed to the concept of orthogonal polynomials.African Virtual University 65 Learning Activity: Numerical Integration Introduction In this Learning Activity we give the features that distinguish the family of NewtonCotes methods from the Gaussian integration methods. .3 Order of an integration method A numerical integration method is said to be of order p if it gives exact values of the integral for all polynomial functions f (x) of degree m ≤ p .2 Classification of Numerical Integration Methods. 3.1 Need for Numerical Integration Methods In the first learning activity (Section 1. Part (ii) of the first Example 1 and the whole of the second example were purposely chosen to illustrate the need to learn numerical methods for evaluating some definite integrals. 3. b Numerical methods for approximating the definite integral neral form b n ∫ f (x)dx have the gea ∫ a f (x)dx ≅ ∑ Wk f (xk ) . the Gaussian integration method based on the Legendre orthogonal polynomials.
giving a total of 2n + 2 unknown parameters.1. 2.4 NewtonCotes Numerical Integration Methods The NewtonCotes integration methods are derived from the general formula by: (i) Requiring the n + 1 nodes xk to be uniformly distributed over the range of integration [a. n (ii) Determining the n + 1 weights Wk such that the formula gives exact values of the integral for all polynomial functions f (x) of degree at most n . xn = b and h = b−a ..1) (i) What kind of a geometrical figure is a trapezium? (ii) What sides of a trapezium determine its area? (iii) How is the area of a trapezium determined? The Trapezoidal rule (sometimes referred to simply as the Trapezium rule) is the simplest practical numerical integration method. The principle behind the method is to replace the curve y = f (x) by a straight line (linear approximation) as shown in the figure 3. it follows that the order of the general numerical integration formula given above is at most 2n + 1 . (a) The Trapezoidal Rule DO THIS (3. It is based on the principle of finding the area of a trapezium. 3. . Since a polynomial of degree m is completely determined by giving its values at m + 1 distinct points.1. k = 0. The Trapezoidal rule and Simpson’s rule fall in this category of methods. where x0 = a ..African Virtual University 66 The general numerical integration formula given above has n + 1 nodes xk and n + 1 corresponding weights.n ..b] such that xk = x0 + kh .
1: Trapezoidal Rule b For the integral ∫ f ( x ) dx a the trapezoidal rule can also be applied by subdividing the interval [ a .. + h ( f n−1 + f n ) 2 2 2 2 h [f 0 + 2( f1 + f 2 + f 3 + ...3. where f 0 = f ( x 0 ) .. followed by applying the trapezoidal rule over each subinterval.African Virtual University 67 Typically. f 1 = f ( x1 ) and 2 h is the distance between x 0 and x1 . we approximate the area A under the curve y = f ( x ) between the ordinates at x 0 and x1 by A ≅ ( f 0 + f 1 ) . with a = x0 and b = x n . n . x k ] .. b] into n subintervals [ x k −1 . + f n−1 )+ f n ] 2 ≅ n−1 h⎡ ( f 0 + f n ) + 2∑ f i ⎤ ⎢ ⎥ k =1 ⎦ ≅ 2⎣ . 2.. of equal length h = xk − xk −1 . h f (x1 ) f (x0 ) Figure 3. k = 1. The area A under the curve y = f ( x ) between the ordinates at a = x0 and b = x n can then be approximated by the generalized Trapezoidal rule b A = ∫ f ( x)dx ≅ a h ( f 0 + f1 )+ h ( f1 + f 2 )+ h ( f 2 + f 3 )+ ..
2. xi = 1 + (i − 1)0..5 f (x) 1.0 1 x f (x) 0.9 2. 3.8 1.7692 0.3 1.4 1. These turn out to be: xk = x0 + (k − 1)h. 1 and h = 0.7 1.1 2 Approximate Solution ∫ 1 dx x by the Trapezoidal Rule with n = 10 ( h = 0.1 1. 2 W1 = W2 = W3 = . the nodes are chosen to be the equidistant points been determined such that the formula gives exact value of the integral for all linear functions of the form y = f ( x ) = ax + b . = Wn−1 = h Example 3.2 1..10 and Table 3.2...625 0.1 [ .0 + 2(6.5882 0.9091 x 1.69377 ≅ 1 x 2 .African Virtual University 68 Observation In this generalized Trapezoidal Rule.5263 0.6 1.. k = 1.1 ).5556 0..1.3. n while the weighting coefficients W k have W0 = Wn = h .0 0.1: Value of the function f ( x) = x 1.1877) + 0.1 x We evaluate the function at the points.5 0. In this example: f ( x) = obtain the pairs of values: i = 1..5]= 0.8333 0.0 1..6667 Direct application of the generalized trapezoidal rule gives the approximate value 2 ∫ 1 dx 0..7143 0.
African Virtual University 69 (b) Simpson’s Rule To obtain Simpson’s rule we subdivide the interval [a.. [x4 .. + fn − 1 ) + 2( f2 + f4 + . where x2 − x1 = x1 − x0 = h . xn ] . x 2 .. + [ fn − 2 + 4 fn − 1 + fn ] = h [ f0 + 4( f1 + f3 + . x6 ]. . [x2 . x4 ].. + fn − 2 ) + fn ] 3 (n− 2 )/2 n/2 ⎤ h⎡ ( f0 + fn ) + 4 ∑ f2 k − 1 + 2 ∑ f2 k ⎥ ⎢ 3⎣ k =1 k =1 ⎦ = .. and replace the curve of the general function y = f (x) over the interval [ x0 .. one takes 2h x0 = 0 and gets the formula x0 ∫ ydx = ∫ ydx = 3 [ f 0 h 0 + 4 f1 + f2 ] Because the formula uses values at three points (two equal subintervals).. [xn − 2 . x1 .. a generalized Simpson’s Rule is only possible when the number n of subintervals is even: [x0 . One applies the formula over each subinterval and adds the results to get the generalized Simpson’s Rule formula ∫ f (x)dx = 3 [ f a b h 0 + 4 f1 + f2 ] + [ f2 + 4 f3 + f4 ] + .. b] into only two equal subintervals using the points x0 . Without loss of generality. x 2 ] by the quadratic Lagrangean interpolation polynomial y= ( x − x0 )( x − x2 ) ( x − x0 )( x − x1 ) ( x − x1 )( x − x2 ) f0 + f1 + f2 ( x0 − x1 )( x0 − x2 ) ( x1 − x0 )( x1 − x2 ) ( x2 − x0 )( x2 − x1 ) 1 ⎡1 ⎤ ⎢ 2 ( x − x1 )( x − x2 ) f 0 − ( x − x0 )( x − x2 ) f1 + 2 ( x − x0 )( x − x1 ) f 2 ⎥ ⎣ ⎦ x2 = 1 h2 The general definite integral x2 x0 ∫ f (x)dx is then approximated by the integral x0 x2 ∫ ydx . x2 ].
69314718 which is the value of ln 2 .2) 2 (i) What is the exact value of the integral (ii) Which of the two approximations of the integral obtained using the Trapezoidal rule and using Simpson’s rule is more accurate? (iii) How is the accuracy of the approximations of either the Trapezoidal Rule or Simpson’s Rule affected by taking a smaller interval h (increasing the number of subintervals / refining the partitioning of the range of integration)? ∫ 1 dx ? x 3.1 ). This is the same problem solved above using the Trapezoidal Rule.0 + 4(3.5 Error Terms in the Trapezoidal Rule and in Simpson’s Rule With an exact value of 0.693147 .5 ] = 0.4595) + 2(2. We certainly can apply Simpson’s Rule because the number of subintervals is even (n = 10). and that the accuracy of both methods increases with decreasing interval length h .1 one obtains 2 ∫ 1 dx 0. x 3 DO THIS (3. Using the values given in the Table 3. These results are made more vivid by the error terms of the respective methods.7282) + 0.1 ≅ [1. . your answers to the other two questions are expected to have been that Simpson’s Rule is more accurate than the Trapezoidal Rule.1 2 Approximate Solution ∫ 1 dx x using Simpson’s rule with n = 10 ( h = 0.African Virtual University 70 Example 3.
C S . the error in Simpson’s approximation S(h) of the integral I is given by I − S(h) = AS h4 + B S h6 + C S h8 + . BS .. interval length h. where AT .. Romberg integration is a postprocessing technique. interval length h. Romberg integration is not a Newton Cotes method..... . It is a method which uses previously computed values to produce more accurate results. where AS .. The method takes advantage of the knowledge of the error terms in either the Trapezoidal Rule or the Simpson’s Rule to produce a much more accurate approximation of the integral using previously calculated approximate values. This explains why Simpson’s Rule is appreciably more accurate than the Trapezoidal Rule for the same interval length h . are again constants whose values do not depend on the The leading error term in the Trapezoidal Rule is AT h2 while that of the Simpson Rule is AS h4 .6 Romberg Integration Strictly speaking.. C T .. BT . are constants whose values are independent of the (ii) Error Term in Simpson’s Rule Similarly.. 1958) that the exact (true) value I of the integral f (x)dx is related to the value T (h) obtained a by the Trapezoidal Rule with an interval of length h through the expression b ∫ I − T (h) = AT h2 + BT h4 + C T h6 + . 3.African Virtual University 71 (i) Error Term in the Trapezoidal Rule For reasonably behaved functions f (x) it can be shown (Fox and Mayers.
Eliminating the constant AT from these two formulae and solving for I we get h2 2 I = T (h2 ) + 2 T (h2 ) − T (h1 )} − BT h1 4 h2 4 + . From the above form of the error term for the method we can write .. if we choose h2 = 1 1⎧ 1 ⎫ 1 I = T ( h1 ) + ⎨T ( h1 ) − T (h1 ) ⎬ − BT h1 4 + . Let h1 and h2 be two different intervals used with Simpson’s Rule. (b) Romberg Integration Using Simpson’s Rule Derivation of a Romberg integration formula based on Simpson’s Rule follows the path as that used in connection with the Trapezoidal Rule.African Virtual University 72 (a) Romberg Integration Using the Trapezoidal Rule Let h1 and h2 be two different intervals used with the Trapezoidal Rule...... 2 3⎩ 2 ⎭ 4 The quantity 1 1 1⎧ 1 ⎫ T (h1 . Its value is called the Romberg value of the integral with respect to the Trapezoidal Rule.. I − T (h2 ) = AT h2 2 + BT h2 4 + C T h2 6 + . 2 { h1 − h2 1 h1 (halving the interval) we get 2 Specifically. From the above form of the error term for the method we can write I − T (h1 ) = AT h1 2 + BT h1 4 + C T h1 6 + . h1 ) = T ( h1 ) + ⎨T ( h1 ) − T (h1 ) ⎬ 2 2 3⎩ 2 ⎭ is an approximation of the integral I with a much smaller error than either of the two approximations T (h1 ) and T (h2 ) ..
.. h1 ) = S( h1 ) + 1 2 1 2 1 ⎧ 1 ⎫ ⎨S( h1 ) − S(h1 ) ⎬ 15 ⎩ 2 ⎭ is an approximation of the integral I with a much smaller error than either of the two approximations S(h1 ) and S(h2 ) .. h1 4 − h2 4 1 2 h2 4 h 4 h2 4 (h 2 − h 2 ) {S(h2 ) − S(h1 )} − 1 h 4 −2 h 4 1 BS + . Its value is called the Romberg value of the integral with respect to Simpson’s Rule. . 2 15 ⎩ 2 ⎭ 20 The quantity S(h1 ..... h1 4 − h2 4 1 2 1 h1 (halving the interval) we get 2 I = S(h2 ) + Specifically. if we choose h2 = 6 1 1 ⎧ 1 ⎫ h I = S( h1 ) + ⎨S( h1 ) − S(h1 ) ⎬ − B S + ..African Virtual University 73 I − S(h1 ) = AS h1 2 + B S h1 4 + C S h1 6 + ... I − S(h2 ) = AS h2 2 + B S h2 4 + C S h2 6 + . Eliminating the constant AS from these two formulae and solving for I we get I = S(h2 ) + h2 4 h 4 h2 4 (h 2 − h 2 ) {S(h2 ) − S(h1 )} − 1 h 4 −2 h 4 1 BS + .
1) + The Romberg value we have obtained by combining two fairly inaccurate values using the Trapezoidal rule has the same high accuracy as the one obtained using Simpson’s Rule with h = 0.2.1 Solution All the values required for the calculations are given in Table 3.0 + 2(6.1) = Therefore 0.5]= 0.African Virtual University 74 Example 3.2 [ .2)}= 0.3 2 Approximate h1 = 0.7282) + 0.0.2 ? ∫ 1 dx x using the interval (ii) If your answer is YES. apply the method.69564 1 2 0.693147 T 3 DO THIS (3.3) 2 (i) Is it possible to apply Simpson’s Rule on the integral h = 0.5]= 0. If your answer is NO explain carefully why not.1 One finds ∫ 1 dx x by Romberg integration based on the Trapezoidal Rule with T (0.1) = T (0.1 [ .2) = T (0.1877) + 0. .69377 .0 + 2(2.1) − T (0.2 and h2 = 0. 1 2 T (0.1 1 { (0.
25 1..25.666667 x 1.8 0.25) = 0.25 and h2 = 0.727273 0..125) − S (0.25)]= 0.875 2.5]= 0. k = 1.125 1.0 0.125 .125) + 1 [S (0.693254 1 3 0. Then approximate the integral ∫ 1 dx x by applying Romberg integration based on Simpson’s Rule with interval lengths h1 = 0 .African Virtual University 75 Example 3.125) = S (0. Romberg integration leads to the much more accurate value .75 1.533333 0.693155 1 3 S (0.125(k − 1). S (0...0 1.6931484 15 .125 [ .2.666667) + 0.371429) + 2(0.0 + 4(1.571429 0.5 With these values one finds: S (0.038096) + 0.3.4 Construct a table of values of the function f ( x) = 1 at the equidistant points x 2 xk = 1 + 0.25 [ . Solution Table 3.0 + 4(2.5 f (x) 1.375 1.125) = Using these two Simpson approximations of the integral.0.0 0.764880) + 2(2.2: Value of the function f ( x) = 1 x f (x) x 1.615385 0.5]= 0.625 1.888889 0.9 .
1] using the transformation x−a b− a = t +1 2 or x = a + b− a 2 (t + 1) and hence obtain the transformed integral on the right hand side of the equation ∫ b a f ( x)dx = b− a 1 ⎛ b− a ⎞ ∫−1 f ⎜ a + 2 (t + 1) ⎟dt 2 ⎝ ⎠ on which the Gaussian integration method can be applied. b] to [− 1. For functions f (x) defined over the range [− 1.African Virtual University 76 3.7 Gaussian Integration Methods Gaussian integration methods are derived from the general integration formula b ∫ a f ( x ) dx ≅ ∑W k =0 n k f ( x k ) by assuming that all the 2n + 2 parameters in the formula (the n + 1 nodes x k and their corresponding n + 1 weights Wk ) are to be determined so that the resulting integration formula gives exact values for all polynomial functions f (x) of degree at most 2n + 1 .1] Gauss developed a numerical integration formula 1 n ∫ −1 f ( x)dx = ∑ Wk f ( xk ) k =1 where the nodes are the roots of some special polynomial (Legendre orthogonal polynomials) which are symmetrically positioned about the origin and all the weighting coefficients are positive. The above mentioned restriction of the range of integration for the Gaussian integration methods is not a serious one because we can transform any finite interval [a. .
1] gives: x = t + 3 and dx = dt . 4 ] to t ∈ [− 1.577 350 0.347 855 0.774 597 0.000 000 0.000 000 0.238 619 0.2.568 889 0.360 762 0.861 136 0.236 927 0.4.661 209 0.652 145 0.906 180 0. Nodes and Weights for GaussLegendre Integration Method n Nodes Weights tk 1 2 3 Wk 1. We reproduce here a table of the weights and nodes for the Gaussian integration method based on Legendre polynomials for n = 1.5 Approximate the integral I = ∫ 4 dx 1 + x2 2 by the Gaussian integration method using the GaussLegendre nodes and weights for n = 4.467 914 0.171 324 ± ± ± ± ± ± ± 0.932 470 5 ± ± Example 3.538 469 0.African Virtual University 77 Extensive tables giving values of the Gaussian nodes and their corresponding weight for different values of n have been constructed ready for use in solving any given definite integral over a finite range.555 556 0.3.000 000 4 0.888 889 0.478 629 0.339 981 0.5. Solution With a = 2 and b = 4 the transformation of variables from x ∈ [ 2.
the true value of the integral is tan −1 (4) − tan −1 (2) = 1.073960 .478629. F (+0. W0 F (0) = 0.0585778 Adding the three products together gives the value I = 0.538469) = 0. ∫ .0568889 W1 = 0.906180)] = 0.061507 .4) 2 Approximate the integral e− x cos( x)dx by the Gaussian integration method −1 using the GaussLegendre nodes and weights for n = 4 . F (−0.236927.538469) + F (−0. F (0) = 0.325818 − 1.568889 .1032020 W2 = 0.185733 W2 [F (0.906180) + F (−0.218667 This is an astonishingly accurate result for.906180) = 0.218669 DO THIS (3.1 F (+0. F (−0.African Virtual University 78 ∫ 1 1 dx dt =∫ = ∫ F (t)dt 2 2 2 1+ x −1 1 + (t + 3) −1 4 Direct calculations yield the following values: W0 = 0.107149 = 0.538469) = 0.141660 W1 [F (0.906180) = 0.538469)] = 0.
D.African Virtual University 79 References for the Learning Activity Fox.2 the number of subintervals over the range [1.2) 2 is ln(2) = 0. (i) The exact value of the integral ∫ 1 dx (iii) The accuracy of both the trapezoidal rule and Simpson’s rule become more accurate as the interval length h gets smaller.3) 2 (i) It is not possible to apply Simpson’s rule on the integral h = 0. .2] of integration would be odd (5) while Simpson’s rule can only be applied when the number of subintervals is even. and Mayers. DO THIS (3. London (1958).F.1) (i) A trapezium is a quadrilateral which has a pair of parallel sides. x (ii) The approximation obtained using Simpson’s rule is more accurate (has a smaller error) than that obtained using the trapezoidal (trapezium) rule. ∫ 1 dx x using the interval (ii) The reason why it is not possible is because with h = 0. (iii) The area of a trapezium is given by: Area A = [L1 + L2 ]. . h DO THIS (3. Solutions To Formative Evaluation Questions DO THIS (3. L2 2 are the lengths of the parallel sides and h is the perpendicular distance between them. Computing Methods for Scientists and Engineers. L.Oxford University Press.693147 . (ii) The sides of a trapezium that determine its area are the pair of parallel sides. where L1 ..2 .
339981 − t2 = −0. t2 = 0. ⇒ F (t) = exp⎜1 − (t + 1) ⎟ cos⎜ (t + 1) − 1⎟.967614 2 .347855.861136 −1 ∫e −x cos( x)dx = 3 [(F (t1 ) + F (−t1 ) )W1 + (F (t2 ) + F (−t2 ) )W2 ]= 1.861136. ⇒ dx = dt 2 2 ⎝ 2 ⎠ ⎝2 ⎠ One uses the following nodes and weighting coefficients W1 = 0.652145. One finds 2 t1 = 0.339981.4) 2 The integral 1 −1 ∫e −x cos( x ) dx is first transforusing the change of variables: med into −1 ∫ F (t) dt x= 3 3 ⎛ 3 ⎞ ⎛3 ⎞ (t + 1) − 1. W2 = 0. − t1 = −0.African Virtual University 80 DO THIS (3.
Also. Mathworld gives a detailed reference in all cases. In this learning activity we shall discuss a frequently occurring problem in mathematics: the root finding problem for either a nonlinear equation f ( x) = 0 involving a single independent variable x or for a coupled system of two nonlinear equations f ( x. derive and apply the Newton Raphson method and also derive and apply Newton’s method for a coupled system of nonlinear equations. y ) = 0 .com Students should search for the entry covering the unit title. Also. y ) = 0 in two independent variables ( x. they can be easier to read. g ( x. Wikipedia (visited 03.org/wiki As with mathworld. At the end of our presentation we discuss briefly the concept of fixed points of a function and the theorems which guarantee their existence and uniqueness and relate these results to the root finding problem in a manner which allows the learner to derive her/his own convergent iteration methods. y ) .07) http://en.07) http://mathworld. derive and apply both the Secant method and the Regula Falsi method.African Virtual University 81 Learning Activity # 4 Roots of Functions Summary This is the fourth and final learning activity for this module. students should search for the entry covering the unit title. List of required readings Wikipedia: Numerical Methods/Equation Solving List of relevant useful links Wolfram MathWorld (visited 03. apply and prove that the bisection method always converges. search for any key words in the text.04. search for any key words in the text.04. . However. Wikipedia generally gives shorter and less complete entries. At the end of this learning activity the learner is expected to be able to derive.wolfram.wikipedia.
standrews. This gives a helpful overview of the importance and context of the topic being studied. .03. Fixedpoints of a function: A value of x for which the function has the same value of x (e. f(2)=2) Intermediate value theorem for continuous functions: A continuous function takes all values lying between two values of the function.uk/Indexes The MacTutor Archive is the most comprehensive history of mathematics on the internet. Key Words. Students should search for their unit title and read the history of the subject.07) http://wwwhistory.African Virtual University 82 MacTutor History of Mathematics (visited 03.g.mcs.ac. Theorems [Full definitions are given in the text] Root or zero of a function: A value of x at which the function has a value of zero.
y ) = 0 . the function f (x) . We prove that the method is always convergent. 4. x = x3 are all roots of x1 x2 x3 x y = f (x) Figure 4.African Virtual University 83 Learning Activity : Roots of Functions 4. The NewtonRaphson method is presented last and is shown to be a generalized form of the Secant and Regula Falsi methods. The Secant method is immediately presented after the Regula Falsi method because the two methods share a common mathematical formula. The bisection method will be derived. y ) = 0.1 Introduction Five numerical methods for finding roots of functions will be presented in this learning activity.2 Roots or Zeros of a Function For a function of a single independent variable y = f (x) . a point x = ρ is called a root or a zero of f (x) if the value of the function is zero at the point. g ( x.1 the points x = x1 . However. which has a significant similarity with the bisection method but converges slightly faster. This will be followed by the method of Regula Falsi. y f ( x1 ) = 0 f ( x2 ) = 0 f ( x3 ) = 0 x = x2 . meaning.1: Roots of a Function f (x) . f ( ρ ) = 0 In Figure 4. the Secant method is computationally more efficient. The first four methods are for solving the nonlinear equation f ( x) = 0 The fifth method is for solving a coupled system of two nonlinear equations in two variables f ( x.
African Virtual University 84
4.3
Numerical Methods
(a) The Bisection Method The bisection method for approximating roots of functions is a typical example of an iteration method. In its simplest form, an iteration method may be defined as a repetitive process of applying a function g (x) on one or several previous approximate values x n −1 … to produce a new and hopefully more accurate approximation x n of the specific quantity being sought. In mathematical symbolism we write
xn = g( xn−1 , xn− 2 , xn−3 ,...)
The bisection method is based on the intermediate value theorem for continuous functions. If f (x) is continuous on an interval [a, b] and if the values f (a ) and
f (b) differ in sign, ( f (a ) f (b) < 0 ), then the equation f ( x) = 0 has at least one
real root ρ ∈ [ a , b] . Assuming that the points a and b were chosen to contain only one root we can
1 (a + b) and conclude 2 that the root lies either in the interval (a, c) or in the interval (c, b) provided that
bisect the interval [a, b] into two halves at the point c = f ( c ) ≠ 0 , in which case c is the required root. The Bisection method repeats the process of bisecting the interval which contains the root ρ until we are satisfied that we are close enough to the root. The above process can be summed up by the following algorithm (Kendal E. Atkinson, 1989 pp 56).
African Virtual University 85
A lgor ithm “ B isect ( f ( x),
a,
b,
ρ,
ε )”
Steps: 1. Set x1 := a and x 2 := b 1 2. Define x3 = [x1 + x2 ] 2 3. If x 2 − x3 ≤ ε , then accept ρ = x3 and exit. 4. If f ( x2 ) f ( x3 ) ≤ 0 then x1 := x3 ; otherwise x 2 := x3 . 5. Go back to step 2.
Convergence of the Bisection Method Convergence of any iteration method implies that the error in the approximation is tending to zero as the number of iteration increases. For the Bisection method, the absolute value of the error is bounded by the length of the interval in which the root lies at that particular stage. Error bound after 1st bisection
ρ − x3 = ε 1 ≤ ρ − x4 = ε 2 ≤
1 [b − a ] 2
.
Error after 2nd bisection
1 ⎛b− a ⎞ b− a ⎜ ⎟= 2 2⎝ 2 ⎠ 2 1 ⎛b− a ⎞ b− a ⎜ ⎟= 3 2 ⎝ 22 ⎠ 2
Error after 3rd bisection
ρ − x5 = ε 3 ≤
Error after n th bisection
ρ − x6 = ε n ≤
1 ⎛b− a ⎞ b− a ⎜ ⎟= n 2 ⎝ 2 n−1 ⎠ 2
lim ε n Because lim ∈n = lim⎜
nn→ ∞ →∞
⎛b− a ⎞ = 0 we conclude that the bisection method always n ⎟ n→∞ ⎝ 2 ⎠
converges. Example 4.1 Verify that the function f ( x) = x 2 + 4 x − 10 has a root inside the interval (1,2) and use the limits of the interval as starting values of the bisection method to approximate the root in 10 bisections.
African Virtual University 86
Solution We evaluate the function at the two end points of the given interval and find f (1) = − 5 and f (2) = 2 . Since f (x) is a continuous function and f (1) f (2) < 0 , the intermediate value theorem asserts that f has at least one root in the interval 1 ≤ x ≤ 2 . We can therefore carry out the bisection method to find the results tabulated hereunder.
Table 4.1: Bisection Method for the function f ( x) = x 2 + 4 x − 10
n
a
1
f (a )
5 1.75 1.75 0.859375 0.402344 .170898 0.054443 0.054443 0.025248 0.010642 0.003333
b
2 2 1.75 1.75 1.75 1.75 1.75 1.742188 1.742188 1.742188 1.742188
f (b)
2 1.5 0.0625 0.0625 0.0625 0.0625 0.0625 0.003971 0.003971 0.003971 0.003971
c
1.5 1.75 1.625 1.6875 1.71875 1.734375 1.742188 1.738282 1.740235 1.741212 1.741700
f (c)
1.75 0.0625 0.859375 0.402344 0.170898 0.054443 0.003971 0.025248 0.010642 0.003333 0.000319
1 2 3 4 5 6 7 8 9 10
1.5 1.5 1.625 1.6875 1.71875 1.734375 1.734375 1.738282 1.740235 1.741212
The sequence of values under the ccolumn in the table is convergent. The true value of the root being approached by this sequence (use the quadratic formula) is ρ = 1 .741657 ...
DO THIS (4.1)
Verify that the function f ( x) = x − cos( x) has a root in the interval [0,1] and hence apply the bisection method, in only five iterations, to approximate the root. (b) The Regula Falsi Method The Bisection method we have just presented was a bit wasteful. In it one spends great efforts at calculating values of the function f at two points which are only used for deciding in which subinterval the root lies but are never used in the actual calculation of the approximate value of the root.
The general approach for this and subsequent methods (Secant method and the Newton Raphson method) is to replace the curve of y = f (x) in the interval where the root lies by the straight line joining the two points. y = f1 + f 2 − f1 ( x − x1 ) x2 − x1 Figure 4. The equation of the secant line joining the two points A( x1 . The method retains the principle of enclosure characteristic of the Bisection method but also makes direct use of the function values at the two points which enclose the root of the function.African Virtual University 87 The method known as Regula Falsi (or rule of false position) rectifies this anomaly. x 2 ] .2 Regula Falsi Method y B Secant x1 x3 x2 x A This line intersects the xaxis at the point with coordinates ( x3 . let the root ρ lie in the interval [ x1 . Specifically.0) where . f 2 ) is . f 1 ) and B ( x 2 .
x 2 ) in only four (4) iterations.741627 1. Go back to step 1. the Regula Falsi assumes that the two values x1 and ⎡ x − x1 ⎤ x1 f 2 − x2 f1 x3 = x1 − ⎢ 2 ⎥ f1 = f 2 − f1 ⎣ f 2 − f1 ⎦ x 2 enclose the root being sought by requiring that f1 f 2 < 0 and at the same time involves the same function values in calculating a new approximation to the root.006857 0.741657 f ( x3 ) 0.204080 0. The above process can be repeated several times in an iterative process using the following algorithm.2 x1 := x3 . ρ.740741 1.740741 1.741627 1.714286 1.000010 0.000227 0. ε )” 1.000003 . otherwise x 2 := x3 .204080 0. If x1 − x 3 ≤ ε and x 2 − x 3 ≤ ε then accept ρ = x 3 and exit. Table 4. Algorithm “Regula Falsi ( f ( x).741656 f ( x1 ) 5 0. x 2 = 2 apply the Regula Falsi method on the function f ( x) = x 2 + 4 x − 10 to obtain an approximate value of the root enclosed in the interval ( x1 .2: The Regula Falsi Method for the function f ( x) = x 2 + 4 x − 10 n x1 1 1 2 3 4 1. Example 4.006857 0.714286 1. ⎡ x2 − x1 ⎤ ⎥ f1 ⎣ f 2 − f1 ⎦ 3.741656 1. Deine x3 = x1 − ⎢ 2. Starting with the values x1 = 1. Steps: a. If f 2 f 3 ≤ 0 then 4.000010 x2 2 2 2 2 2 f ( x 2 ) x = x1 f 2 − x 2 f 1 3 f 2 − f1 2 2 2 2 2 1.000227 0. b.African Virtual University 88 Unlike the Bisection method.
.741657387. In a programmed algorithm. x1 . demonstrates the faster convergence of the Regula Falsi method compared to the Bisection method.African Virtual University 89 Examination of the values of x3 against the background of the exact value of the root ρ = 1. The only difference is that in the Secant method the requirement that the two values x1 and x 2 must enclose the root is dropped.. Define x3 = x1 − ⎢ ⎡ x2 − x1 ⎤ ⎥ f1 f 2 − f1 ⎦ ⎣ 5. Observation The requirement in both the Bisection and the Regula Falsi methods that the two values involved in the calculations. Steps: a. . All one needs is to require the two values used in the computation be close enough to the required root. 6. As a result. Otherwise set x1 := x 2 and x 2 := x3 7. Algorithm “Secant Method ( f ( x). Our next method achieves just that. efforts have been made to do without it. x 2 must enclose the root is computationally very restrictive and significantly reduce the efficiency of both methods. (c) The Secant Method The Secant method is essentially the same as the Regula Falsi method. If x1 − x 3 ≤ ε and x 2 − x 3 ≤ ε then accept ρ = x 3 and exit. ρ. Go back to step 1. The algorithm for the Secant method is as given hereunder. ε )” 1. b. the process of checking whether or not f ( x1 ) f ( x 2 ) < 0 is time consuming.
x1 = 1 . perform 5 iterations using the secant method to ap proximate the root of the function f ( x) = x − cos( x) .2) Starting with x0 = 0 . the graph of the function y = f (x) is approximated by the tangent to the curve at the point. (d) The NewtonRaphson Method The Newton Raphson method is by far the most popular numerical method for approximating roots of functions.axis at the point x1 whose value is f ( x0 ) f / ( x0 ) x1 = x 0 − . The method assumes that the function f (x) is differentiable in the neighborhood of the root and that the derivative is not zero anywhere in that neighborhood. Assuming that x0 is a point which is sufficiently close to the root of the function. f ( x0 ) on the curve y = f (x) is y = f 0 + ( x − x0 ) f / ( x0 ) This tangent intersects with the x . y Fig ure 4.African Virtual University 90 DO THIS (4.3: Newton Rap hson M ethod x1 x2 x Tangent The equation of the tangent through point ( x0 .
Example 4. given by x 2 = x1 − f ( x1 ) f / ( x1 ) is also accepted as a new approximation to the root. f / ( xn ) n = 0. Compared to the previous three numerical methods. f ( x1 ) can be taken as a new point to draw a tangent through.3 Starting with x0 = 1 approximate a root of the function f ( x) = x 2 + 4 x − 10 correct to 6 decimal places.2.. The point ( x1 . Solution f ( x) = x 2 + 4 x − 10 f / ( x) = 2 x + 4 = ( x + 4) x − 10 The requirement that we obtain an answer correct to 6 decimal places simply means that we carry out the iteration until the 7th decimal digit in the values being calculated is no longer changing.. the Newton Raphson method converges very rapidly to the root.African Virtual University 91 The value x1 is then accepted as a new approximation to the root.1.. This process can be repeated over and over. Each iteration using the Newton Raphson method requires one function evaluation and one first derive evaluation. Its intersection with the x . .axis. leading to the iteration method given by the NewtonRaphson formula xn+1 = xn − f ( xn ) .
y ) = 0.4855072 7. y) ≡ x 2 + y 2 − 6 = 0 .741657 DO THIS (4.741 657 5 1. we are looking for the pairs of values ( x.741 657 5 f ( xn ) ( x n + 4 ) x n − 10 5 0.741 657 5 f ( xn ) f / ( xn ) 0 1 2 3 Because the value of the function at x3 is for all purposes zero. A typical example of such a system is to find the coordinates of the point in the first quadrant where the parabola y = 2 x 2 − 7 intersects with the circle x 2 + y 2 = 6 .0082045 0 f / ( xn ) 2 xn + 4 6 7. Here.6666666 7.833 333 3 1.African Virtual University 92 Table 4. y ) = 0 .833 333 3 1.3: The NewtonRaphson Method for the function f ( x) = x 2 + 4 x − 10 n xn 1 1. 4.4 Newton’s Method for a Coupled System Our fifth and last numerical method will focus on solving a system of two simultaneous nonlinear equations of the general form f ( x. The true value of the root to the same degree of accuracy is ρ = 1 . g( x.6944442 0.742 753 6 1.742 753 6 1. y ) which satisfy the two nonlinear equations f ( x.3) Starting with x0 = 0 apply the NewtonRaphson method in only four iterations to approximate the root of the function f ( x) = x − cos( x) .483315 xn+1 = xn − 1. g ( x. y) ≡ 2 x 2 − y − 7 = 0. we can conclude that the required approximation is x = 1.741657 rounded to six decimal places.
. y0 ) + . and hence. ∂x ∂y where we have deliberately left out all higher order terms and retained only the terms linear in the increments h and k . y0 + k ) = f ( x0 . y0 ) + h ∂f ∂f ( x0 .African Virtual University 93 To obtain a NewtonRaphson type method for approximating the solution of the general problem stated above. we let ( x0 . such that α = x0 + h . y 0 ) = 0 ∂x ∂y ∂g ∂g ( x0 . y 0 ) one gets 0 = f ( x0 + h. y0 ) + h ∂f ∂f ( x0 . y0 ) + . f ( x0 + h.. y 0 + k ) = 0 . . y0 + k ) = g( x0 . Expanding f and g in a Taylor Series about the point ( x0 . y 0 ) + k ( x0 .. y1 ) we assume that the exact coordinates of the point are obtained by making adjustments h and k to our initial values. y1 = y 0 + k . y0 ) + h g( x0 + h. β ) of the coupled system. y 0 + k ) = 0 g ( x0 + h. We denote the values of x and y which satisfy the above pair of equations with x1 = x0 + h . β = y 0 + k . y0 + k ) = g( x0 . y0 ) + h 0 = g( x0 + h. y 0 ) + k ( x0 . y 0 ) + k ( x0 . y 0 ) be an approximation to the exact solution (α .. y0 + k ) = f ( x0 . To obtain an improved solution ( x1 . ∂x ∂y ∂g ∂g ( x0 . y0 ) + k ( x0 . y 0 ) = 0 ∂x ∂y but x0 + h ≠ α and y0 + k ≠ β . If we truncate the series on the right hand side of each equation after the linear terms we still get f ( x0 + h.
African Virtual University 94 Solving the resulting system of two linear equations: f ( x0 . and so on in an obvious iterative manner. Dh . y 0 ) = 0 ∂x ∂y for the unknown value h and k The values of h and k are found to be h= Dh . y 0 ) + h g ( x0 . D h = ∂x ∂g ∂g ∂y ∂x ∂f ∂x D= ∂g ∂x ∂f −f ∂y . . y 0 ) + h ∂f ∂f ( x0 . y 0 ) + k ( x0 . y1 ) can now be repeated using the new pair ( x1 . Dh = ∂g −g ∂y −f −g in which all the quantities (function values and partial derivatives) which appear therein are evaluated at the point ( x0 . the values of the new approximate solution ( x1 . y 2 ) to lead to a new approximate solution ( x 2 . y1 ) can be calculated . y 2 ) . y 0 ) + k ( x0 . D k= Dk D where D. The above analysis carried out using the initial approximate solution (x1 . Dk are the three determinants ∂f ∂f ∂y . y 0 ) . and so on. Once these quantities have been calculated. y 0 ) = 0 ∂x ∂y ∂g ∂g ( x0 .
850781 The corresponding values for x are found to be x (1) = ±2. ∂y ∂f = 4 x. y) ≡ x 2 + y 2 − 6 = 0 (b) Perform two iterations with Newton’s method to approximate a solution of the coupled pair of equations which is believed to lie close to the point (2. y) ≡ 2 x 2 − y − 7 = 0.4 (a) Using analytical methods find the true solutions of the coupled system of equations f ( x) = 0 . f ( x.350781. y) = x 2 + y 2 − 6 ∂g = 2 x. g( x. y ( 2 ) = −1. and substituting this expression of x 2 into the equation f ( x. Its speed of convergence is the same as its counterpart in solving the single nonlinear equation Example 4. ∂x ∂g = 2 y. ∂y . g( x. Solution (a) Solving the equation g ( x. ) = 0 for x 2 one gets x 2 = 6 − y 2 .604559 (b) f ( x. x ( 2 ) = ±1.African Virtual University 95 The method described above is known as Newton’s method for a system of simultaneous nonlinear equations.1) . ∂x ∂f = −1. y ) = 0 one gets 2 6 − y 2 − y − 7 = 0 2 This leads to the quadratic equation 2 y + y − 5 = 0 [ ] Whose roots are y (1) = 1.043377. y) = 2 x 2 − y − 7.
y0 ) = 8. ( x1 . y0 ) = −1. y0 ) = 4. Dk = 8 k= Dk = 0.African Virtual University 96 First Iteration x0 = 2. D x1 = x0 + h = 2. h= ∂f ( x1 . y2 = y1 + k =1.048485 D Dh = −0. g( x1 .4 D Dh = 0. y0 ) = 0. y0 = 1 ∂f ( x0 . y1 ) = 2 . D = 20.351515 . y1 ) = 8.05. g( x0 .05. ∂x D h = 1.1765. D = 27.06.043477. 4 f ( x1 . y 0 ) = 2 ∂y f ( x0 .005. D k = −1.312 k= Dk = −0.1625.4 Second Iteration x1 = 2 . y1 ) = 0.1. y1 ) = −1 ∂y ∂g ∂g ( x1 .8 ∂x ∂y D h = −0.2.006523. y1 = 1 . D x2 = x1 + h = 2. h= ∂g ( x0 . y1 ) = 0. y1 ) = 4. y1 = y0 + k =1. ∂x ∂f ( x1 . y0 ) = −1 ∂y ∂g ( x0 .05 . ∂x ∂f ( x0 .
At such a point x = ρ we have. then g (x) has h( ρ ) = g( ρ ) − ρ = 0 which implies g ( ρ ) = ρ a result which implies that g (x) has a fixed point ρ ∈ ( a . . (a) Existence Theorem If g (x) is continuous over [a. b] and g ( x ) ∈ [ a . We define a function h( x ) = g ( x ) − x for x ∈ [ a . b] at least one fixed point in [a. The mathematical problem of finding values of x which satisfy the equation x = g (x) is called the fixed point problem.4) . or both are fixed points of g (x) . By evaluating h(x) at x = a and x = b we find h( a ) = g ( a ) − a > 0 . However.4) Perform 2 iterations with Newton’s method to approximate the solution of the coupled system of equations x − x2 − y2 = 0 y − x2 + y2 = 0 (4. b] . if g ( a ) ≠ a and g (b) ≠ b then from the assumption g ( x ) ∈ [ a . the function g (x) satisfies a < g ( x) < b . b] . b) . Proof If g (a ) = a or g (b) = b then the proof is complete because then. b] made above. a or b . b] To prove this theorem we need the Intermediate Value Theorem for continuous functions. ∀ x ∈ [ a .0. the function h(x) is also continuous over [a. b) . b] .5) Definition that lies near the point with coordinates (0. The intermediate value theorem asserts that the function h(x) must vanish (have zero value) at an intermediate point ρ ∈ ( a . h(b) = g(b) − b < 0 . Like g (x) .African Virtual University 97 DO THIS (4. FixedPoint Iterations A number ρ is called a fixed point of a function g (x) if g ( ρ ) = ρ .8.
ρ 2 with ρ 1 ≠ ρ 2 . where ξ ∈(ρ1 . (c) Relationship between Root finding and Fixed point Problems We introduced the concept of a fixed point for the purpose of using it in solving our rootfinding problem. ρ2 ) By taking absolute values on both sides of this equation and observing the above condition on g / ( x) we find ρ 2 − ρ1 = g / (ζ )( ρ 2 − ρ1 ≤ K ρ 2 − ρ1 < ρ 2 − ρ1 This is a contradiction which can only result from the assumption we made that ρ 1 ≠ ρ 2 .African Virtual University 98 (b) Uniqueness Theorem The above theorem establishes the existence of at least one fixed point. the function g (x) has a unique (only one) fixed point. The relationship between the two problems is simple. b) dg = K <1 dx Then. Then. g (x) has a unique fixed point in (a. b) and its derivative satisfies the condition Max ( a . To guarantee that there is only one fixed point we have the following theorem. b) . g ( ρ 1 ) = ρ 1 and g ( ρ 2 ) = ρ 2 . Proof Assume that g (x) has two different fixed points: ρ 1 . Through subtraction and using the Mean Value Theorem for differentiation we get ρ 2 − ρ1 = g( ρ 2 ) − g( ρ1 ) = g / (ξ )( ρ 2 − ρ1 ) . We therefore conclude that under the stated assumptions. There could therefore be several fixed points. . If in addition to the assumptions made above. the function g (x) is differentiable in (a.
2] For our purposes we shall be interested in finding the root that lies in [1.−5] . We shall demonstrate the splitting process on a typical example. Let us assume that we are able to express (split) the function f (x) in the form f ( x) = x − g ( x) .5 Consider the rootfinding problem f ( x) ≡ x 2 + 4 x − 10 = 0 . If ρ is a root (zero) of f (x) then f ( ρ ) = ρ − g( ρ ) = 0 ⇒ ρ − g( ρ ) = 0 ⇒ g( ρ ) = ρ This result implies that the roots of f (x) are the fixed points of g (x) . It is obvious that this splitting can be done in many ways. Such a splitting must result in a function g (x) which has a unique fixed point in a given interval. The equation x 2 + 4 x − 10 = 0 can be written in many different ways. (i ) (ii ) (iii ) x 2 = 10 − 4 x x( x + 4) = 10 4 x = 10 − x 2 .2] . Example 4. [1. What we now need to do is to find the best splitting of the function f (x) .African Virtual University 99 In the rootfinding problem we want to find all values of x which satisfy the equation f ( x) = 0 . The particular choice of g (x) will be critical in converting the rootfinding problem into a useful fixedpoint problem. Using the Intermediate Value Theorem we can show that f (x) has roots in the intervals [−6. The following are but a few alternate ways of expressing the equation.
African Virtual University 100
We solve each of these three equations for x and get
(i ) (ii ) (iii )
x = 10 − 4 x x=
:= g1 ( x)
10 := g 2 ( x) x+4 10 − x 2 x= := g3 ( x) 4
These are three possible fixedpoint problems for the given rootfinding problem given above. The question is which one of these fixedpoint problems is most suited for solving the rootfinding problem? To answer this question we find which of the three fixedpoint functions
g1 ( x) ,
g 2 ( x) ,
g 3 ( x) satisfies the criteria stated by the uniqueness theorem with
respect to the root in [1,2] . Using direct substitution we find that
g1 (1) = 2.45, g 2 (1) = 2.00, g3 (1) = 2.25,
g1 (2) = 1.41 g 2 (2) = 1.67 g3 (2) = 1.50
From the above results we conclude that, only g 2 ( x) satisfies the existence criteria. Questions Why do the other two functions fail the test? Does g 2 ( x) satisfy the uniqueness criteria? The Learner is expected to answer the first question by checking whether or not answer the second question we note that
g1 ( x) , g 3 ( x) meet the existence criterion for possessing a fixed point in [1,2] . To
⎡ 10 ⎤ / g 2 ( x) = − ⎢ ; 2 ⎥ ⎣ ( x + 4) ⎦
⇒ g 2 (1) = −0.40,
/
g 2 (2) = −0.28
/
African Virtual University 101
Since
Max
(1, 2 )
dg2 = 0.4 < 1 dx
we conclude that g 2 ( x) has a unique fixed
point ρ ∈ (1, 2 ) which is automatically a root of the function f (x) . Approximation of the root The root ρ can be approximated iteratively using the iteration
xnn+1 = g2 ( xn ) = x + 1 = g(x n ) =
value x0 = 1.0 n 0 1 2 3 4 5 6 7 8 9 10
10 10 ; n = 0,1,2, ..., n for any starting value x0 taken 4 + xnn 4 from the interval (1,2) The following ten iterates were obtained using the starting .
xn
1.000 000 2.000 000 1.666 667 1.764 706 1.734 694 1.743 772 1.741 016 1.741 852 1.741 598 1.741 675 1.741 652
g 2 ( xn )
2.000 000 1.666 667 1.764 706 1.734 694 1.743 772 1.741 016 1.741 852 1.741 598 1.741 675 1.741 652 1.741659
We note that the last value g 2 ( x10 ) = 1.741659 is very close to the true value of the root of f (x) which is ρ = 1 .741657 rounded to 6 decimal places.
African Virtual University 102
DO THIS (4.5)
(i) Show that the function g ( x) = cos( x) satisfies the conditions for the existence of a unique fixed point inside the interval [0,1] . (ii) Use the result obtained in part (a) to find in only ten iterations, the point of intersection of the two curves y = x, with x0 = 1 .
y = cos( x) . Start the iteration process
Reference for the Learning Activity
Kendall E. Atkinson, An Introduction to Numerical Analysis,  John Wiley & Sons, Second Edition (1989).
f (1) = 0. f1 = 0.7 5 x 4 = 0.1) The bisection method .459698 . One obtains the following iterates: x1 = 1.1) Application of the bisection method in 5 iterations on f ( x) = x − cos( x) f (0) = −1.1] and f (0) f (1) < 0 .71875 f ( x0 ) < 0 f ( x1 ) > 0 f ( x2 ) < 0 f ( x3 ) > 0 f ( x4 ) < 0 f ( x5 ) < 0 f ( x6 ) < 0 DO THIS (4.5 x3 = 0.2) Application of the secant method in 5 iterations on f ( x) = x − cos( x).459698 . then by the Intermediate Value Theorem for continuous functions it follows that f (x) has at least one root in the interval (0. gives the following iterates: x0 = 0 x1 = 1 x 2 = 0.6875 x6 = 0. n−1 Formula to be used: xn+1 = xn−1 − ⎜ n ⎜ f − f ⎟ f n−1 ⎟ n−1 ⎠ ⎝ n ⎛x −x ⎞ Starting values given: x0 = 0 .625 x5 = 0. ⇒ f 0 = −1.African Virtual University 103 Solutions To Formative Evaluation Questions DO THIS (4. Because f (x) is continuous over [0.
f y = −2 y g( x.410979 .000683 f 6 = +0. f ( x1 ) = +0.007979 f 5 = −0.000047 f / ( x0 ) = 1. f / ( xn ) Starting value given x0 = 0 .739113 .750364 .8 . x4 = 0. ⇒ g x = −2 x . f ( x3 ) = +0.459698 .4 .000000 . y) = y − x 2 + y 2 .018923 .000000 f / ( x1 ) = 1. x4 = 0. x1 = 1. x6 = 0.685073 .000000 DO THIS (4.739085 . x5 = 0. f ( x2 ) = +0. g y = 1 + 2 y Starting values x0 = 0. f 2 = −0.505751 f 4 = +0.738677 . x2 = 0. DO THIS (4.000000 . f / ( x) = 1 + sin( x) One gets the iterates x0 = 0.4) f ( x0 ) = −1. y) = x − x 2 − y 2 .841471 f / ( x2 ) = 1.089300 f 3 = −0.3) Application of NewtonRaphson’s method in three iterations on f ( x) = x − cos( x) Formula to be used is xn+1 = xn − f ( xn ) .681905 f ( x.African Virtual University 104 x2 = 0. y 0 = 0.000000 . ⇒ f x = 1 − 2x . x3 = 0.743847 .
0 The following iterates are obtained .1] Checking existence of a fixed point g ( x ) is continuous over [ 0.5) Given: g ( x ) = cos( x ) . ⇒ Therefore the existence criterion is fulfilled.459698 .African Virtual University 105 First iteration x1 = 0.1] . Computations xn+1 = g( xn ) = cos( xn ) Starting value: x 0 = 1 .1] ∀x ∈ [0.420339 y 2 = 0. x ∈ [ 0.772881. DO THIS (4.771846 . g(0) = −1. g(1) = 0. Checking uniqueness of a fixed point g( x) ∈ [0.1] Therefore the uniqueness criterion is fulfilled.419644 x 2 = 0.1] g / ( x) = − sin( x)  g/ (x) < 1 ∀x ∈[0. Second iteration y1 = 0.
763960 x7 = cos( x6 ) = 0.793480 x5 = cos( x4 ) = 0.731404 x10 = cos( x9 ) = 0.540302 x2 = cos( x1 ) = 0.744237 .701369 x6 = cos( x5 ) = 0.654290 x4 = cos( x3 ) = 0.722102 x8 = cos( x7 ) = 0.African Virtual University 106 x1 = cos( x0 ) = 0.857553 x3 = cos( x2 ) = 0.750418 x9 = cos( x8 ) = 0.
depending on whether one has underestimated or overestimated the true value of the quantity Q being approximated. theorems and principles relevant to the module. which is defined by: Absolute error in X * = X − X * . one introduces the concept of absolute error. to give the learner an opportunity to have a glimpse at what lies ahead in terms of the general framework and contents of the module we list here. In order to ignore the sign and concentrate on the size of the error.African Virtual University 107 XI. Error in an approximation Let X be the exact (true) value of some quantity Q and X * be an approximate value of Q obtained through some numerical process. all the key concepts. Relative error The absolute error gives the size of the error and thereby serves as a measure of the accuracy of the approximation X * . Reproduction of these concepts under their respective learning activities is meant to enhance the learner’s understanding and appreciation of their importance in the overall understanding of the course. The difference (deviation) between the exact value X and its approximation X * is called the error in X * . by not relating the error to the true value being approximated one may not be able to gauge the seriousness of the error. what matters more is the size of the error rather than its sign. However. This is defined by: Relative error in ( X * ) = X −X X * provided that X ≠ 0 . Percentage . a priori. 1. 3. Absolute error The error in an approximation may be positive or negative. theorems and principles specific to its contents. To achieve this one introduces the concept of relative error or percentage error. In practice. and is denoted by Error ( X * ) = X − X * 2. Compiled List of all Key Concepts (Glossary) Key Concepts Each of the (four) learning activities has key concepts. However.
.2.1.3...... X Since the true value X is normally not known. one replaces it with the approximate value X * in the denominator of the relative (percentage) error. Geometric progression. k = 1. k = 1. Limit of a function A function f (x) is said to approach the value (have the limit) L as x approaches a value c in the domain of f . Except for the first element. A geometric progression (GP) is a special sequence { n }: n = 0. a The essential elements of such a sequence are its first element a 0 and a constant multiplication factor r ≠ 1 .2. Arithmetic progression An arithmetic progression (AP) is a special sequence { n }: n = 0.. and we write such that whenever lim f (x) = L x→ c if for every choice of a small positive number ε one can find a corresponding small positive number δ (ε ) x − c < δ (ε) then f (x) − L < ε . Essentially this statement .African Virtual University 108 error in ( X * ) = 100 % provided that X ≠ 0 ..1. of numbers. The sum of the first n terms of an AP is easily shown to be Sn = na0 + 1 n(n − 1) 2 5.3. of numbers.2...2. ⎡ r n − 1⎤ a 0 r k −1 = a 0 ⎢ ∑ ⎥ k =1 ⎣ r −1 ⎦ n The sum of the first n terms of a GP is S n = 6. X −X * 4... a The essential elements of such a sequence are its first element a 0 and a constant difference d . the k − th element of the sequence is given by a k = a 0 r k −1 . Except for the first element. the k − th element of the sequence is given as a k = a 0 + (k − 1)d .
African Virtual University 109 implies that values of the function f (x) will be arbitrarily close to the number L provided the corresponding values of x are close enough to point c . For this reason. that is lim ⎢ Δx →0 df dx Δf f ( x + Δx) − f ( x) = as the change Δ x in x tends Δx Δx . 9. Essentially. the process of finding an antiderivative of f (x) is the reverse process to that of differentiating a function. lim f (x) = L (iii) The limit must be equal to the function value: f (c) = L 8. 7. for f (x) to be continuous at point x = c the following three conditions must hold: (i) The function must be defined at the point: (ii) The function must have a limit at the point: x → c f (c) must exist. Symbolically one writes F ( x ) = ∫ f ( x ) dx . If the limit exists one denotes it by ⎡ f ( x + Δx) − f ( x) ⎤ ⎥ Δx ⎣ ⎦ or f / ( x) and calls it the first derivative of f . one also speaks of antidifferentiation when finding F (x) . . F has the property that its derivative must be the function f (x) . meaning that F / ( x) = f ( x) . Antiderivative An antiderivative of a function f (x) is itself a function F (x) The function . that is if lim f (x) = f (a) x→ c . Essentially what this definition of continuity implies is that. Continuity A function f (x) is said to be continuous at a point x = c if the limit of the values f (x) is the value f (c) . Derivative The derivative of a function f (x) at an arbitrary point x in its domain is the limit of the difference quotient to zero.
b] any value x = ρ which satisfies the relation g ( ρ ) = ρ is called a fixed point of the function g (x) . The individual members (elements) of the set must be unambiguously defined.African Virtual University 110 10. Essentially a set is a special function defined over the set of natural (counting) numbers N or over a subset of N . . Fixed point of a function Given a continuous function g (x) over a closed interval [a. A set { n } is said to converge to a limit L if a for every ε > 0 one can find a corresponding positive integer number N (ε ) such that a n − L < ε if only n > N (ε ) . The secant equation is x2 − x1 used in deriving the Regula Falsi and the Secant methods for approximating roots of functions. 12. y 2 ) and is given by the equation y = y1 − y2 − y1 ( x − x1 ) . The process of finding fixed points of a function is closely related to that of determining roots of functions. Convergence of a sequence A sequence of numbers. 11. written { n } is a well defined and ordered finite or infinite a set of numbers. y1 ) and Q ( x 2 . Secant line A secant is a line which passes through two given points P ( x1 .
the bisection method and the Regula Falsi (Rule of false position). b] and differentiable on (a. ϑ ) . c] if h is negative). This theorem is the basis upon which two important numerical methods for finding roots of a function f (x) . Taylor’s Theorem Let f be a function whose first n derivatives are continuous on the closed interval [c. b] and is differentiable on the open interval (a. then there is at least one number c in (a. then F ( x) is continuous on [a. c] if h is negative) and assume that f ( n +1) exists in [c. b) such that f (c) = k . b) . then there exists at least one value of x = c ∈ (a . c + h] (or [c + h. b] and F ( x) = f (t)dt for each x in [a. Mean Value Theorem of Differentiation (MVT) If f is a continuous function on the closed interval [a. 2. b] . c + h] (or [c + h. b) such that f / ( c ) = f (b) − f ( a ) b− a .African Virtual University 111 Key Theorems and Principles 1. b) and ∫ x a . Fundamental Theorem of Calculus If f is continuous on [a. Then. there exists a number ϑ . with 0 < ϑ < 1 such that f (c + h) = ∑ hk ( k ) f (c) + R n+1 (h. 3. k = 0 k! n R n+1 (c. Intermediate Value Theorem If f is continuous on a closed interval [a.ϑ ) = h n+1 f ( n+1) (c + ϑh) (n + 1)! 4. b] and if k is any number lying between the two values f (a ) and f (b) .
5.African Virtual University 112 dF = f ( x) . F ( x) is an antiderivative of f ( x) . b] ∀ x ∈ [ a . . In other words. b). b) . dx Corollary: If f ( x) is continuous on a closed and bounded interval [a. Fixed Point Theorem If the function g (x) is continuous over a ≤ x ≤ b and g ( x ) ∈ [ a . then g (x) has a unique (only one) fixed point dx ρ ∈ ( a . b] then there exists at least one fixed point x = ρ ∈ [ a . b] . in addition to the above assumptions. g (x) is differentiable in a < x < b and dg ≤ L < 1 for all x ∈ ( a . b] such that g ( ρ ) = ρ . If. and g ' ( x) = f ( x) . then ∫ b a f ( x)dx = g(b) − g(a ) .
II. George W.edu/personal/collins/numbk/) Wikipedia: Numerical Methods/Numerical Integration Wikipedia: Numerical Methods/Equation Solving .cwru. Collins.African Virtual University 113 XII. chapter 4. Compiled List Of Compulsory Readings Wikipedia: Numerical Analysis Wikipedia: Interpolation Fundamental Numerical Methods and Data Analysis. (see: http://bifrost.
the entries may be shorter and a little easier to use in the first instance.. the characters in the history of mathematics will bring the subject to life for their students. Reading # 3: MacTutor History of Mathematics (visited 03.06) Complete reference : http://mathworld. At any point students should search for key words that they need to understand. Rationale: It provides the most detailed references to any mathematical topic. When the student completes the course and is teaching high school mathematics. however. Rationale: Students should use wikipedia in the same way as MathWorld. Thy will.06) Complete reference :http://wwwhistory. The resources are organsied by historical characters and by historical themes.11. It is important to get an overview of where the mathematics being studied fits in to the hostory of mathematics. the role of women in the history of mathematics should be studied to help students understand the difficulties women have faced while still making an important contribution.org/wiki Abstract : Wikipedia is an online encyclopedia.uk/Indexes Abstract : The MacTutor Archive is the most comprehensive history of mathematics on the internet. Equally. This will find a major article.ac.11.African Virtual University 114 XIII. It is written by its own readers. not be so detailed. the role of the African continent should be studied to share with students in schools: notably the earliest number counting devices (e. Also.standrews. Rationale: Students should search the MacTutor archive for key words in the topics they are studying (or by the module title itself).06) Complete reference : http://en. the Ishango bone) and the role of Egyptian mathematics should be studied. Students should start by using the search facility for the module title.g. The entry should be studied carefully and thoroughly. . However.wolfram. it has proved to be extremely accurate. The mathematics entries are very detailed.11. Particularly.com Abstract : Wolfram MathWorld is a specialised online mathematical encyclopedia.mcs. Reading # 2: Wikipedia (visited 03. Compiled List of (Optional) Multimedia Resources Reading # 1: Wolfram MathWorld (visited 03.wikipedia. It is extremely uptodate as entries are contunally revised.
objectives. RegulaFalsi. activities and attempts to form a global picture of what he/she is expected to have achieved as a result of the collective time and efforts invested in the learning process. The activity also presents the important topic of interpolation polynomials. The remaining two core learning activities (the third and fourth) are on numerical methods for approximating numbers (roots of functions and values of definite integrals). the learner is expected to have acquired knowledge of the basic concepts relating to numerical approximation of numbers and functions. sequences and infinite series. A reasonable number of worked out examples have been included in every learning activity to serve as beacons of reference both in understanding the text before them as well as serving as points of reference while solving related formative evaluation problems that appear in the text in the form of DO THIS. The learner is now expected to be able to comfortably define the concept of an error in mathematics. The module has been structured with a view to escorting and guiding the learner through the material with carefully selected examples and references to the core references. the different types of errors and methods of reducing the impact of errors on our final numerical approximation to a mathematical problem. including the Bisection. The degree of mastery of the module contents will largely depend on the learner’s deliberate and planned efforts to monitor his/her progress by solving the DO THIS problems. but also be able to apply the methods learnt. Specifically the learner is now expected to be reasonably comfortable in using linear interpolation in its various forms and derive an error bound for linear interpolation. After the opening learning activity on errors three substantive learning activities on the core issue of approximation were presented. and before presenting oneself for the summative evaluation. At this juncture. . One is also expected to solve a evaluate limits of functions.African Virtual University 115 XIV. Synthesis of the Module Completion of the fourth learning activity marks the end of this module. As laid out in the module overview in Section 6. Newton’s divided differences and the all important finite difference interpolation polynomials. In this regard the learner is expected to have appreciated the need for resorting to numerical methods. Secant and the NewtonRaphson methods for approximating roots of a nonlinear function of a single variable. One of these three core learning activity was on numerical approximation of functions using interpolation polynomials. One is also expected to be able to apply Newton’s method to approximate solutions of a couples system of two nonlinear equations in two variables. identify the sources of errors. it is desirable and appropriate that the learner reflects back on the mission. concentrating on Lagrangean.
3.0. x1 ) . (b) Give the main types of mathematical errors and mention their sources.125 0.375 0.984615) .984615 0. (c) Distinguish between absolute and relative errors and attempt to relate them to the concepts of accuracy and precision.0.876712) and hence. 2. interpolate f (x) at x = 0.375.875 0.876712 0.941176) . The following table gives values of a function f (x) at a number of equally spaced points x k . (0. f1 = f ( x1 ) where x1 − x0 = h is given by 1 E ( x) = ( x − x0 )( x − x1 ) f // (ξ ) . .125. x f(x) 0.01 .800000 x f(x) 0.719101 0.5 0.640000 0.000000 0. (b) Use the error bound obtained in part (a) to determine the smallest interval size h for which linear interpolation of cos(x) will give approximate values with errors not exceeding 0 .25 0. (a) Define the concept of an error in mathematics. Derive an upper bound 2 for E .0 1.566372 1.25. where ξ ∈ ( x 0 .625 0.African Virtual University 116 XV. Summative Evaluation Questions 1.0.941176 0.75 0.0 0.500000 Approximate f (x) by a quadratic Lagrangean interpolation polynomial using the points (0. (a) The error E (x) in linear interpolation of a function f (x) using the values f 0 = f ( x0 ) .3 . (0.
the existence and uniqueness theorem for fixed points . g(x) = 4 6 − x has a unique fixed .4 using Bessel’s interpolation formula centered at x0 = 0.. (b) State without proof. 7. Apply Newton’s interpolation based on divided differences to interpolate the function tabulated in Question 4 at the point x = 0. b) .African Virtual University 117 4. (a) Construct a table of finite differences for the function f (x) tabulated in Question 3 (a).. 24 2 s= 1 h ( x − x0 ) where 5.4 6. b] and differentiable in (a. of g (x) (c) Discuss whether or not the function point in the interval [0. (a ) Derive a NewtonRaphson iteration formula for approximating the r th root of a positive real number A . (b) If A = 7 apply the formula you have derived to approximate the square root of 7 correct to six decimals.1] . (a) Define the concept of a fixed point for a function g (x) which is known to be continuous over [a. (b) With the aid of the table of finite differences interpolate the function at x = 0.375 1 1 1 1 f ( s) = μf 1 + ( s − )δf 1 + s( s − 1) μδ 2 f 1 + s( s − 1)( s − )δ 3 f 1 + 2 2 2 6 2 2 2 2 = 1 s( s 2 − 1)( s − 2) μδ 4 f 1 + . Start the iteration with x0 = 2.
(b) Evaluate the above integral using the NewtonCotes formula ∫ x3 x0 f ( x)dx = 3h [f ( x0 ) + 3 f ( x1 ) + 3 f ( x2 ) + f ( x3 )] with 8 h= 1 . y 0 = 0. (c ) Apply Romberg integration on the two Trapezoidal values obtained in (b) to obtain a better approximation of the integral in (a).25 and h = 0.. ∫ (e 1 0 x − cos( x) ) analytically correct to 6 decimal dx (b) Tabulate values of the integrand in (a) at the points x k = 0.. .1.African Virtual University 118 8. (a) Evaluate the integral places accuracy. respectively. 9. (b) Starting with x0 = 1.5 . x 2 − 2 y 2 = 2 correct to 6 decimal places. (a) Using an analytical method calculate all the solutions of the coupled system 2 x 2 + y 2 = 5 ..2.5 approximate one of the solutions by carrying out two iterations with Newton’s method for systems of nonlinear equations. taking h = 0 .125 . (a) Find the antiderivative F (x) of the function f ( x) = it to evaluate the integral x and use x + 3x + 2 2 ∫ 1 2 x x + 3x + 2 0 dx correct to 6 decimals.125k k = 0. 6 10.8 and use the values obtained with the Trapezoidal rule to approximate the integral.
• Discretization errors. With g / ( x) = 2 x − ( x0 + x0 ) we find that g (x) has a critical point at x * = positive we conclude that 1 ( x0 + x1 ) . (c) The absolute error is the magnitude or size of an error. (a) If X * is an approximation to an exact (true) quantity X . • Rounding errors. The absolute error is a measure of the accuracy in the approximation. multiplication or division). The relative error is denoted by X −X X * . These are errors caused by the process of converting a mathematical problem having a continuous solution to a numerical model whose solution is a discrete function in the form of a sequence of numbers. (a) To obtain a bound on the error E (x) in linear interpolation one needs to find the maximum value of the functions g( x) = ( x − x0 )( x − x1 ) and f // (ξ ) over the interval x0 < x < x1 .African Virtual University 119 SOLUTIONS 1. • Truncation errors. The relative error is the ratio between the absolute error and the absolute value of the true (exact) quantity being approximated. while the relative error is a measure of the precision and relates to the seriousness of the error. subtraction. (b) The main types of mathematical errors are: • Initial errors. These are errors in the initial data supplied with a mathematical problem. then the deviation X −X * is called the error in the approximation X * . and because g // ( x) = 2 is always 2 1 h2 g( x * ) = − ( x1 − x0 ) 2 = − Assuming that 4 4 . These are errors introduced through unavoidable termination (truncation) of an otherwise infinite process such an infinite series or a convergent iteration. denoted by X − X * is always nonnegative. These are errors introduced because of limitations on the part of the instruments we use in performing arithmetic operations (addition. 2. The absolute error.
L1 (0. x3 = 0.01 . L 2 (0.84)(0. f1 = 0. and in this case M = 1 .3) f1 + L 2 (0.84 .3 8 8 3.3 . L 0 ( x) = L 1 ( x) = L 2 ( x) = ( x − x1 )( x − x2 ) ( x0 − x1 )( x0 − x2 ) ( x − x0 )( x − x2 ) ( x1 − x0 )( x1 − x2 ) ( x − x0 )( x − x1 ) ( x2 − x0 )( x2 − x1 ) With x = 0.125 . P2 (0. f 2 = 0.3) f 2 = (−0. We now must determine the step length h such that E ( x) ≤ M [Max g ( x) ] = Mh 2 h 2 = ≤ 0. P2 ( x) = L0 ( x) f 0 + L1 ( x) f1 + L2 ( x) f 2 where L0 ( x) L1 ( x) L2 ( x) are theLa.917913 .3) = 0.375 .876712 .876712) = 0. f // ( x) = − cos( x) .250 . In this case we have the following values: x0 = 0. grangean coefficients of degree 2. direct substitution of the various values of involved into the expressions for the Lagrangean coefficients gives: results which lead to the solution L 0 (0.984615) + (0. f 0 ) ( x1 . f 2 ) is given by the expression .941176) + (0. f 0 = 0. This gives the result h ≤ 0 .12 .28)(0.3) = −0. The quadratic Lagrangean interpolation polynomial passing through three points ( x0 .African Virtual University 120 Max f / ( x) = M over the interval in question we can then write h2 M 8 (b) The function being approximated is f ( x) = cos( x) In this case.984615 . x1 = 0.941176 . . f1 ) ( x 2 .3) = 0. .3) = L 0 (0.12)(0.28 .3) f 0 + L1 (0.
004187 0.028054 0.375) = 0.003675 0.076712 0.500 0.640000 0.015385 0.000 0.008777 0.375 0.375. h = 0.001798 0.012248 0.073628 0.007256 0.African Virtual University 121 4.001286 0.080899 0.007029 0.064464 0.125 0.001748 Second Third Fourth (b) Since x0 = 0.250 0.000000 0.875 1. (a) x 0. x = 0.2 0.125 .005473 0.066372 0.625 0.719101 0.876712 0.4.500000 0.079101 0.750 0.001783 0.008061 0.000716 Differences First 0.984615 0.005672 0.043439 0.125 .4 − 0.000 Table of Differences f(x) 1.021025 0.005458 0.566372 0.002389 0.941176 0.800000 0. then value of the parameter s= 1 (0.
Table of Newton’s Divided Differences x 0.000000 0.632808 0..004187 − 0.589024 0.125 0.4) = 0.347512 0.0 0.0000459936 24 2 2 Addition of all these terms leads to the answer P (0.875 1.75 0.719101 0.647192 0.515712 0.510720 0.298326 0.006388) = 0.058048 Third Fourth 0.672800 0.African Virtual University 122 With the aid of the table of finite differences interpolate the function at x = 0.876712 0.613696 0.4 using Bessel’s interpolation formula: μf 1 = 2 1 ( f1 + f 0 ) = 0.984615 0.748971 0.08) (−0.122198 0.625 0.599808 0..862137 .313600 0.800000 0.175136 0.0 f(x) 1.687872 0.500000 Divided Differences First Second 0. x1 .530976 0.008061) = 0.0.941176 0.312235 0.375 0.897728 0.391936 0.012248) = 0.251670 .12308 0. x2 ] + .25 0.0144) (0. First one constructs the table of Newton’s divided differences.838356 2 1 ( s − )δf 1 = (−0.076712) = 0.0230136 2 2 1 1 s( s − 1) μδ 2 f 1 = (0 − 0.133984 0. x1 ] + ( x − x0 )( x − x1 ) f [ x0 . Then one applies the interpolation polynomial Pn ( x) = f 0 + ( x − x0 ) f [ x0 .394240 1. 5.057536 0.3)(−0.566372 0.008)(0.000064488 6 2 2 1 1 s( s 2 − 1)( s − 2) μδ 4 f 1 = (0.640000 0.5 0.354304 0.0006574 2 2 2 1 1 s( s − 1)( s − )δ 3 f 1 = (0.
Substituting these quantities into the NewtonRaphson formula xn+1 = xn − f ( xn ) we obtain the general NewtonRaphson formula f / ( xn ) r r r r 1 ⎡ (r − 1) xn + A ⎤ ⎢ ⎥ r −1 r⎢ xn ⎥ ⎣ ⎦ xn+1 = xn − = xn − A rx n r −1 = rx n − xn + A rx n r −1 = 1⎡ A ⎤ ⎢(r − 1) xn + r −1 ⎥ r⎢ xn ⎥ ⎣ ⎦ . 0.00033496 ( x − x0 )( x − x1 )( x − x2 ) f [ x0 . x2 .000078 = . x1 .African Virtual University 123 Direct application of the formula based on x0 = 0.4 gives the following results: f ( x) = 0. The derivative of f (x) is f / ( x) = rx r −1 .00028728 ( x − x0 )( x − x1 )( x − x2 )( x − x3 ) f [ x0 .000287 + 0.876712 − 0. x1 .000077616 Therefore P4 (0.876712 ( x − x0 ) f [ x0 . x1 ] = −0. x4 ] = 0.862070 6. x1 . x3 ] = 0.015342 + 0. x2 ] = 0. x2 . x3 .000335 + 0.4) ≈ 0. x r − A = 0 . (a) If x = r A then. One may therefore take the function whose roots are being sought to be f ( x ) = x r − A .0153424 ( x − x0 )( x − x1 ) f [ x0 .375 and using the values of various divided differences highlighted in the table together with the value x = 0.
the function is definitely continuous over the interval [0.0 the following iterates are obtained from the formula: x0 = 2. b] • g (x) is differentiable in (a. 7. . (b) If g (x) is a function which satisfies the conditions • g (x) is continuous over a closed interval [a.0 x1 = 2. b] • g ( x ) ∈ [ a . This gives the special formula 1⎡ 7 ⎤ ⎢ xn + ⎥.6457520 x5 = 2.75 x3 = 2. (c) Consider the function g(x) = Since the only point of discontinuity for the function is x = 6 .6457513 Since the 7th decimal digit remains constant in the last two iterates we accept x = 2. Then g (x) has a unique fixed point ρ ∈ ( a .645751 as the desired approximation of 7 correct to 6 decimals.6477273 x4 = 2. b) .1] .African Virtual University 124 (b) The NewtonRaphson formula for finding the square root of a number A = 7 and r = 2 .6457513 x6 = 2. b) • Max g / ( x) = L < 1 ∀x ∈ (a . 2⎣ xn ⎦ x n +1 = Taking x0 = 2. (a) A number ρ is said to be a fixed point of a function g (x) if g ( ρ ) = ρ .1] . b) 4 6 − x over the interval [0. b] ∀ x ∈ [ a .
447213 ⎩ 2 2 The four possible solutions to the coupled system are (−1. (−1.549193 ⎩ 2 The corresponding values of y is obtained from the relation ⎧ y1 = +0. (1.2 = ⎨ ⎪ y = −0.447213) .−0.0.4 = ⎨ ⎪ x = −1.447213) . g/ (x) = g/ (0) = 8.African Virtual University 125 With both g (0) = 4 4 and g (1) = lying in (0. (a) Analytical Solution To obtain the true (analytical) solution one eliminates one of the variables and solves the resulting quadratic equation in the retained variable.549163.0.447213) . x 2 − 2(5 − 2 x 2 ) = 2 ⇒ 5 x 2 = 12 ⎧ x1 = +1.549183 ⎪ ⇒ x = 2. The function is also differentiable and g(x) = − 4 1 = <1 36 9 This result proves that the function has a unique fixed point in the interval 0 < x < 1 . From the first equation one finds 4 .447213) (1.−0. The maximum value of .1) we also note that all the function 5 6 values lie inside the given interval.549183.549183.447213 ⎪ y = 5 − 2 x = 0.549183. (6 − x)2 y 2 = 5 − 2x2 We use this result to eliminate y from the second equation.
0 . ∂x ∂f = fy = 2y ∂y ∂g = g y = −4 y ∂y Newton’s method states t that. f y =1.5 . y0 = 0. g x = 3. y n +1 ) can be obtained by setting x n +1 = x n + hn .0 .0 f 0 = −0. ∂x ∂g = g x = 2 x. y n ) an improved approximation ( x n +1 . g0 = −0. y) ≡ x 2 − 2 y 2 − 2 = 0 The partial derivatives of f ( x.25 . g y = − 2. k n are obtained by solving the linear system of equations ⎛ fx ⎜ ⎜ ⎜f ⎝ y g x ⎞⎛ hn ⎞ ⎛ − f ⎞ ⎟⎜ ⎟ ⎜ ⎟ ⎟⎜ ⎟ = ⎜ ⎟ g y ⎟⎜ k n ⎟ ⎜ − g ⎟ ⎠ ⎝ ⎠ ⎝ ⎠ Application of Newton’s method: First Iteration x0 = 1. The increments hn .5 f x = 6. y ) and g ( x.25 .0 . y ) are ∂f = f x = 4 x.African Virtual University 126 (b) Approximation of the roots using Newton’s method Let f ( x. starting from an approximate solution ( x n . y n +1 = y n + k n . y) ≡ 2 x 2 + y 2 − 5 = 0 g( x.
117783 2 2⎢ 3 2⎥ ⎣ ⎦ . (a) The antiderivative of the function f ( x) = ∫x 2 xdx 1 2x + 3 − 3 1 2x + 3 3 dx = ∫ 2 dx = ∫ 2 dx − ∫ 2 2 x + 3x + 2 2 x + 3x + 2 + 3x + 2 2 x + 3x + 2 2 1 d ( x + 3 x + 2) 3 dx = ∫ 2 − ∫ 2 2 ( x + 1)( x + 2) x + 3x + 2 = = 1 3 ⎛ 1 1 ⎞ ln( x 2 + 3 x + 2) − ∫ ⎜ − ⎟dx 2 2 ⎝ x +1 x + 2 ⎠ 1 3 ⎛ x +1 ⎞ ln( x 2 + 3 x + 2) − ln⎜ ⎟ + Cons tan t 2 2 ⎝ x+ 2⎠ x x + 3x + 2 2 Therefore.549306 − 0. y1 = 0.033772 . k1 = 0 .666668 Substituting these quantities into the linear system and solving the resulting system one gets h1 = − 0 .431523 = 0.416667 f x = 6.031667 and therefore x 2 = x1 + h1 = 1. y 2 = y1 + k1 = 0.083333 .833334 g1 = 0. .416667 x1 = x0 + h0 = 1.166666 . g y = − 1. g x = 3.583333 .448334 x x + 3x + 2 2 9.159721.187498.333333 .549561. k 0 = −0.583333 .083333 and therefore y1 = y 0 + k 0 = 0. f y = 0. ∫ 1 0 dx = 1 [ln(6) − ln(2)]− 3 ⎡ln 2 − ln 1 ⎤ = 0.African Virtual University 127 Substituting these quantities into the linear system and solving the resulting system one gets h0 = 0. . f1 = 0. Second Iteration x1 = 1.
0 6 0.1. (0.133333 0 .15 x1 = 5 x6 = 1.0. the specified interval length h = the expression [ x0 .125.0 : (0. (0.057283) (0.0.160428 0.1. x 4 .0.0(0.166667 x5 = While the given formula involves values of the function over three consecutive intervals. 6 I= 10. (0.177980) . (a) The value of the integral [e 1 − sin(1)]− [ 0 − sin(0)]= 0.5.75. (1.757878) .0. x6 ] . (0.African Virtual University 128 (b) To approximate the same integral I = NewtonCotes formula ∫ 1 2 x x + 3x + 2 0 dx using the special ∫ x3 x0 f ( x)dx = 3h [f ( x0 ) + 3 f ( x1 ) + 3 f ( x2 ) + f ( x3 )] 8 One first tabulates the function: xk fk x0 = 0 0.875.2.385311) .1. Therefore.140951) .625.0. (0. the integral will be approximated by 3h { f 0 + 3 f1 + 32 f + f 3 )+ ( f 3 + 3 f 4 + 3 f 5 + f 6 )}= 0.315113).0) . x5 .876811 e ∫ (e 1 0 x − cos( x) ) is dx (b) Table of values of the integrand f ( x) = e x − cos( x) for values at the equidistant points: x = 0.117741 ( 8 1 results in a pair of such consecutive intervals.125)1.375.524484) (0. x 2 .0. x1 .107143 0. x3 ] and [ x3 .065934 0.0 1 2 3 4 x2 = x3 = x4 = 6 6 6 6 0.771139) .0.25.
25.25)]= 0. T (0.125) + 1 [T (0.0.African Virtual University 129 With the aid of the extended trapezoidal rule one finds: T (0.125) − T (0.25) = 0.125) = 0.876813 3 .125] = T (0.890138.880144 (c) Application of Romberg integration on the two Trapezoidal values obtained above gives R [0.
Pearson Education International. Atkinson. . 1985. Fox..Oxford University Press. Numerical Methods for Engineers and Scientists. Jain.K. Fairley. I. Pearson Education Ltd. Numerical Analysis – Fifth Edition. 1973. Mathematical Methods for Science Students – Second Edition.K. Brian Bradie. L. References G. 2002. 1964. First Course in Numerical Methods. Bajpai. 1975. A friendly Introduction to Numerical Analysis.. PWS – KENT Publishing Company. Numerical Methods – Problems and Solutions. M. Burden and Faires. 1993. Collier – Macmillan Ltd. Jain. Calus and J.M. Walter Jennings. Iyengar & R. S. Computing Methods for Scientists and Engineers. 1987.C.A. Stephenson. . Kendall E.R. and Mayers. Linear Algebra and its Applications – Third Edition.F. Addison Wesley. London. John Wiley & Sons.African Virtual University 130 XVI. D.K. An Introduction to Numerical Analysis. London. A. Lay. 1958. Taylor & Francis Ltd. Wiley Eastern Ltd.
Ralph W. Technology and Environmental Studies at the Open University of Tanzania. the commercial capital of the United Republic of Tanzania. Professor Masenge retired in 2000 and left the services of the University of Dar Es Salaam to join the Open University of Tanzania where he now heads the Directorate of Research and Postgraduate Studies as well as being in charge of a number of Mathematics Courses in Calculus. D in Mathematics in 1986 from the University of Dar Es Salaam in Tanzania through a sandwich program carried out at the Catholic University of Nijmegen in the Netherlands. A graduate in Mathematics. Author of the Module Dr. Professor Masenge obtained a Masters degree in Mathematics from Oxford University in the United Kingdom in 1972 and a Ph. Professor Masenge headed the Department of Mathematics at the University of Dar Es Salaam.African Virtual University 131 XVII. His main hobby is working on his small banana and coconut farm at Mlalakuwa Village. Born in 1940 at Maharo Village situated on the slopes of Africa’s tallest mountain. Masenge is Professor of Mathematics in the Faculty of Science. For almost 33 years (May 1968 – October 2000) Professor Masenge was an academic member of Staff in the Department of Mathematics at the University of Dar Es Salaam during which time he climbed up the academic ladder from Tutorial Fellow in 1968 to full Professor in 1990. The Killimanjaro. Professor Masenge is married and has four children. From 1976 to 1982. He also served as Associate Dean in the Faculty of Science and was Acting Chief Administrative Officer of the University of Dar e salaam for one year (1995). Mathematical Logic and Numerical Analysis. Physics and Astronomy from the Bavarian University of Wuerzburg in the Federal Republic of Germany in 1968.P. situated some 13 km from the City Centre on the outskirts of Dar Es Salaam. .
This action might not be possible to undo. Are you sure you want to continue?