You are on page 1of 24

EEng-2206 Computational methods

----------------------------------------------------------------------------------------------------------------
Chapter Two Solution of Nonlinear Equations
----------------------------------------------------------------------------------------------------------------

2.1 Root finding methods


Introduction
There are two methods of finding roots of a nonlinear equation f ( x)  0 these are:
The bracketing methods and the open methods.
For the bracketing methods, the root is located within an interval prescribed by a
lower and an upper bound. Repeated application of these methods always results in closer
estimates of the true value of the root. In contrast, the open methods are based on
formulas that require only a single starting value of x or two starting values that do not
necessarily bracket the root.

2.1.1 Fixed point Iteration


As mentioned above, open methods employ a formula to predict the root. Such a
formula can be developed for fixed point iteration by rearranging the function f ( x)  0 so
that x is on the left-hand side of the equation:
(1)
This transformation can be accomplished either by algebraic manipulation or by simply
adding x to both sides of the original equation. For example,

Can be simply manipulated to yield

Whereas sin could be put in to the form of eqn(1) by adding x to both sides to yield

The utility of eqn(1) is that it provides a formula to predict a new value of x as a function of
an old value of x . Thus, given an initial guess at the root , eqn(1) can be used to
compute a new estimate as expressed by the iterative formula ). The
sequence has the pattern

=g( )
=g( )

=g( )

The approximate error can be determined using the error estimator:

| | %

Department of Electrical Engineering Page 1


EEng-2206 Computational methods

Example 1
Use simple fixed point iteration to locate the root of .
n:
Sol the function can be separated directly and expressed in the form of eqn(1) as:
= , starting with an initial guess of this iteration can be applied to compute

Iteration

0 0 -
1 1.000000 100.0
2 0.367879 171.8
3 0.692201 46.9
4 0.500473 38.3
5 0.606244 17.4
6 0.545396 11.2
7 0.579612 5.90
8 0.560115 3.48
9 0.571143 1.93
10 0.564879 1.11

Thus, each iteration brings the estimate closer to the true value of the root: 0.56714329

2.1.2 Bisection Method


What is the bisection method and what is it based on?
One of the first numerical methods developed to find the root of a nonlinear equation
f ( x)  0 was the bisection method (also called binary-search method). The method is
based on the following theorem.

Theorem
An equation f ( x)  0 , where f (x) is a real continuous function, has at least one root
between x and xu if f ( x ) f ( xu )  0 (See Figure 1).
Note that if f ( x ) f ( xu )  0 , there may or may not be any root between x and xu
(Figures 2 and 3). If f ( x ) f ( xu )  0 , then there may be more than one root between x
and xu (Figure 4). So the theorem only guarantees one root between x and xu .

Bisection method
Since the method is based on finding the root between two points, the method falls
under the category of bracketing methods.
Since the root is bracketed between two points, x and xu , one can find the mid-
point, x m between x and xu . This gives us two new intervals
1. x and x m , and
2. x m and xu .

Department of Electrical Engineering Page 2


EEng-2206 Computational methods

f (x)

xℓ
x
xu

Figure 1 At least one root exists between the two points if the function is real, continuous,
and changes sign.

f (x)

x
xℓ xu

Figure 2 If the function f (x) does not change sign between the two points, roots of
the equation f ( x)  0 may still exist between the two points.

Department of Electrical Engineering Page 3


EEng-2206 Computational methods

f (x) f (x)

xℓ xu
x x
xℓ xu

Figure 3 If the function f (x) does not change sign between two points,
there may not be any roots for the equation f ( x)  0 between the two points.

f (x)

xu
xℓ x

Figure 4 If the function f (x) changes sign between the two points, more than one root for
the equation f ( x)  0 may exist between the two points.

