APM2613 - Lesson 2 - 0 - 2023
APM2613 - Lesson 2 - 0 - 2023
Numerical Methods I
APM2613
Year module
IMPORTANT INFORMATION:
Nonlinear equations:
This tutorial letter contains Lesson 2, additional notes on
solutions of nonlinear equations. Please read this information
along with Chapter 2 and Section 10.2 to supplement the
textbook. The contents of this topic constitute a substantial
portion of Assignment 1. So you need to read it alongside
attempting this assignment.
BARCODE
university
Define tomorrow. of south africa
1 Lesson 2: Solutions of Non-linear Equations
Reading
Chapter 2 and Chapter 10.2 of textbook
• To highlight the key points of Newton’s method for one equation, as well as a system of equations;
• To highlight the key points of the Secant method and its variations;
• In studying each method to highlight key aspects of investigating convergence and error of these
methods;
• To highlight the key points of other methods used for specific purposes in the study of solutions of
nonlinear equations;
– Bisection method;
– Fixed point method;
– Newton’s method and its extensions: Secant method; Regula falsi method;
– Horner’s method and Muller’s method
– Newton’s method for systems of two equations in two unknowns.
2
APM2613/LNS2/0/2023
1.2 Introduction
In this part of the course, the question of solving non-linear equations arising in many situations where ana-
lytic methods may not be used is addressed by presenting a number of numerical schemes/algorithms for this
purpose. In most cases there are no exact analytical formulas to solve such equations. Various schemes have
been formulated to generate approximate solutions, starting with simple ones and proceeding to other meth-
ods which were formulated due to their advantage as related to convergence and computational efficiency.
f (x) = 0
where f (x) is a function defined on an interval [a, b]. The root of this equation, also known as the zero of
the function is the x-intercept of the function f (x). Assuming some ’nice’ characteristics of the function on
the interval [a, b], some foundational properties of calculus are used as the basis of the existence of a root in
this interval.
Apart from the bisection method, the search for a root of f (x) = 0 numerically involves finding solutions
of the root equation of the form
x = g(x).
Solutions of the latter are generally called fixed points in the sense that you seek a value x (a fixed point)
such that g(x) gives you back the same value, x. Hence this form of the root finding problem is also referred
to as the fixed-point formula. The numerical methods here discussed and used seek to find expressions of
g(x) based on various systematic mathematical arguments. Thus all the methods, starting with the simple
fixed-point method, Newton’s method and its variants, and other methods, can be viewed as different ways
of formulating the function g(x) of the fixed-point formulaequation.
Hence it is important to be aware of the form of the root-finding problem: whether it is the root equation
form of the fixed-point form or a general non-linear equation. Every non-linear equation can be written in
the form f (x) = 0 so as to identify the function f (x).
While the methods discussed in Chapter 2 are for equations in one variable, it is useful to view Chapter 10.2
as an extension of Chapter 2 since it deals with extending Newton’s method to solve a system of non-linear
equations instead of one equation. While also other methods can be extended to the case of functions of
more than one variable, the focus of this module is on extending Newton’s method only.
It is very important to note that the notes presented here do not in anyway replace the need to read the
relevant chapter/section in the textbook. Similar summaries are actually given in the companion website
of the textbook.
f (x) = 0 (1)
and
x = g(x) (2)
3
also respectively referred to as the root problem and the fixed-point problem. The root problem involves
rearranging the given equation so that one side of the equation is 0. A solution of this problem in the usual
x-intercept of the graph of f (x). It is also worth noting the use of the terms root, zero and fixed-point in the
context of these two equations.
For the fixed-point problem, one side of the equation (obtainable in a number of ways) is x. Many of the
techniques involve finding an expression of g(x) that ’hopefully’ converges to a fixed-point x (or p as per
terminology of the textbook). The solution process involves iterative computations of g(x) to find successive
approximations to the solution.
Geometrically, this would be the point of intersection of the graph of y = g(x) and the line y = x.The
iteration formula g(x) may converge to the required solution or diverge away from it, sometimes to another
solution if it exists or simply away in an unbounded manner. The conditions for convergence become part of
the analysis. Such convergence sometimes depend on the choice of the initial value of the approximation.
So in discussing each method the elements of the process are in focus: formulation; implementation and
analysis of error and convergence.
https://sites.google.com/site/numericalanalysis1burden/
In what follows, a quick overview of the various methods for solving the root equation f (x) = 0 is given.
So the Bisection method starts by identifying a suitable initial interval by applying the Intermediate Value
Theorem to a pair of values. It proceeds by finding the next iterate as the midpoint of the current interval,
followed by checking the sign of its functional value and discarding the point with the same functional value
sign as the new iterate. This procedure is repeated successively and subsequent intervals get smaller and
they enclose the desired root. Example 1 on p50 illustrates the implementation of this method. Note that the
function f (x) is only used in the intermediate value test.
1.4.1 Convergence
The nice thing about the Bisection Method is that the repeated application of the intermediate point test af-
ter each calculation of the midpoint ensures that the iterations converge to the root because each time it is
4
APM2613/LNS2/0/2023
Furthermore, the convergence rate of the method is simple and given in Theorem 2.1.
Theorem 2.3 states a sufficient condition for the existence and uniqueness of a fixed point:
(i) Existence: g(x) ∈ [a, b] and g ∈ C[a, b] for all x ∈ [a, b];
i.e. g maps itself in [a, b] and is continuous on that interval.
(ii) Uniqueness: g ′ (x) ≤ k for all x ∈ [a, b]; i.e. there are no asymptotes in (a, b).
5
Example
The root equation f (x) = 2x3 − 7x + 2 = 0 can be rearranged in various expressions
of x = g(x), i.e. of (2), as shown in the table below. The initial value and the result
of repeated iterations are also given.
Since the given function f (x) is a polynomial of degree 3, it has 3 roots. The initial values chosen led to two
of the 3 roots. Other choices might have led to the other root. Also worth noting is that
You can think of other iteration formulae (2) and try them using different initial values.
In a sense, the rest of the methods discussed for solving nonlinear equations entails finding different ex-
pressions of g(x).
The Fixed-point Theorem (Theorem 2.4) is a simple test for convergence that can be applied to an iterative
formula. Simply stated, for a function g(x) that is continuous on [a, b], that maps the given interval onto
itself, and is differentiable on the given interval, it is sufficient for g(x) to converge if
Note that the test is performed for a given interval (a, b).
Order of Convergence
6
APM2613/LNS2/0/2023
If g(x) and its n derivatives are known at p, then g(pi ) can be expanded in a Taylor series about p to obtain
We observe that the error in the (i + 1)-th term has been expressed in terms of the i-th error. Hence if ϵi is
fairly small, ϵni gets smaller with higher powers of ϵi , thus causing the first term to be dominant over other
terms. However, if ϵi is large, little can be said about convergence.
If g ′ (p) ̸= 0 then ϵi+1 ∝ ϵi . If on the other hand g ′ (p) = 0 and g ′′ (p) ̸= 0, then ϵi+1 ∝ ϵ2i .
Definition: The order of convergence is the order of the lowest non-zero derivative of g(x) at x = p.
The order of convergence of an iterative method is not unique but depends on the iterative formula being
used. Thus the speed of convergence varies with the choice of the formula g(x). The higher the order, the
faster the convergence.
It therefore seems that the choice of the iteration function g(x) is crucial in finding the root of equation (1).
Example
For
f (x) = x2 − 5x + 4 = 0, with p = 1; 4
and
x2 + 4 2x
x = g(x) = ; g ′ (x) =
5 5
so that
2 8
g ′ (1) =
̸= 0; g ′ (4) = ̸= 0
5 5
hence the process is first order convergent.
We recall that geometrically, the solution of x = g(x) is essentially the value of x at the intersection of the
curve y = g(x) and the line y = x.
7
Geometrically, on the superimposed graphs of y = x and y = g(x), the test involves starting at the point x0
and first moving vertically until the curve y = g(x) is reached. From this point movement is horizontally un-
til the line y = x is reached, then vertically to g(x), and so on, as shown on the figures on p59 of the textbook.
The relationship between convergence and the slope g ′ (x) of g(x) is illustrated in Figure 2.6(b) (monotonic)
and Figure 2.6(a) (oscillating) in the textbook.
(see also the animation in the textbook companion website)
The methods discussed starting from Section 2.3 are different expressions of the iterative formula x = g(x)
where the right-hand side g(x) is obtained in a systematic way.
Geometrically, the procedure involves the following steps on the graph of f (x):
1. Picking an initial guess, x0 = p0 ;
2. Obtaining a new value x1 = p1 by drawing the tangent to the curve at at x = x0 , y = f (x0 ), and
extending it to the x-axis;
3. Repeating 2 above for another value x2 using x1 as the new guess. Other subsequent approximations
are obtained in the same way.
The result of carrying out these steps is illustrated in Figure 2.7 of the textbook.
8
APM2613/LNS2/0/2023
1.6.1 Convergence
Note the special expression of the iterative formula x = g(x) in equation (7). The choice of g(x) is such that
its first derivative at x̄ (or p) vanishes. Hence the method is a second order method.
(See a more formal discussion of convergence using Newton’s Method on p69 of the textbook.)
1. If the iterate corresponds to a turning point (or very close to one) as illustrated in Figure 1
3. If x0 is not close enough to p such that some other part of the function ”catches” the iteration. This is
illustrated in Figure 3.
4. If the roots are too close to each other the slope may be horizontal and hence fail to intersect the curve
anywhere except at the point.
p0
p
9
Figure 2: Symmetric roots f
Figure 2: Symmetric roots f
p1
p1 p p0=p2
p p0=p2
f
f
p0 p1 p2
p0 p1 p2
The iterative function of the iterative formula of the Secant method now involves the two previous iterates
xk−1 and xk .
Geometrically, instead of using the tangent at a guess point xk , the method uses the secant line through two
current guess points, (xk , f (xk )) and (xk−1 , f (xk−1 )). Otherwise the idea of using the intersection of this
line with the x-axis as the next approximation is the same as for Newton’s method.
1.7.1 Convergence
Although this method is efficient, convergence to the required root is not guaranteed. The next method
addresses this shortfall of the Secant method.
10
APM2613/LNS2/0/2023
1. Choosing two initial guesses, say x0 = a and x1 = b such that f (a) and f (b) have opposite signs; i.e.
f (a)f (b) < 0;
2. Joining the points f (a) and f (b) with a straight line (the secant line); Identifying the point xM at the
x-intercept of the secant line in 2. above.
3. Examining the value of f (xM ) and compare with f (a) and f (b), and if
4. Repeating the process using xM and either a or b as the new (endpoint) values.
Note that the Secant and Regula Falsi methods have the same iterative formula, but the latter has the brack-
eting test as an extra step.
The Bisection and Regula Falsi methods have the following disadvantages to be aware of when using them:
(i) Calculation of the intermediate point becomes tricky when the other two approximations on either side
are close together;
(ii) Round-off error may cause problems as the intermediate point approaches the root in that since f (xM )
may be slightly in error, f (xM ) may be positive when it should be negative or vice versa.
(iii) When the three current points are close to the root, their functional values may become very small;
i.e. the evaluations may result in an underflow when testing for signs by multiplication of two small
numbers, hence the test may fail.
Usually, Newton’s method may be used to refine (or speed up) an answer obtained by other methods such as
the Bisection method.
11
1.9.1 Speeding up Convergence
Having introduced the notion of convergence in the above section, Section 2.5 presents two methods,namely
Aitken’s and Steffensen’s methods, that can be used to speed up convergence of methods known to converge
only linearly. Of particular note is that the formulae given are for refining the n-iterate pn , and hence are
only in terms of pn , pn+1 , pn+2 , n ≥ 0. Thus their application necessitates starting with three values.
It is used in the evaluation of the polynomial values when Newton’s method is applied to a polynomial
equation P (x) = 0, whose Newton’s iterative formula would be
P (xi )
xi+1 = xi −] .
P ′ (xi )
Example 2 on p93 illustrate the use of this method.
Unlike the other methods based on using an intersection of a line with the x-axis to find the next approx-
imation, Muller’s method uses the intersection of a parabola to find the next approximation. Intuitively, a
quadratic approximation of a polynomial is better than a linear approximation. So Muller’s method is con-
sidered a stronger choice for approximating the next iterate.
that passes through the points corresponding to three approximate points xi−2 , xi−1 and xi , i = 2, 3, . . . at a
time. This requirement is used to obtain the values of the coefficients a, b and c. The iterative formula uses
these values, and has the form (see top of p97)
2c
p3 = p2 − √ .
b + sgn(b) b2 − 4ac
The iterative process continues by discarding xi−2 and uses the new iterate and the other two to repeat the
computations of new values of a, b and c.
12
APM2613/LNS2/0/2023
We highlight the similarities and differences in Newton’s formula in the two cases, using a function
where
x1
x=
x2
While Newton’s method for f (x) = 0 uses the iteration (fixed-point) formula
JF (x1 , x2 ) =
∂x1 ∂x2
∂F2 (x1 , x2 ) ∂F2 (x1 , x2 )
∂x1 ∂x2
That is
∂F1 (x1 , x2 ) ∂F1 (x1 , x2 ) −1
JF (x)−1 =
∂x1 ∂x2
∂F2 (x1 , x2 ) ∂F2 (x1 , x2 )
∂x1 ∂x2
Finding the inverse of this matrix follows on standard methods used in linear algebra.
For a discussion of the iterative equation (8), the Jacobian of a general n-variable function F(x1 , x2 , . . . , xn )
see p652. The inverse of such a matrix can be computed using similar computations of the inverse of an
n × n matrix in linear algebra.
13
1.12 Notations and Terminology
Each chapter concludes with a section on numerical software and chapter review. The notion of an ’algo-
rithm’ has been alluded to in previous tutorial letters. It is worth emphasizing that the given algorithms are a
general guide of implementing a technique using any software. They are to be translated accordingly to suite
the language of the software of your choice.
Finally, it is worth noting some notations and terminology used in this chapter that may recur in subsequent
chapters. An understanding of these will make understanding of presentations in subsequent reading and
study more fluent.
• {pn }∞
n=1 denotes a sequence whose terms are pn for n satrting from 1 to ∞.
• O(·), usually used in discussing convergence, denotes the order (or rate) of convergence.
• ∆pn denotes the forward difference - current value subtracted from the next.
(k)
• pi denotes the value of the iterate pi in the k-th iteration/step.
This list of terms and notation may not be exhaustive, but included here to emphasise the importance of
understanding the notation used in the text (or any text for that matter) so that it does not get in your way
when studying.
14