Appendix 2: The Solution of Non-Linear Equations
Appendix 2: The Solution of Non-Linear Equations
Equations
CONTENTS
Bisection
Method .............314
6x 3x 1 0
(A.2.1)
x ln x 2 0
(A.2.2)
Secant Method
(Also Known as the
Modified Regula
Falsi Method)...314
ex sin x 0
(A.2.3)
NewtoneRaphson
Method .............315
Exercises ..........317
Solutions...........318
Although we may not be able to determine the exact value of a solution of the
equation (i.e., the precise value of x such that f (x) 0), in practice we may be
able to estimate the value of x to any desired degree of accuracy. This means
that, given any very small positive number (such as 10e8), we can nd
a number h such that j x e h j < . For practical purposes, h is then regarded as
a solution of the equation.
Special techniques exist for solving polynomial equations; however, the
methods which are most suitable in the more general case can be applied easily
to polynomial equations. Accordingly, we restrict our attention in this
appendix to three of the principal methods which may be applied to solve the
general non-linear equation.
Before one tries to nd the root (or roots) of any equation, it is important to
conrm by as elementary methods as possible that the equation does, indeed,
have at least one root, thereby avoiding wasted time. In addition, one should
try to determine the number of roots and nd some information about their
location.
In almost all practical problems, the function f will be continuous, and
henceforth we shall assume that this is so. (If f is not continuous, the equation
313
314
f (x) 0 may require more careful analysis.) If a < b and f (a) is of opposite sign
to f (b), there exists x with a < x < b such that f(x) 0. This well-known
property can be used in most cases to nd an interval containing a solution of
the equation and leads naturally to one method for nding it.
BISECTION METHOD
Suppose that a0 < b0 and f(a0) f (b0) < 0. Put m (a0 + b0)/2. Then either
(a) f (a0) f (m) 0, in which case there is a solution in the interval [a0, m]; or
(b) f (a0) f (m) > 0, in which case f (m) f (b0) < 0 so that there is a solution in
the interval [m, b0].
We have therefore determined an interval, [a1, b1] say, contained in the interval
[a0, b0] and one half its length, in which the solution lies. Repeating this
procedure, we may construct a series of nested intervals [ai, bi], each containing
the root, such that (bi e ai) (b0 e a0)/2i. By making i sufciently large, we can
therefore nd the solution to any desired degree of accuracy.
The principal advantage of the bisection method lies in the fact that, once an
interval has been found which contains a solution, then the method guarantees
that, provided we are willing to carry out a sufcient number of iterations, the
value of the solution may be found to any specied degree of accuracy. The
major drawback is that, if very high accuracy is required, the necessary number
of iterations may be large. With a modern computer, this may not be a serious
objection, but it is natural to seek faster methods.
In the following sections, we describe two further methods, both of which are
generally satisfactory in nearly all practical situations.
xn xn1
f xn f xn1
f xn xn1 f xn1 xn
f xn f xn1
NewtoneRaphson Method
FIGURE A.2.1
Secant method
NEWTONeRAPHSON METHOD
Finally, we consider a technique which gives theoretically faster convergence to
a solution than either of the two preceding methods, but which requires that we
are able to evaluate the derivative of f.
We try to construct a sequence {xn} which converges rapidly to the required
solution. Intuitively, the rationale for the method may be described as follows.
Suppose that xn is close to the solution so that j f (xn) j is small. We wish (xn + h)
to be a better approximation. If h is small,
f xn h x f xn hf 0 xn
315
316
Hence, if
h f xn =f 0 xn
it follows that f(xn + h)x0. Accordingly, we let
xn1 xn f xn =f 0 xn
and hope that the sequence dened (from a given starting point x0) converges.
If it does, the limit point x is a solution of the equation. The method is illustrated in Figure A.2.2.
The principal advantage of this method lies in its speed of convergence;
however, the choice of the initial point x0 may be of critical importance in the
search for a particular solution. A bad starting value may lead to a solution
other than that sought or even to a non-convergent sequence. Also, the
method does not produce a small interval containing the solution. Usually,
the iterative procedure is continued until jxn1 xn j is sufciently small. In
practice, this is generally an acceptable criterion, but is not entirely foolproof
FIGURE A.2.2
NewtoneRaphson method
Exercises
EXAMPLE A.2.1
Find the positive solution of Eq. A.2.1 using the three
methods discussed.
Solution
Here we have
f x 6x 4 3x 1
and
1
f 0 x 24 x 3
8
Hence, f is a decreasing function for x < 1/2 and an
increasing function for x > 1/2. Also f (1/2) e 17/8. Since
L4
[ 10L8
Method of Solution
Solution
Number of Iterations
Solution
Number of Iterations
Bisection
Secant
NewtoneRaphson
0.8831
0.8831
0.8831
12
5
3
0.883 111 66
0.883 111 66
0.883 111 67
25
7
4
and, theoretically, an additional test (such as that described previously for the
secant method) should be applied.
Although the calculation of the derivative may be somewhat laborious and
extra care may be needed initially, the NewtoneRaphson method may produce
signicant savings in time when many similar calculations are required.
EXERCISES
A.1 Find the negative solution of Eq. A.2.1.
A.2 Find all the real solutions of Eq. A.2.2.
A.3 How many real solutions does equation A.2.3 have? Find the two smallest
solutions.
317
318
SOLUTIONS
(To ve signicant gures.)
A.1 0.31391.
A.2 0.15859, 3.1462.
A.3 An innite number. 0.58853, 3.0964.