Is the root now between x and x m or between x m and xu ? Well, one can find the sign of
f ( x ) f ( xm ) , and if f ( x ) f ( xm )  0 then the new bracket is between x and x m , otherwise,
it is between x m and xu . So, you can see that you are literally halving the interval. As one
repeats this process, the width of the interval x , xu  becomes smaller and smaller, and you
can zero in to the root of the equation f ( x)  0 . The algorithm for the bisection method is
given as follows.

Department of Electrical Engineering Page 4


EEng-2206 Computational methods

Algorithm for the bisection method


The steps to apply the bisection method to find the root of the equation f ( x)  0 are
1. Choose x and xu as two guesses for the root such that f ( x ) f ( xu )  0 , or in other
words, f (x) changes sign between x and xu .
2. Estimate the root, x m , of the equation f ( x)  0 as the mid-point between x and xu
as
x  xu
xm = 
2
3. Now check the following
a) If f ( x ) f ( xm )  0 , then the root lies between x and x m ; then x  x and
xu  x m .
b) If f ( x ) f ( xm )  0 , then the root lies between x m and xu ; then x  xm and
xu  xu .
c) If f ( x ) f ( xm )  0 ; then the root is x m . Stop the algorithm if this is true.
4. Find the new estimate of the root
x  xu
xm = 
2
Find the absolute relative approximate error as
xmnew - xmold
a =  100
xmnew
where
xmnew = estimated root from present iteration
xmold = estimated root from previous iteration
5. Compare the absolute relative approximate error a with the pre-specified relative
error tolerance s . If a s , then go to Step 3, else stop the algorithm. Note one
should also check whether the number of iterations is more than the maximum
number of iterations allowed. If so, one needs to terminate the algorithm and notify
the user about it.

Example 1
Thermistors are temperature-measuring devices based on the principle that the thermistor
material exhibits a change in electrical resistance with a change in temperature. By
measuring the resistance of the thermistor material, one can then determine the temperature.
For a 10K3A Betatherm thermistor,

Department of Electrical Engineering Page 5


EEng-2206 Computational methods

Thermally
conductive epoxy
coating

Tin plated copper


alloy lead wires

Figure 5 A typical thermistor.


the relationship between the resistance R of the thermistor and the temperature is given by
 1.129241  10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

T
where T is in Kelvin and R is in ohms.
A thermistor error of no more than  0.01C is acceptable. To find the range of the
resistance that is within this acceptable limit at 19 C , we need to solve
 1.129241 10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

19.01  273.15
and
 1.129241 10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

18.99  273.15
Use the bisection method of finding roots of equations to find the resistance R at 18.99 C .
Conduct three iterations to estimate the root of the above equation. Find the absolute relative
approximate error at the end of each iteration and the number of significant digits at least
correct at the end of each iteration.

Solution
Solving
 1.129241 10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

18.99  273.15
we get
f ( R)  2.341077  10 4 ln( R)  8.775468  10 8 ln R   2.293775  10 3
3

Lets us assume
R  11000, Ru  14000
Check if the function changes sign between R and Ru .
f ( R )  f (11000)
 2.341077  10  4 ln(11000)  8.775468  10 8 ln 11000  2.293775  10 3
3

 4.4536  10 5
f ( Ru )  f (14000)
 2.341077  10  4 ln(14000)  8.775468  10 8 ln 14000  2.293775  10 3
3

 1.7563  10 5

Department of Electrical Engineering Page 6


EEng-2206 Computational methods

Hence
 
f R  f Ru   f 11000 f 14000   4.4536  10 5 1.7563  10 5  0
So there is at least one root between R and Ru , that is, between 11000 and 14000 .
Iteration 1
The estimate of the root is
R  Ru
Rm  
2
11000  14000

2
 12500
f ( Rm )  f (12500)
 2.341077  10 4 ln(12500)  8.775468  10 8 ln 12500  2.293775  10 3
3

 1.1655  10 5
 
f R  f Rm   f 11000 f 12500   4.4536  10 5  1.1655  10 5  0 
Hence the root is bracketed between Rm and Ru , that is, between 12500 and 14000 . So, the
lower and upper limits of the new bracket are
R  12500, Ru  14000
At this point, the absolute relative approximate error a cannot be calculated as we do not
have a previous approximation.
Iteration 2
The estimate of the root is
R  Ru
Rm  
2
12500  14000

2
 13250
f Rm   f 13250
 2.341077  10  4 ln 13250  8.775468  10 8 ln 13250  2.293775  10 3
3

 3.3599  10 6
 
f R  f Rm   f 12500 f 13250   1.1655  10 5 3.3599  10 6  0
Hence, the root is bracketed between R and Rm , that is, between 12500 and 13250 .
So the lower and upper limits of the new bracket are
R  12500, Ru  13250
The absolute relative approximate error a at the end of Iteration 2 is

Rmnew  Rmold
a   100
Rmnew

Department of Electrical Engineering Page 7


EEng-2206 Computational methods

13250  12500
  100
13250
 5.6604%

None of the significant digits are at least correct in the estimated root
Rm  13250
as the absolute relative approximate error is greater than 5% .

Iteration 3
R  Ru
Rm 
2
12500  13250

2
 12875
f Rm   f 12875
 2.341077  10 4 ln 12875  8.775468  10 8 ln 12875  2.293775  10 3
3

 4.0403  10 6
 
f R  f Rm   f 12500 f 12875   1.1654  10 5  4.0398  10 6  0 
Hence, the root is bracketed between Rm and Ru , that is, between 12875 and 13250 .
So, the lower and upper limits of the new bracket are

R  12875, Ru  13250
The absolute relative approximate error a at the end of Iteration 3 is

Rmnew  Rmold
a   100
Rmnew

12875  13250
  100
12875
 2.9126%

One of the significant digits is at least correct in the estimated root of the equation as the
absolute relative approximate error is less than 5% .
Seven more iterations were conducted and these iterations are shown in the Table 1.

Department of Electrical Engineering Page 8


EEng-2206 Computational methods

Table 1 Root of f x   0 as a function of the number of iterations for bisection method.

Iteration R Ru Rm a % f Rm 

11000 14000 12500 ----------  1.1655  10 5


2 12500 14000 13250 5.6604 3.3599  10 6
3 12500 13250 12875 2.9126  4.0403  10 6
4 12875 13250 13063 1.4354  3.1417  10 7
5 13063 13250 13156 0.71259 1.5293  10 6
6 13063 13156 13109 0.35757
7 13063 13109 13086 0.17910 6.0917  10 7
8 13063 13086 13074 0.089633 1.4791 10 7
9 13074 13086 13080 0.044796  8.3022  10 8
10 13074 13080 13077 0.022403 3.2470  10 8
 2.5270  10 8
At the end of the 10 th iteration,
a  0.022403 %
Hence the number of significant digits at least correct is given by the largest value of m for
which
a  0.5  10 2m
0.022403  0.5  10 2m
0.044806  10 2m
log0.044806  2  m
m  2  log0.044806  3.3487
So m  3 ,the number of significant digits at least correct in the estimated root 13077 is 3.

Advantages of bisection method


a) The bisection method is always convergent. Since the method brackets the root,
the method is guaranteed to converge.
b) As iterations are conducted, the interval gets halved. So one can guarantee the
error in the solution of the equation.
Drawbacks of bisection method
a) The convergence of the bisection method is slow as it is simply based on halving
the interval.
b) If one of the initial guesses is closer to the root, it will take larger number of
iterations to reach the root.
c) If a function f (x) is such that it just touches the x -axis (Figure 6) such as
f ( x)  x 2  0
it will be unable to find the lower guess, x , and upper guess, xu , such that
f ( x ) f ( xu )  0

Department of Electrical Engineering Page 9


EEng-2206 Computational methods

d) For functions f (x) where there is a singularity 1 and it reverses sign at the
singularity, the bisection method may converge on the singularity (Figure 7). An
example includes
1
f ( x) 
x
where x  2 , xu  3 are valid initial guesses which satisfy
f ( x  ) f ( xu )  0
However, the function is not continuous and the theorem that a root exists is also
not applicable.

f (x)

Figure 6 The equation f ( x)  x 2  0 has a single root at x  0 that cannot be bracketed.


1
A singularity in a function is defined as a point where the function becomes infinite. For example, for a function
such as 1 / x , the point of singularity is x  0 as it becomes infinite.

f (x)

Figure 7 The equation f x  


1
 0 has no root but changes sign.
x

Department of Electrical Engineering Page 10


EEng-2206 Computational methods

2.1.3 Newton-Raphson Method

Introduction
Method such as the bisection method of finding roots of a nonlinear equation f ( x)  0
require bracketing of the root by two guesses. Such method is called bracketing methods.
These methods are always convergent since they are based on reducing the interval between
the two guesses so as to zero in on the root of the equation.
In the Newton-Raphson method, the root is not bracketed. In fact, only one initial
guess of the root is needed to get the iterative process started to find the root of an equation.
The method hence falls in the category of open methods. Convergence in open methods is
not guaranteed but if the method does converge, it does so much faster than the bracketing
methods.
Derivation
The Newton-Raphson method is based on the principle that if the initial guess of the root of
f ( x)  0 is at x i , then if one draws the tangent to the curve at f ( xi ) , the point xi 1 where
the tangent crosses the x -axis is an improved estimate of the root (Figure 1).
Using the definition of the slope of a function, at x  xi
f xi  = tan θ
f xi   0
= ,
xi  xi 1
which gives
f xi 
xi 1 = xi  (1)
f xi 
Equation (1) is called the Newton-Raphson formula for solving nonlinear equations of the
form f x   0 . So starting with an initial guess, x i , one can find the next guess, xi 1 , by
using Equation (1). One can repeat this process until one finds the root within a desirable
tolerance.
Algorithm
The steps of the Newton-Raphson method to find the root of an equation f x   0 are
1. Evaluate f x  symbolically
2. Use an initial guess of the root, x i , to estimate the new value of the root, xi 1 , as
f xi 
xi 1 = xi 
f xi 
3. Find the absolute relative approximate error a as
xi 1  xi
a =  100
xi 1
4. Compare the absolute relative approximate error with the pre-specified relative
error tolerance, s . If a > s , then go to Step 2, else stop the algorithm. Also,
check if the number of iterations has exceeded the maximum number of iterations
allowed. If so, one needs to terminate the algorithm and notify the user.

Department of Electrical Engineering Page 11


EEng-2206 Computational methods

f (x)

f (xi) [xi, f (xi)]

f (xi+1)

θ
x
xi+2 xi+1 xi

Figure 1 Geometrical illustration of the Newton-Raphson method.

Example 1
Thermistors are temperature-measuring devices based on the principle that the thermistor
material exhibits a change in electrical resistance with a change in temperature. By
measuring the resistance of the thermistor material, one can then determine the temperature.
For a 10K3A Betatherm thermistor,

Thermally
conductive epoxy
coating

Tin plated copper


alloy lead wires

Figure 2 A typical thermistor.

the relationship between the resistance R of the thermistor and the temperature is given by
 1.129241  10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

T
where T is in Kelvin and R is in ohms.

A thermistor error of no more than  0.01C is acceptable. To find the range of the
resistance that is within this acceptable limit at 19C ,

Department of Electrical Engineering Page 12


EEng-2206 Computational methods

we need to solve
 1.129241 10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

19.01  273.15
and
 1.129241 10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

18.99  273.15
Use the Newton-Raphson method of finding roots of equations to find the resistance R at
18.99 C . Conduct three iterations to estimate the root of the above equation. Find the
absolute relative approximate error at the end of each iteration and the number of significant
digits at least correct at the end of each iteration.

Solution
Solving
 1.129241 10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

18.99  273.15
we get
f R   2.341077  10 4 ln( R)  8.775468  10 8 ln R   2.293775  10 3
3

2.341077  10 4  2.6326404  10 7 {ln( R)}2


f R  
R
Let us take the initial guess of the root of f R   0 as R0  15000.
Iteration 1
The estimate of the root is
f R0 
R1  R0 
f R0 
 2.341077  10 4 ln(15000)  8.775468  10 8 ln 150003 
 
  2.293775  10 3 
 15000   4 7

2.341077  10  2.6326404  10 {ln(15000)} 2

15000
5
3.5383  10
 15000 
1.7230  10 8
 15000  2053.5
 12946
The absolute relative approximate error a at the end of Iteration 1 is
R1  R0
a   100
R1
12946  15000
  100
12946
 15.862%
The number of significant digits at least correct is 0, as you need an absolute relative
approximate error of less than 5% for one significant digit to be correct in your result.

Department of Electrical Engineering Page 13


EEng-2206 Computational methods

Iteration 2
The estimate of the root is
f R1 
R2  R1 
f R1 

 2.341077  10 4 ln(12946)  8.775468  10 8 ln 129463 


 
  2.293775  10 3 
 12946   
2.341077  10  4  2.6326404  10 7 {ln(12946)}2
12946
6
 2.6140  10
 12946 
1.9906  10 8
 12946   131.32
 13078
The absolute relative approximate error a at the end of Iteration 2 is
R2  R1
a   100
R2
13078  12946
  100
13078
 1.0041%
The number of significant digits at least correct is 1, as the absolute relative approximate
error is less than 5% .

Iteration 3
The estimate of the root is
f  R2 
R3  R2 
f R2 
 2.341077  10 4 ln(13078)  8.775468  10 8 ln 130783 
 
  2.293775  10 3 
 13078   4 7

2.341077  10  2.6326404  10 {ln(13078)} 2

13078
8
 1.2914  10
 13078 
1.9710  10 8
 13078   0.65519
 13078
The absolute relative approximate error a at the end of Iteration 3 is
R3  R2
a   100
R3

Department of Electrical Engineering Page 14


EEng-2206 Computational methods

13078  13078
  100
13078
 0.0050097%
Hence the number of significant digits at least correct is given by the largest value of m for
which
a  0.5  10 2m
0.0050097  0.5  10 2m
0.010019  10 2m
log0.010019  2  m
m  2  log0.010019  3.9992
So
m3
The number of significant digits at least correct in the estimated root 13078 is 3.

Drawbacks of the Newton-Raphson Method


1. Divergence at inflection points
If the selection of the initial guess or an iterated value of the root turns out to be close to the
inflection point (For a function f x  , the point where the concavity changes from up-to-
down or down-to-up is called its inflection point. For example, for the function
f x   x  1 , the concavity changes at x  1 (see Figure 3), and hence (1,0) is an inflection
3

point. ) of the function f x  in the equation f x   0 , Newton-Raphson method may start


diverging away from the root. It may then start converging back to the root. For example, to
find the root of the equation
f x   x  1  0.512  0
3

the Newton-Raphson method reduces to


( xi  1)3  0.512
3
xi 1 = xi 
3( xi  1)2
Starting with an initial guess of x0  5.0 , Table 1 shows the iterated values of the root of the
equation. As you can observe, the root starts to diverge at Iteration 6 because the previous
estimate of 0.92589 is close to the inflection point of x  1 (the value of f ' x  is zero at the
inflection point). Eventually, after 12 more iterations the root converges to the exact value of
x  0.2 .

Table 1 Divergence near inflection point.


Iteration xi
Number

Department of Electrical Engineering Page 15


EEng-2206 Computational methods

0 5.0000
1 3.6560
2 2.7465
3 2.1084
4 1.6000
5 0.92589
6 –30.119
7 –19.746
8 –12.831
9 –8.2217
10 –5.1498
11 –3.1044
12 –1.7464
13 –0.85356
14 –0.28538
15 0.039784
16 0.17475
17 0.19924
18 0.2

Figure 3 Divergence at inflection point for f x   x  1  0 .


3

3. Division by zero
For the equation
f x   x 3  0.03x 2  2.4  106  0
the Newton-Raphson method reduces to
x  0.03xi  2.4  106
3 2
xi 1 = xi  i
3xi  0.06 xi
2

For x0  0 or x0  0.02 , division by zero occurs (Figure 4). For an initial guess close to
0.02 such as x0  0.01999 , one may avoid division by zero, but then the denominator in the

Department of Electrical Engineering Page 16


EEng-2206 Computational methods

formula is a small number. For this case, as given in Table 2, even after 9 iterations, the
Newton-Raphson method does not converge.

Table 2 Division by near zero in Newton-Raphson method.

Iteration
xi f ( xi ) a %
Number
0 0.019990  1.6000010-6
1 –2.6480 18.778 100.75
2 –1.7620 –5.5638 50.282
3 –1.1714 –1.6485 50.422
4 –0.77765 –0.48842 50.632
5 –0.51518 –0.14470 50.946
6 –0.34025 –0.042862 51.413
7 –0.22369 –0.012692 52.107
8 –0.14608 –0.0037553 53.127
9 –0.094490 –0.0011091 54.602

1.00E-05
f(x)
7.50E-06

5.00E-06

2.50E-06

0.00E+00
x
-0.03 -0.02 -0.01 0 0.01 0.02 0.03 0.04
-2.50E-06
0.02
-5.00E-06

-7.50E-06

-1.00E-05

Figure 4 Pitfall of division by zero or a near zero number.

2.1.4 Secant Method


What is the secant method and why would I want to use it instead of the Newton-
Raphson method?
The Newton-Raphson method of solving a nonlinear equation f ( x)  0 is given by the
iterative formula
f ( xi )
xi 1 = xi  (1)
f ( xi )
One of the drawbacks of the Newton-Raphson method is that you have to evaluate the
derivative of the function. To overcome these drawbacks, the derivative of the function,
f (x) is approximated as

Department of Electrical Engineering Page 17


EEng-2206 Computational methods

f ( xi )  f ( xi 1 )
f ( xi )  (2)
xi  xi 1
Substituting Equation (2) in Equation (1) gives
f ( xi )( xi  xi 1 )
xi 1  xi  (3)
f ( xi )  f ( xi 1 )
The above equation is called the secant method. This method now requires two initial
guesses, but unlike the bisection method, the two initial guesses do not need to bracket the
root of the equation. The secant method is an open method and may or may not converge.
However, when secant method converges, it will typically converge faster than the bisection
method. However, since the derivative is approximated as given by Equation (2), it typically
converges slower than the Newton-Raphson method.
The secant method can also be derived from geometry, as shown in Figure 1. Taking
two initial guesses, xi 1 and xi , one draws a straight line between f ( xi ) and f ( xi 1 ) passing
through the x -axis at xi 1 . ABE and DCE are similar triangles.
Hence
AB DC

AE DE
f ( xi ) f ( xi 1 )

xi  xi 1 xi 1  xi 1
On rearranging, the secant method is given as
f ( xi )( xi  xi 1 )
xi 1  xi 
f ( xi )  f ( xi 1 )

f (x)

f (xi) B

f (xi–1) C

E D A
x
xi+1 xi–1 xi

Figure 1 Geometrical representation of the secant method.

Department of Electrical Engineering Page 18


EEng-2206 Computational methods

Example 1
Thermistors are temperature-measuring devices based on the principle that the thermistor
material exhibits a change in electrical resistance with a change in temperature. By
measuring the resistance of the thermistor material, one can then determine the temperature.
For a 10K3A Betatherm thermistor,

Thermally
conductive epoxy
coating

Tin plated copper


alloy lead wires

Figure 2 A typical thermistor.

the relationship between the resistance R of the thermistor and the temperature is given by
 1.129241  10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

T
where T is in Kelvin and R is in ohms.

A thermistor error of no more than  0.01C is acceptable. To find the range of the
resistance that is within this acceptable limit at 19C , we need to solve
 1.129241 10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

19.01  273.15
and
 1.129241 10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

18.99  273.15
Use the secant method of finding roots of equations to find the resistance R at 18.99 C .
Conduct three iterations to estimate the root of the above equation. Find the absolute relative
approximate error at the end of each iteration and the number of significant digits at least
correct at the end of each iteration.

Solution
Solving
 1.129241 10 3  2.341077  10 4 ln( R)  8.775468  10 8 ln R 
1 3

18.99  273.15
We get
f ( R)  2.341077  10 4 ln( R)  8.775468  10 8 ln R   2.293775  10 3
3

Let us take the initial guesses of the root of f R   0 as R1  14000 and R0  15000 .

Iteration 1
The estimate of the root is

Department of Electrical Engineering Page 19


EEng-2206 Computational methods

f R0 R0  R1 


R1  R0 
f R0   f R1 
f R0   2.341077  10 4 ln R0   8.775468  10 8 ln R0   2.293775  10 3
3

 2.341077  10 4 ln 15000  8.775468  10 8 ln 15000  2.293775  10 3


3

 3.5383 10 5
f R1   2.341077  10 4 ln R1   8.775468  10 8 ln R1   2.293775  10 3
3

 2.341077  10 4 ln(14000)  8.775468  10 8 ln 14000  2.293775  10 3


3

 1.7563  10 5

 15000 
3.5383  10 15000  14000
5
R1
3.5383 10   1.7563 10 
5 5

= 13014
The absolute relative approximate error a at the end of Iteration 1 is
R1  R0
a   100
R1
13014  15000
  100
13014
 15.257 %
The number of significant digits at least correct is 0, as you need an absolute relative
approximate error of less than 5% for one significant digit to be correct in your result.
Iteration 2
The estimate of the root is
f R1 R1  R0 
R2  R1 
f R1   f R0 
f R1   2.341077  10 4 ln R1   8.775468  10 8 ln R1   2.293775  10 3
3

 2.341077  10 4 ln 13014  8.775468  10 8 ln 13014  2.293775  10 3


3

 1.2658  10 6

 13014 
 1.2658 10 13014  15000
6
R2
 1.2658 10   3.5383 10 
6 5

 13083
The absolute relative approximate error a at the end of Iteration 2 is
R2  R1
a   100
R2
13083  13014
  100
13083
 0.52422%
The number of significant digits at least correct is 1, because the absolute relative
approximate error is less than 5% .

Department of Electrical Engineering Page 20


EEng-2206 Computational methods

Iteration 3
The estimate of the root is
f R2 R2  R1 
R3  R2 
f R2   f R1 
f R2   2.341077  10 4 ln R2   8.775468  10 8 ln R2   2.293775  10 3
3

 2.341077  10 4 ln 13083  8.775468  10 8 ln 13083  2.293775  10 3


3

 8.8907 10 8
R3  13083 
8.8911 10 8 13083  13014
8.8911 10 8    1.2658 10 6 
 13078
The absolute relative approximate error a at the end of Iteration 3 is
R3  R2
a   100
R3
13078  13083
  100
13078
 0.034415%
The number of significant digits at least correct is 3, because the absolute relative
approximate error is less than 0.05% .

3.1 Roots of polynomial Equations


Introduction
A polynomial of degree n has the form

Where the coefficients may be real or complex. We will concentrate on polynomials with
real coefficients. The polynomial equation = 0 has exactly n roots, which may be real
or complex. If the coefficients are real, the complex roots always occur in conjugate pairs
( + i , - i ), where and are the real and imaginary parts, respectively. For real
coefficients, the number of real roots can be estimated from the rule of Descartes:
-The number of positive, real roots equals the number of sign changes in the
Expression for , or less by an even number.
-The number of negative, real roots is equal to the number of sign changes in ,
Or less by an even number.

Example2.2.1:
consider . Since the sign changes twice, = 0 has either
two or zero positive real roots. On the other hand =
contains a single sign change; hence possesses one negative real zero.

Evaluation of Polynomials

Department of Electrical Engineering Page 21


EEng-2206 Computational methods

Deflation of Polynomials
After a root r of = 0 has been computed, it is desirable to factor the polynomial as
follows:
(2.2.1)

This procedure, known as deflation or synthetic division, involves nothing more than
computing the coefficients of . Since the remaining zeros of are also the
zeros of , the root finding procedure can now be applied to rather than
. Deflation thus makes it progressively easier to find successive roots, because the
degree of the polynomial is reduced every time a root is found. Moreover, by eliminating
the roots that have already been found, the chances of computing the same root more than
once are eliminated.

If we let

Then Eq. (2.2.1) becomes


=

Equating the coefficients of like powers of , we obtain


This leads to Horner’s deflation algorithm.

Laguerre’s Method
Laguerre’s formulas are note easily derived for a general polynomial Pn(x).However, the
Derivation is greatly simplified if we consider the special case where the polynomial has a
zero at x = r and (n− 1) zeros at x = q. If the zeros were known, this polynomial can be
written as
(a)

Our problem is now this: given the polynomial in Eq. (a) in the form

Determine (note that is also unknown). It turns out that the result, which is exact for the
special case considered here, works well as an iterative formula with any polynomial.
Differentiating Eq. (a) with respect to x, we get

Thus

Department of Electrical Engineering Page 22


EEng-2206 Computational methods

(b)

Which up on differentiation yields


(c)

It is convenient to introduce the notation


(2.2.2)

So that Eqs. (b) and (c) become


(2.2.3a)

(2.2.3b)

If we solve Eq. (2.2.3a) for and substitute the result into Eq. (2.2.3b), we obtain a
Quadratic equation for . The solution of this equation is the Laguerre’s formula

(2.2.4)

The procedure for finding a zero of a general polynomial by Laguerre’s formula is:
1. Let be a guess for the root of = 0 (any value will do).
2. Evaluate , and .
4. Determine the improved root from Eq. (2.2.4) choosing the sign that results in the
larger magnitude of the denominator (this can be shown to improve convergence).
5. Let ← and repeat steps 2–5 until | | < ε or | − | < ε, where ε is the error
tolerance.

EXAMPLE 2.2.2
A zero of the polynomial is = 6. Deflate the
polynomial with Horner’s algorithm, i.e., find so that ( − 6) = .

Solution: With = 6 and = 4, With Horner’s deflation algorithm,


= =3
= + 6 = −10 + 6(3) = 8
= + 6 = −48 + 6(8) = 0
= + 6 = −2 + 6(0) =−2
Therefore,

Department of Electrical Engineering Page 23


EEng-2206 Computational methods

EXAMPLE 2.2.3
A root of the equation is approximately .
find a more accurate value of this root by one application of Laguerre’s iterative formula.

Solution
Use the given estimate of the root as the starting value. Thus

Substituting these values in and its derivatives, we get

Equations (2.2.2) then yield

The term under the square root sign of the denominator in Eq. (2.2.4) becomes

Now we must find which sign in Eq. (2.2.4) produces the larger magnitude of the
denominator:
| | | |
3.06448

| | | |

Using the minus sign, we obtain from Eq. (4.16) the following improved approximation for
the root

This approximation is already quite close to the exact value = 3.2 − 0.8 .

Department of Electrical Engineering Page 24

You might also like