Sei sulla pagina 1di 51

Module 1

Roots of Single Equations

Problem: Find roots of an equation of the form


f (x) = 0,
where f (x) is a piecewise continuous function of x having numerical coefficients. The function f (x)
may be algebraic (i.e., a polynomial in x), as in
x3 3x + 1 = 0

or it may be transcendental, as in
2 cos x ex = 0

We will assume in general that f (x) is differentiable and that the labor of obtaining the numerical value
of f (x) for any value of x is not excessive.
Example: Longest ladder
1

Module 1: Roots of Single Equations

1.1
1.1.1

Polynomial Equations
General Form

f (x)

= xn + a1 xn1 + a2 xn2 + + an1 x1 + an = 0


n
X
=
ai xni = 0,
a0 = 1,
an 6= 0
i=0

(x x1 )(x x2 )(x x3 ) (x xn )
n
Y
=
(x xi ),
xi 6= 0

i=1

1.1.2

Some Properties

1. There are n roots.


2. The roots may be real or complex; complex roots occur in conjugate pairs. There is at least one real
root if n is odd.
3. Equal roots may exist. If the root xj occurs m times, it is said to be of multiplicity m.
4. The number of positive roots is equal to the number of sign changes of the coefficients of f (x) or
is less than this by an even number. The number of negative roots is equal to the number of sign
changes of the coefficients of f (x) or is less than this by an even number.

Graphical example: cubic equation with (a) 3 distinct real roots (b) 1 distinct and 2 equal real roots (c) 1
real and a pair of complex roots (d) 3 equal real roots

1.1.3

History

A little bit of history on the quest for solutions to polynomial equations:


The quadratic formula for solving quadratic equations has been known since ancient times. It is
easily derived by completing the square.
In the 1500s, earnest search (motivated by prize money) fora similar general procedure to solve
cubic and quartic equations was started in Italian universities: Tartaglia, Cardano, Ferrari.
For the next three centuries, mathematicians used every ingenious way to find general solutions
to quintic and higher degree equations: all to no avail.
In 1824, Neils Henrick Abel, a Norwegian mathematician, proved that it is impossible to solve
quintic equations in terms of a universal, finite procedure involving only elementary operations
of arithmetic and algebra. He was 22 years old.
In 1832, Evariste Galois, a French mathematician, the night before he was killed in a duel, wrote
down the proof that there is no general, finite procedure to solve all equations of degree five or
higher in terms of elementary operations. He was 20.

E. P. Quiwa

1.2

Transcendental Equations

A transcendental equation may have a finite or an infinite number of roots. The roots may be complex
or real.
Examples:
sin x 2 = 0
1
sin x
= 0
2
x
sin x
= 0
2
There are no formulas, in the manner of the quadratic formula, for solving transcendental equations. In
general, we solve these equations using numerical methods.

1.3

Iterative Numerical Methods

Definition: An iterative numerical method for finding a root, say x


, of the equation f (x) = 0 is a
numerical method in which a sequence of estimates of x
is generated such that
x0 x1 x2 x3 xk xk+1
If the sequence of estimates leads to x
, the method is said to converge; otherwise, it is said to diverge.
Using an iterative numerical method involves essentially two tasks, viz.,
a. finding an initial estimate, x0 , fo the desired root
b. refining the estimate to some prescribed degree of accuracy

1.4

Finding an Initial Estimate of the Root

1. physical considerationthe equation to be solved may be descriptive of a physical phenomenon


from which we can deduce an approximate value of the solution
Example: the Beattie-Bridgeman equation of state for an imperfect (actual) gas is
P V = RT +

+ 2 + 3,
V
V
V

where , and are empirical constants for the gas. To obtain an initial estimate of V given P and
RT
T , we could assume that the gas is an ideal gas. Then P V = RT and V0 =
.
P
2. graphical procedureplot the given equation, as a whole or by parts
3. another numerical methode.g., Graeffes Root-Squaring Method, for polynomial equations.
4. others

Module 1: Roots of Single Equations

1.5

Method of Successive Substitutions

To apply the MoSS, we first transform the given equation f (x) = 0 into the form x = F (x). The effect of
this transformation is graphically shown below:

In principle, there are many possible ways of generating the form x = F (x) for a given f (x) = 0. As a
rule, we should choose F (x) to be as simple as possible. Depending on the form of F (x) that we choose,
MoSS may:

a. converge to the desired root


b. converge, but not to the desired root
c. diverge

Example:
f (x) = x2 4 = 0

x=

4
x

Add 4 to both sides and divide by x

x = x2 + x 4

x=

1
2


x+

4
x

Add x to both sides

Add x2 + 4 to both sides and divide by 2x

E. P. Quiwa

1.5.1

Summary

Form of the equation: x = F (x)


Iterative formula: xk+1 = F (xk )
Sufficient condition for convergence: |F 0 (x)| < 1
Criteria for termianting the iterations:
a. Absolute error criterion: |xk+1 xk | <


xk+1 xk
<

b. Relative error criterion:
xk+1

or
or
and

c. others
d. A prescribed maximum number of iterations, itmax

1.5.2

EASY Implementation

procedure MOSS(, itmax, xold)


iter 0
output iter, xold, Initial estimate
for iter 1 to itmax do
xnew F (xold)
xerr |(xnew xold)/xnew|
output iter, xnew, xerr
if xerr < then return
else xold xnew
end for
return
end procedure

//function call to evaluate F (xk )//

//method converges within itmax iterations//

//method fails to converge in itmax iterations//

In general, a procedure to implement an iterative numerical method, such as procedure MOSS given
above, has four parts:
a. initialization
b. computation
c. testing
d. modification
Example 1. Find the roots of the equation x3 3x + 1 = 0. Iterate until the relative error is less than
= 106 or the number of iterations exceeds 20, whichever occurs first.
Solution:
a. Cast the given equation into a form suitable for the MoSS, i.e., x = F (x). Let
x=

x3 + 1
3

b. Find initial estimates: see graph of f (x) = x3 3x + 1 = 0


c. Perform analysis for convergence of the chosen F (x)
Since F 0 (x) = x2 , then |F 0 (x)| < 1 if |x| < 1, or if 1 < x < 1. Hence, F (x) =
middle root, but probably not the other roots.

x3 + 1
will yield the
3

Module 1: Roots of Single Equations


d. EASY procedures
procedure MAIN()
1: input x0
call MOSS(106 , 20, x0)
go to 1
end procedure
procedure F(x)
return (x3 + 1)/3
end procedure
e. Results:
Original equation: x3 3x + 1 = 0
x3 + 1
Transformed equation: x =
3
itmax =20, =106
Iterations of the MoSS:


xk xk1
k
k
xk
xk
0
1
2
3
4
5
6
7
8

.5000000
.3750000
.3509115
.3477369
.3473496
.3473028
.3472971
.3472964
.3472964

//initial estimate//

xk

0 1.5000000
1 1.4583333
2 1.3671634
3 1.1851380
4 .8881960
5 .5668969
6 .3940616
7 .3537306
8 .3480869
9 .3473919
10 .3473079
11 .3472977
12 .3472965
13 .3472964
Original equation: x3 3x +1 = 0
Transformed equation: x = 3 3x 1
itmax =20, =106
Iterations of the MoSS:


xk xk1
k
xk
xk
0 1.5000000
1 1.5182945 .0120494
2 1.5261895 .0051730
3 1.5295715 .0022111
4 1.5310157 .0009433
5 1.5316315 .0004021
6 1.5318940 .0001713
7 1.5320059 .0000730
8 1.5320535 .0000311
9 1.5320738 .0000133
10 1.5320825 .0000056
11 1.5320862 .0000024
12 1.5320877 .0000010
13 1.5320884 .0000004
.3333333
.0686456
.0091291
.0011152
.0001347
.0000163
.0000020
.0000002



xk xk1
xk
.0285714
.0666855
.1535901
.3343204
.5667680
.4385997
.1140163
.0162134
.0020005
.0002420
.0000292
.0000035
.0000004

xk



xk xk1
xk

0 1.8000000
1 1.6106667 .1175497
2 1.0594891 .5202296
3 .0630982 5.7911022
4
.3332496 1.1893423
5
.3456697 .0359306
6
.3471011 .0041238
7
.3472728 .0004945
8
.3472935 .0000596
9
.3472960 .0000072
10
.3472963 .0000009

xk



xk xk1
xk

0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18

.5000000
.7937005
1.1136324
1.3277841
1.4395768
1.4916170
1.5146492
1.5246229
1.5289016
1.5307298
1.5315097
1.5318421
1.5319837
1.5320441
1.5320698
1.5320808
1.5320854
1.5320874
1.5320883

.3700395
.2872868
.1612850
.0776567
.0348884
.0152063
.0065417
.0027985
.0011944
.0005092
.0002170
.0000925
.0000394
.0000168
.0000071
.0000030
.0000013
.0000006

E. P. Quiwa

Original equation: x3 3x + 1p= 0


Transformed equation: x = 3 |3x 1|
itmax =20, =106
Iterations of the MoSS:

xk



xk xk1
xk

0
1
2
3
4
5
6
7
8
9
10

1.8000000
1.8566355
1.8729222
1.8775536
1.8788665
1.8792384
1.8793437
1.8793735
1.8793819
1.8793843
1.8793850

.0305044
.0086958
.0024668
.0006988
.0001979
.0000560
.0000159
.0000045
.0000013
.0000004

Original equation: x3 3x + 1 = 0
2x3 1
Transformed equation: x = 2
3x 3
itmax =20, =106
Iterations of the MoSS:

xk



xk xk1
xk

xk



xk xk1
xk

0
1
2
3
4

.5000000
.3333333
.3472222
.3472964
.3472964

.5000000
.0400000
.0002135
.0000000

0
1
2
3
4

1.8000000
1.8845238
1.8794047
1.8793852
1.8793852

.0448515
.0027238
.0000104
.0000000

0 1.5000000
1 1.5333333 .0217391
2 1.5320906 .0008111
3 1.5320889 .0000011
4 1.5320889 .0000000

xk



xk xk1
xk

Example 2. For turbulent flow (Re > 2000) of a fluid in a smooth pipe, the relationship between the
friction factor f and the Reynolds number Re is given by the equation
r

p
1
= 1.74 ln(Re f ) 0.40
f

Calculate f for Re = 5000, 10000, 50000, 100000, 500000, 1000000. Iterate until the relative error is less
than = 106 or the number of iterations exceeds 20, whichever occurs first.
Solution:
a. Cast given equation in a form suitable for the MoSS, i.e., f = F (f ),
f=

[1.74 ln(Re f ) 0.40]2

b. Given Re, find an initial estimate. To this end, we use another empirical formula relating f and Re
explicitly,
0.316
f=
(Blassiuss equation)
Re0.25
Blassiuss equation gives an approximate value of f for a very smooth pipe for 3000 < Re <
100000.

Module 1: Roots of Single Equations


c. EASY procedures
procedure MAIN()
1: input Re
f 0 0.316/Re0.25
call MOSS(106 , 20, f 0)
go to 1
end procedure

//Re is assumed to be global//

procedure F(f )

return 1.0/(1.74 ln(Re f ) 0.40)2


end procedure
d. Results:
r

p
1
= 1.74 ln(Re f ) 0.40
f
1

Transformed equation: f =
(1.74 ln(Re f ) 0.40)2
6
itmax =20, =10
Iterations of the MoSS:
Original equation:



fk fk1
fk
0 .0375789 (Re = 5000)
1 .0074765 4.0263074
2 .0096868 .2281781
3 .0092710 .0448467
4 .0093395 .0073364
5 .0093280 .0012386
6 .0093299 .0002080
7 .0093296 .0000350
8 .0093296 .0000059
9 .0093296 .0000010

fk

fk

0
1
2
3
4
5
6
7
8
9

.0316000
.0062784
.0079513
.0076677
.0077103
.0077038
.0077048
.0077046
.0077046
.0077046



fk fk1
fk
(Re = 10000)
4.0331477
.2103952
.0369872
.0055261
.0008468
.0001293
.0000197
.0000030
.0000005

e. Summary of results for the friction problem using MoSS

1.6

Reynolds number

Initial estimate

Final estimate

Number of iterations

Relative error

5000
10000
50000
100000
500000
1000000

.0375789
.0316000
.0211322
.0177700
.0118835
.0099928

.0093296
.0077046
.0052110
.0044870
.0032814
.0029040

9
9
8
8
8
7

.0000010
.0000005
.0000007
.0000004
.0000001
.0000009

Wegsteins Method

Consider again the iterative formula for the MoSS:


xk+1 = F (xk )

(1.1)

Adding and subtracting xk to, and from the right side of (1.1), we obtain
xk+1 = F (xk ) xk + xk = k + xk ,
where
k = F (xk ) xk = xk+1 xk

(1.2)

E. P. Quiwa

is the kth iteration estimate of the error ek ,


x
xk
of the kth estimate xk , of the root x
. The figures below show the geometrical representation of the
quantities.

0 < F 0 (x) < 1

1 < F 0 (x) < 0

From these figures, we see that our estimate, k , of the error, ek , is either too small or too large. We either
undershoot or overshoot the root. This suggests that we might be able to improve on (1.2) by applying
an appropriate factor on k , such that
xk+1 = xk + k
(1.3)
In (1.3), the factor is called a relaxation factor, and is either less than or greater than unity depending
on whether k over-estimates or under-estimates ek . From the figures above, we see that the best choice
ek
for is , so that in one iteration we find x
:
k
ek
xk+1 = xk +
k = xk + ek = x

k
Unfortunately, this expression for cannot be used since ek is not known in the first place. To arrive at
a workable expression for , consider the figure below:

10

Module 1: Roots of Single Equations

From the figure above, we obtain the following relations:


tan =

F (
x) F (xk )
( 1)k
1
=
=
= F 0 (),
k

x
xk

where xk x
(mean value theorem). Hence,
1
= F 0 ()

or
=

1
1 F 0 ()

(1.4)

The value of is unknown, but we can approximate the value of F 0 () by the slope of the chord QR, i.e.,
F 0 () =

F [F (xk )] F (xk )
F (xk+1 ) F (xk )
=
xk+1 xk
F (xk ) xk

Hence,
=

1
1

F [F (xk )]F (xk )


F (xk )xk

F (xk ) xk
2F (xk ) xk F [F (xk )]

(1.5)

Substituting (1.5) in (1.3), we obtain the iterative formula for the Wegstein method:
xk+1 = xk +

F (xk ) xk
[F (xk ) xk ]
2F (xk ) xk F [F (xk )]

Simplifying,
xk+1 =

[F (xk )]2 xk F [F (xk )]


2F (xk ) xk F [F (xk )]

(1.6)

Equation (1.6) may be applied to both the convergent and divergent cases of the MoSS. From Eq. (1.4),
the bounds on can be determined for each of these cases:
Case 1
0 < F 0 (x) < 1
Case 2 1 < F 0 (x) < 0
Case 3
F 0 (x) > 1
Case 4
F 0 (x) < 1

1<<
<<1
< 0 Positive slope, too steep
0 < < 21 Negative slope, too steep

1
2

Given below is the graphical representation of Wegsteins formula:

E. P. Quiwa

11

tan =

F (xk+1 ) F (xk )
xk+1 xk

F [F (xk )] F (xk )
F (xk ) xk

xk+1 [F (xk ) xk ] [F (xk )]2 + xk F (xk ) = xk+1 [F [F (xk )] F (xk )] xk F [F (xk )] + xk F (xk )
xk+1 [2F (xk ) xk F [F (xk )]] = [F (xk )]2 xk F [F (xk )]
Finally:
xk+1 =

1.6.1

[F (xk )]2 xk F [F (xk )]


2F (xk ) xk F [F (xk )]

Summary

Form of the equation: x = F (x)


[F (xk )]2 xk F [F (xk )]
Iterative formula: xk+1 =
2F (xk ) xk F [F (xk )]
Convergence: may converge for cases where MoSS diverges
Criteria for termianting the iterations:
a. Absolute error criterion: |xk+1 xk | <


xk+1 xk
<
b. Relative error criterion:
xk+1

or
or
and

c. others
d. A prescribed maximum number of iterations, itmax

1.6.2

EASY Implementation

procedure WEGSTEIN(, itmax, xold)


iter 0
output iter, xold, Initial estimate
for iter 1 to itmax do
F xold F (xold)
//function call to evaluate F (xk )//
F F xold F (F xold)
//function call to evaluate F [F (xk )]//
xnew (F xold2 xold F F xold)/(2 F xold xold F F xold)
xerr |(xnew xold)/xnew|
output iter, xnew, xerr
if xerr < then return
//method converges within itmax iterations//
else xold xnew
end for
return
//method fails to converge in itmax iterations//
end procedure
Example 1. Find the roots of the equation x3 3x + 1 = 0. Iterate until the relative error is less than
= 106 or the number of iterations exceeds 20, whichever occurs first.
Solution:
a. Cast the given equation into a form suitable for Wegsteins method, i.e., x = F (x). Let
x=

x3 + 1
3

b. Find initial estimates: see graph of f (x) = x3 3x + 1 = 0

12

Module 1: Roots of Single Equations


c. EASY procedures
procedure MAIN()
1: input x0
call WEGSTEIN(106 , 20, x0)
go to 1
end procedure

//initial estimate//

procedure F(x)
return (x3 + 1)/3
end procedure
d. Results:
Original equation: x3 3x + 1 = 0
x3 + 1
Transformed equation: x =
3
itmax =20, =106
Iterations of Wegsteins method:

k
0
1
2
3

xk



xk xk1
xk

.5000000
.3451613 .4485981
.3472961 .0061471
.3472964 .0000006

xk



xk xk1
xk

0
1
2
3
4
5

1.8000000
1.8990678
1.8803619
1.8793877
1.8793852
1.8793852

.0521665
.0099481
.0005183
.0000013
.0000000

xk



xk xk1
xk

0 1.5000000
1 1.5350706 .0228463
2 1.5321124 .0019308
3 1.5320889 .0000154
4 1.5320889 .0000000

Example 2. For turbulent flow (Re > 2000) of a fluid in a smooth pipe, the relationship between the
friction factor f and the Reynolds number Re is given by the equation
r
p
1
= 1.74 ln(Re f ) 0.40
f
Calculate f for Re = 5000, 10000, 50000, 100000, 500000, 1000000. Iterate until the relative error is less
than = 106 or the number of iterations exceeds 20, whichever occurs first.
Solution:
a. Cast given equation in a form suitable for Wegsteins method, i.e., f = F (f ),
f=

[1.74 ln(Re f ) 0.40]2

b. Given Re, find an initial estimate. To this end, we use another empirical formula relating f and Re
explicitly,
0.316
f=
(Blassiuss equation)
Re0.25
Blassiuss equation gives an approximate value of f for a very smooth pipe for 3000 < Re <
100000.
c. EASY procedures
procedure MAIN()
1: input Re
f 0 0.316/Re0.25
call WEGSTEIN(106 , 20, f 0)
go to 1
end procedure

//Re is assumed to be global//

E. P. Quiwa

13

procedure F(f )

return 1.0/(1.74 ln(Re f ) 0.40)2


end procedure
d. Results:
r

p
1
= 1.74 ln(Re f ) 0.40
f
1

Transformed equation: f =
(1.74 ln(Re f ) 0.40)2
itmax =20, =106
Iterations of Wegsteins method:
Original equation:

fk

0
1
2
3
4

.0375789
.0095356
.0093297
.0093296
.0093296



fk fk1
fk
(Re = 5000)
2.9409245
.0220679
.0000072
.0000000

fk

0
1
2
3
4

.0316000
.0078476
.0077047
.0077046
.0077046



fk fk1
fk
(Re = 10000)
3.0267003
.0185538
.0000042
.0000000

fk

0
1
2
3

.0177700
.0045330
.0044870
.0044870



fk fk1
fk
(Re = 100000)
2.9201082
.0102679
.0000007

e. Summary of results for the friction problem: MoSS and Wegstein


MosS
Reynolds number
5000
10000
50000
100000
500000
1000000
Wegsteins method
Reynolds number

Initial estimate

Final estimate

# of Iterations

Relative error

.0375789
.0316000
.0211322
.0177700
.0118835
.0099928

.0093296
.0077046
.0052110
.0044870
.0032814
.0029040

9
9
8
8
8
7

.0000010
.0000005
.0000007
.0000004
.0000001
.0000009

Initial estimate

Final estimate

# of Iterations

Relative error

.0375789
.0316000
.0211322
.0177700
.0118835
.0099928

.0093296
.0077046
.0052110
.0044870
.0032814
.0029040

4
4
4
3
3
3

.0000000
.0000000
.0000005
.0000007
.0000002
.0000001

5000
10000
50000
100000
500000
1000000

1.7

Newtons Method

Let = xk in the expression for , such that


=

1
1
=
1 F 0 ()
1 F 0 (xk )

Then, we have
xk+1

= xk + k
1
= xk +
[F (xk ) xk ]
1 F 0 (xk )

or
xk+1 = xk +

F (xk ) xk
,
1 F 0 (xk )

(1.7)

14

Module 1: Roots of Single Equations

which is Newtons formula for the form of the equation x = F (x).


The graphical representation of this formula is shown below:

From the figure:


tan = F 0 (xk ) =

xk+1 F (xk )
xk+1 xk

Hence, we have
xk+1 F (xk ) = xk+1 F 0 (xk ) xk F 0 (xk )
xk+1 xk+1 F 0 (xk ) = F (xk ) xk F 0 (xk ) + xk xk
xk+1 (1 F 0 (xk )) = F (xk ) xk + xk (1 F 0 (xk ))
Finally
xk+1 = xk +

F (xk ) xk
1 F 0 (xk )

A simpler version of Newtons formula can be derived for the original equation f (x) = 0 by noting that
F (x) = x f (x)

and

F 0 (x) = 1 f 0 (x)

and substituting into (1.7) to yield


xk+1 = xk +

xk f (xk ) xk
1 [1 f 0 (xk )]

or

f (xk )
,
f 0 (xk )
which is Newtons iterative formula for the form of the equation f (x) = 0.
xk+1 = xk

1.7.1

Taylor Series Expansion of a Function

Given a function y = f (x), the Taylor series expansion of f (x) about x = a is


f (x)

f 0 (a)
f 00 (a)
f 000 (a)
f (n) (a)
(x a)1 +
(x a)2 +
(x a)3 + +
(x a)n +
1!
2!
3!
n!

X
f (p) (a)
=
(x a)p
p!
p=0
= f (a) +

E. P. Quiwa

1.7.2

15

Derivation of Newtons Iterative Formula from the Taylor Series Expansion


of f (x)

Expanding f (x) about x = xk we have


f (x) = f (xk ) +

f 0 (xk )
(x xk )1 +
1!

(1.8)

where means the remaining terms of the series (an infinite number of terms). Evaluating (1.8) at
x=x
, we obtain
f 0 (xk )
(
x xk )1 +
f (
x) = 0 = f (xk ) +
1!
Dropping the remaining terms of the series, we obtain the approximation
f (
x) = 0 f (xk ) +

f 0 (xk )
(
x xk )1
1!

(1.9)

If (1.9) is to be of any computational use, the must be replaced by =. We can do this provided that we
replace x
by an estimate of x
, say xk+1 , thus:
0 = f (xk ) +

f 0 (xk )
(xk+1 xk )1
1!

Solving for xk+1 gives


xk+1 = xk

1.7.3

f (xk )
f 0 (xk )

Graphical Representation of Newtons Formula

tan

= f 0 (xk )
f (xk )
=
xk xk+1

By construction
By definition

Equating both expressions for tan and solving for xk+1 yields Eq. (1.10).

(1.10)

16

Module 1: Roots of Single Equations

1.7.4

Condition for Convergence of Newtons Method

From MoSS:
xk+1 = F (xk ) = xk

f (xk )
f 0 (xk )

Newtons method is the MoSS if we take F (x) to be


F (x) = x

f (x)
f 0 (x)

Hence, we have
F 0 (x)

=
=
=

f 0 (x)f 0 (x) f (x)f 00 (x)


[f 0 (x)]2
0
2
[f (x)] [f 0 (x)]2 + f (x)f 00 (x)
[f 0 (x)]2
00
f (x)f (x)
[f 0 (x)]2

and the condition for convergence of Newtons method is




f (x)f 00 (x)
0

<1
|F (x)| =
[f 0 (x)]2
Qualitatively:
1. x0 should be sufficiently close to x

2. f 0 (xk ) should not be close to zero for k = 0, 1, 2, . . .

Example: Calculate sin



xk+1 xk

< 0.001
0.52 using
xk+1

Let x = sin1 0.52 or sin x = 0.52. Then:


f (x)
f 0 (x)
1st iteration: We note that sin1 0.50 = 30o =
f (x0 )

f 0 (x0 )

=
=

sin x 0.52 = 0
cos x

. Taking x0 = = 0.523599:
6
6

0.52 = 0.02
6

cos = 0.866025
6

sin

E. P. Quiwa

17

x1


x1 x0


x1

f (x0 )
0.020000
= 0.523599
= 0.523599 + 0.023094
f 0 (x0 )
0.866025
= 0.546693
0.023094
=
= 0.042243
0.546693

= x0

2nd iteration
f (x1 ) = 0.000135
f 0 (x1 ) = 0.854248
f (x1 )
x2 = x1 0
= 0.546535
f (x1 )


x2 x1


x2 = 0.000289 < 0.001
sin1 0.52 0.546535

1.7.5

Summary

Form of the equation: f (x) = 0


f (xk )
Iterative formula: xk+1 = xk 0
f
(x k )

f (x)f 00 (x)
<1
Convergence criterion:
[f 0 (x)]2
Criteria for termianting the iterations:
a. |f (xk )| <

or

b. Absolute error criterion: |xk+1 xk | <




xk+1 xk

<
c. Relative error criterion:
xk+1

or
or
and

d. others
e. A prescribed maximum number of iterations, itmax

1.7.6

EASY Implementation

procedure NEWTON(, itmax, x)


iter 0
f x f (x)
output iter, x, f x, Initial estimate
for iter 1 to itmax do
df x df (x)
if df x = 0 then return
x x f x/df x
f x f (x)
output iter, x, f x
if |f x| < then return
end for
return
end procedure

//function call to evaluate f (x0 )//


//function call to evaluate f 0 (xk ), k = 0, 1, 2, . . .//
//zero slope; terminate iterations//
//function call to evaluate f (xk ), k = 1, 2, . . .//
//method converges within itmax iterations//
//method fails to converge in itmax iterations//

18

Module 1: Roots of Single Equations

Example 1. Find the roots of the equation x4 2 2x3 + 4 2x 4 = 0. Iterate until |f (xk )| < or the
number of iterations exceeds 20, whichever occurs first.
Solution:
a. Find initial estimates

From the plot of f (x) = 0, we see that there is a distinct negative root near 1.5 and three equal
positive roots near 1.5.
b. EASY procedures
procedure MAIN()
1: input x0
call NEWTON(106 , 20, x0)
go to 1
end procedure

//initial estimate//

procedure f(x)

return x4 2 2 x3 + 4 2 x 4
end procedure
procedure df(x)

return 4 x3 6 2 x2 + 4 2
end procedure
c. Results

Given equation: x4 2 2x3 + 4 2x 4 = 0


itmax =20, =106
Iterations of Newtons method:

xk
|f (xk )|
1.5000000 .0018398
1.4716824 .0005477
1.4526524 .0001628
1.4398965 .0000484
1.4313611 .0000143
1.4256567 .0000043
1.4218475 .0000013
1.4193051 .0000004

The true roots are x


1 = 2 = 1.414213562 . . . and x
2 = x
3 = x
4 = 2. Note the rapid convergence (quadratic) of Newtons method in finding x
1 and the accuracy of the result. In contrast,
the method exhibits slow convergence (linear) in finding the multiple root. Likewise, the final
estimate is accurate only to three digits, a tolerance of 106 notwithstanding. This is because the
function is tangent to the x-axis at a multiple root (crosses the axis if the multiplicity is odd, but
does not, otherwise). A very small tolerance must be used to get more nearly accurate estimates.
k
0
1
2
3

xk
1.5000000
1.4211748
1.4142645
1.4142136

|f (xk )|
2.1231602
.1586797
.0011517
.0000001

k
0
1
2
3
4
5
6
7

E. P. Quiwa

19

Given equation: x4 2 2x3 + 4 2x 4 = 0


itmax =20, =1012
Iterations of Newtons method:

xk
1.5000000
1.4716824
1.4526524
1.4398965
1.4313611

|f (xk )|
.1839828D 02
.5477439D 03
.1628243D 03
.4835084D 04
.1434750D 04

15 1.4144124
16 1.4143461
17 1.4143019
18 1.4142725

3
4
Given equation: x 2 2x + 4 2x 4 = 0
itmax =30, =1016
Iterations of Newtons method:

.2223609D 10
.6588547D 11
.1952177D 11
.5784258D 12

k
0
1
2
3
4
..
.

k
0
1
2
3
4
..
.

xk
1.5000000
1.4716824
1.4526524
1.4398965
1.4313611

|f (xk )|
.1839828D 02
.5477439D 03
.1628243D 03
.4835084D 04
.1434750D 04

23
24
25
26

1.4142213
1.4142187
1.4142170
1.4142159

.1320558D 14
.3911801D 15
.1162265D 15
.3426079D 16

Example 2. Shown below is the schematic diagram of a 4-bar mechanism.

= input angle
= output angle
a = length of input crank
b = length of coupler link
c = length of output crank
d = length of fixed link

The relationship between the input angle and the output angle is given by Freudensteins equation
R1 cos R2 cos + R3 cos( ) = 0,
where
R1

R2

R3

d
c
d
a
a2 b2 + c2 + d2
2ac

20

Module 1: Roots of Single Equations

For b = c = d = 2a, the input crank describes a full circle while the output crack oscillates. It is desired
to generate a table of vs values for the full range of motion of the mechanism, with varying in
increments of 10o .
Solution: We will use Newtons method with the following termination criteria: |f (x)| < 106 , itmax =
20.
a. Initial estimates: we need to generate 36 initial estimates of , one for each value of . For = 0o ,
we draw the mechanism (more or less to scale) and measure , say with a protractor. We find that
is approximately 40o . For = 10o , 20o , 30o , . . ., we will use as 0 the final estimate of that we
obtained for = 0o , 10o , 20o , . . ., respectively.
b. EASY procedures
procedure MAIN()
//R1, R2, R3 and are assumed to be global variables//
input a, b, c, d,
//1, 2, 2, 2, 40//
R1 d/c
R2 d/a
R3 (a2 b2 + c2 + d2)/(2 a c)
0.0174533
for 0 to 360 by 10 do
0.0174533
call NEWTON(106 , 20, )
end for
end procedure
procedure f()
return R1 cos() R2 cos() + R3 cos( )
end procedure
procedure df()
return R2 sin() sin( )
end procedure
c. Results
Given equation: R1 cos R2 cos + R3 cos( ) = 0
itmax =20, =106
Iterations of Newtons method:

k
k
|f (k )|
0 .6981317 .0481333( = 0o )
1 .7230924 .0007109
2 .7227343 .0000001

k
0
1
2
3

k
.7227343
.7870801
.7846756
.7846724

|f (k )|
.1186553( = 10o )
.0047886
.0000065
.0000000

|f (k )|
.1321611( = 20o )
.0059042
.0000095
.0000000

k
0
1
2
3

k
.8537284
.9325267
.9291011
.9290949

|f (k )|
.1443298( = 30o )
.0068645
.0000124
.0000000

k
0
1
2
3

k
.7846724
.8566891
.8537332
.8537284

E. P. Quiwa

21

d. Summary of results for Freudensteins equation: Newtons method


, degrees
0
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
250
260
270
280
290
300
310
320
330
340
350
360

, degrees
41.4096300
44.9584200
48.9150400
53.2332200
57.8526700
62.7013200
67.6969800
72.7474100
77.7480900
82.5772100
87.0869300
91.0901000
94.3411000
96.5106600
97.1608200
95.7450900
91.7057300
84.7856700
75.5225100
65.3727300
55.9497900
48.1571700
42.1293600
37.6277500
34.3411000
32.0036100
30.4179500
29.4471100
29.0006900
29.0229700
29.4837700
30.3715600
31.6876900
33.4410400
35.6425100
38.2992900
41.4096200

|f ()|
.0000001
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000003
.0000000
.0000000
.0000000
.0000001
.0000002
.0000004
.0000007
.0000008
.0000008
.0000006
.0000004
.0000002
.0000001
.0000000
.0000000
.0000000
.0000001
.0000000
.0000000
.0000001
.0000003
.0000008
.0000000
.0000000

Iterations
2
3
3
3
3
3
3
3
3
3
3
3
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
3
3

Example 3. Find the roots of the equation x4 2 2x3 + 10 2x 25 = 0. iterate until |f (xk )| < 106 or
the number of iterations exceeds 20, whichever occurs first.
Solution:
a. Find initial estimates.

22

Module 1: Roots of Single Equations


From the plot of f (x) = 0, we see that there is a negative root near 2.1 and a positive root near 2.1.
The two other roots are complex. Assume that we obtain initial estimates for the complex roots by
factoring out (x + 2) and (x 2) to obtain a quadratic equation
whose roots
are found from the
quadratic formula. These turn out to be 1.5 1.3i if we replace 2 2 and 10 2 in the equation by
3 and 14 respectively (just to simplify the computations).
b. EASY procedures
procedure NEWTON can be used to find all the roots of the given equation by simply declaring x,
f x and df x to be complex. Note that |f x| is real, so the test
if |f x| < then return
where is real is valid.
procedure MAIN()
1: input x0
call NEWTON(106 , 20, x0)go to 1
end procedure

//initial estimate must be a complex number//

procedure f(x)

return x4 2 2 x3 + 10 2 x 25
end procedure

//function must be declared as complex//

procedure df(x)

return 4 x3 6 2 x2 + 10 2
end procedure

//function must be declared as complex//

c. Results
xk
f (xk )
|f (xk )|
2.1000000 + .0000000i 9.0563212 + .0000000i 9.0563212
2.2501331 + .0000000i
1.0365531 + .0000000i 1.0365531
2.2361991 + .0000000i
.0095732 + .0000000i .0095732
2.2360680 + .0000000i
.0000008 + .0000000i .0000008

k
0
1
2
3
k
0
1
2
3
k
0
1
2
3
4
5

1.7.7

xk
f (xk )
|f (xk )|
2.1000000 + .0000000i 2.0474788 + .0000000i 2.0474788
2.2487340 + .0000000i
.2099738 + .0000000i .2099738
2.2361753 + .0000000i
.0017637 + .0000000i .0017637
2.2360680 + .0000000i
.0000001 + .0000000i .0000001

xk
f (xk )
|f (xk )|
1.5000000 + 1.3000000i 6.7189498 + 4.1473827i 7.8958894
1.2811528 + 2.0478859i 11.7424264 + 2.0555213i 11.9209792
1.3648547 + 1.7872348i
2.0749252 +
.1814712i 2.0828458
1.4098347 + 1.7327260i
.0880942 +
.0799369i
.1189559
1.4142084 + 1.7320346i .0002478 +
.0003821i
.0004554
1.4142136 + 1.7320508i
.0000000 +
.0000000i
.0000000

A Variation on Newtons Method

If f (x) is such that evaluating f 0 (xk ) as k = 0, 1, 2, . . . is too cumbersome, then a secant, in lieu of a
tangent, line may be used to find xk+1 .

E. P. Quiwa

23

The iterative formula now becomes


xk+1 = xk
where
s=

f (xk )
s

f (xk ) f (xk )

for some suitable .


Example:

f (e) =

360

1.8
1.8.1

s

1 + e cos
1 e2

3 "
2 tan

1e

tan
1+e
2

e 1 e2 sin

=0
1 + e cos

Richmonds Method
Motivation

Consider applying a relaxation factor to Newtons method, as:


xk+1 = xk

Newtons method undershoots the root:


Apply > 1

f (xk )
f 0 (xk )

Newtons method overshoots the root:


Apply < 1

24

1.8.2

Module 1: Roots of Single Equations

Richmonds method: using Taylor Series Expansion of f (x) About x = xk


f 0 (xk )
f 00 (xk )
(x xk )1 +
(x xk )2 +
1!
2!
f 0 (xk )
f 00 (xk )
f (
x) = 0 = f (xk ) +
(
x xk )1 +
(
x xk )2 +
1!
2!
f 0 (xk )
f 00 (xk )
0 = f (xk ) +
(xk+1 xk )1 +
(xk+1 xk )2
1!
2!


1
0 = f (xk ) + (xk+1 xk ) f 0 (xk ) + f 00 (xk )(xk+1 xk )
2
f (x)

= f (xk ) +

Using the relation xk+1 xk =

f (xk )
from Newtons method to replace the expression within the
f 0 (xk )

brackets, we have:
xk+1

= xk

xk+1

= xk

f (xk )
f 0 (xk ) +

1 00
2 f (xk )

k)
ff0(x
(xk )

2f (xk )f 0 (xk )
Richmonds iterative formula
2[f 0 (xk )]2 f (xk )f 00 (xk )
2[f 0 (xk )]2
f (xk )
= xk

2[f 0 (xk )]2 f (xk )f 00 (xk ) f 0 (xk )

The expression for is


=

1.8.3

2[f 0 (xk )]2


=
2[f 0 (xk )]2 f (xk )f 00 (xk )
1

Graphical Interpretation

1
f (xk )f 00 (xk )
2[f 0 (xk )]2

E. P. Quiwa

25

Let be the estimate of x


predicted by Newtons formula. Then
= xk

f (xk )
f 0 (xk )

from which
xk =

f (xk )
f 0 (xk )

From the figure above,


PR

= f (xk ) g()


f 0 (xk )
f 00 (xk )
1
2
= f (xk ) f (xk ) +
( xk ) +
( xk )
1!
2!


1
= f 0 (xk )( xk ) + f 00 (xk )( xk )2
2

By similar triangles
QR
xk xk+1
=
f (xk )
PR

xk xk+1
f (xk )

xk xk+1

xk


f 0 (xk )( xk ) + 21 f 00 (xk )( xk )2
( xk )


0
f (xk )( xk ) + 21 f 00 (xk )( xk )2
f (xk )
h
i
k)
f 0 (xk ) + 12 f 00 (xk ) ff0(x
(xk )

Solving for xk+1 ,


xk+1 = xk

Over-relaxation: > 1
f (xk )f 00 (xk ) > 0

2f (xk )f 0 (xk )
f (xk )f 00 (xk )

2[f 0 (xk )]2

Under-relaxation: < 1
f (xk )f 00 (xk ) < 0

Example: Find the positive root of 2 cos x ex = 0. Use the criterion f (xk ) < 0.001 to stop the iterations.
f (x)
f 0 (x)
f 00 (x)

= 2 cos x ex = 0
= 2 sin x ex
= 2 cos x ex

26

Module 1: Roots of Single Equations

1st iteration: Take x0 = 0.50


f (x0 ) = 2 cos(0.50) e0.50 = 0.106444
f 0 (x0 ) = 2 sin(0.50) e0.50 = 2.607572
f 00 (x0 ) = 2 cos(0.50) e0.50 = 3.403886
2f (x0 )f 0 (x0 )
x1 = x0
2[f 0 (x0 )]2 f (x0 )f 00 (x0 )
2(0.106444)(2.607572)
= 0.50
= 0.539762
2(2.607572)2 (0.106444)(3.403886)
2nd iteration
f (x1 ) = 2 cos(0.539762) e0.539762 = 0.000064 < 0.001
x
0.539762

1.8.4

Summary

Form of the equation: f (x) = 0


Iterative formula: xk+1 = xk

2f (xk )f 0 (xk )
f (xk )f 00 (xk )

2[f 0 (xk )]2

Convergence criterion: never mind


Criteria for termianting the iterations:
a. |f (xk )| <

or

b. Absolute error criterion: |xk+1 xk | <




xk+1 xk
<
c. Relative error criterion:
xk+1

or

d. others

or
and

e. A prescribed maximum number of iterations, itmax

1.8.5

EASY Implementation

procedure RICHMOND(, itmax, x)


iter 0
f x f (x)
//function call to evaluate f (x0 )//
output iter, x, f x, Initial estimate
for iter 1 to itmax do
df x df (x)
//function call to evaluate f 0 (xk ), k = 0, 1, 2, . . .//
ddf x ddf (x)
//function call to evaluate f 00 (xk ), k = 0, 1, 2, . . .//
x x (2 f x df x)/(2 df x df x f x ddf x)
f x f (x)
//function call to evaluate f (xk ), k = 1, 2, . . .//
output iter, x, f x
if |f x| < then return
//method converges within itmax iterations//
end for
return
//method fails to converge in itmax iterations//
end procedure

E. P. Quiwa

27

Example 1. Find the roots of the equation x4 2 2x3 + 4 2x 4 = 0. Iterate until |f (xk )| < or the
number of iterations exceeds 20, whichever occurs first.
Solution:
a. Find initial estimates

From the plot of f (x) = 0, we see that there is a distinct negative root near 1.5 and three equal
positive roots near 1.5.
b. EASY procedures
procedure MAIN()
1: input x0
call RICHMOND(106 , 20, x0)
go to 1
end procedure

//initial estimate//

procedure f(x)

return x4 2 2 x3 + 4 2 x 4
end procedure
procedure df(x)

return 4 x3 6 2 x2 + 4 2
end procedure
procedure ddf(x)

return 12 x2 12 2 x
end procedure
c. Results

Given equation: x4 2 2x3 + 4 2x 4 = 0


itmax =20, =106
Iterations of Richmonds method:

k
xk
0 1.5000000
1 1.4146215
2 1.4142136

|f (xk )|
2.1231602
.0092335
.0000000

k
0
1
2
3
4

xk
1.5000000
1.4573202
1.4358212
1.4250311
1.4196258

|f (xk )|
.0018398
.0002300
.0000288
.0000036
.0000004

28

Module 1: Roots of Single Equations

Given equation: x4 2 2x3 + 4 2x 4 = 0


itmax =20, =1012
Iterations of Richmonds method:

k
xk
0 1.5000000
1 1.4573202
2 1.4358212
3 1.4250311
4 1.4196258
5 1.4169205
6 1.4155673
7 1.4148905
8 1.4145520
9 1.4143828
10 1.4142982
11 1.4142559

Given equation: x4 2 2x3 + 4 2x 4 = 0


itmax =30, =1016
Iterations of Richmonds method:

k
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23

xk
1.5000000
1.4573202
1.4358212
1.4250311
1.4196258
1.4169205
1.4155673
1.4148905
1.4145520
1.4143828
1.4142982
1.4142559
1.4142346
1.4142242
1.4142186
1.4142192
1.4142196
1.4142158
1.4142186
1.4142108
1.4142087
1.4142100
1.4142142
1.4142148

|f (xk )|
.1839828D 02
.2300106D 03
.2875238D 04
.3594082D 05
.4492613D 06
.5615769D 07
.7019713D 08
.8774641D 09
.1096831D 09
.1371091D 10
.1713973D 11
.2143927D 12

|f (xk )|
.1839828D 02
.2300106D 03
.2875238D 04
.3594082D 05
.4492613D 06
.5615769D 07
.7019713D 08
.8774641D 09
.1096831D 09
.1371091D 10
.1713973D 11
.2143927D 12
.2621514D 13
.3596949D 14
.1565588D 15
.1131907D 15
.7190429D 15
.4978656D 15
.6557255D 15
.5139118D 15
.2053479D 15
.2025290D 15
.2320193D 15
.8456777D 16

E. P. Quiwa

29

Example 2. Freudensteins equation

Solution: We will use the Richmond method with the following termination criteria: |f (x)| < 106 ,
itmax = 20.
a. Initial estimates: Same as in Newtons method
b. EASY procedures
procedure MAIN()
//R1, R2, R3 and are assumed to be global variables//
input a, b, c, d,
//1, 2, 2, 2, 40//
R1 d/c
R2 d/a
R3 (a2 b2 + c2 + d2)/(2 a c)
0.0174533
for 0 to 360 by 10 do
0.0174533
call RICHMOND(106 , 20, )
end for
end procedure
procedure f()
return R1 cos() R2 cos() + R3 cos( )
end procedure
procedure df()
return R2 sin() sin( )
end procedure
procedure ddf()
return R2 cos() + cos( )
end procedure
c. Results
Given equation: R1 cos R2 cos + R3 cos( ) = 0
itmax =20, =106
Iterations of Richmonds method:

k
k
|f (k )|
0 .6981317 .0481333( = 0o )
1 .7227266 .0000152
2 .7227342 .0000000

k
k
|f (k )|
0 .7227342 .1186555( = 10o )
1 .7845422 .0002586
2 .7846724 .0000000

k
k
|f (k )|
0 .7846724 .1321613( = 20o )
1 .8535511 .0003530
2 .8537284 .0000000

k
k
|f (k )|
0 .8537284 .1443299( = 30o )
1 .9288731 .0004428
2 .9290949 .0000000

30

Module 1: Roots of Single Equations


d. Summary of results for Freudensteins equation: Richmonds method
, degrees
0
10
20
30
40
50
60
70
80
90
100
110
120
130
140
150
160
170
180
190
200
210
220
230
240
250
260
270
280
290
300
310
320
330
340
350
360

, degrees
41.4096200
44.9584200
48.9150400
53.2332200
57.8526700
62.7013200
67.6969800
72.7474100
77.7480900
82.5772100
87.0869300
91.0901000
94.3410900
96.5106600
97.1608000
95.7450900
91.7057300
84.7856500
75.5224900
65.3726900
55.9497500
48.1571400
42.1293300
37.6277300
34.3410900
32.0036100
30.4179500
29.4471100
29.0007000
29.0229700
29.4837600
30.3715600
31.6876900
33.4410300
35.6424900
38.2992900
41.4096200

|f ()|
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000004
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000
.0000003
.0000000
.0000004
.0000000
.0000000
.0000000
.0000000
.0000000
.0000000

Iterations
2
2
2
2
2
2
2
2
2
2
2
2
2
2
1
2
2
2
2
2
2
2
2
2
2
2
2
2
1
1
1
2
2
2
2
2
2

E. P. Quiwa

1.9
1.9.1

31

Half-Interval Method
Algorithm

1. Choose lk and rk , k = 0, such that f (lk )f (rk ) < 0.


2. Calculate
xk =

l k + rk
rk l k
= lk +
2
2

On a computer, in which numbers are represented as floating-point numbers with fixed precision,
the midpoint of the interval should be calculated as the rightmost formula.
Example: Suppose we have a computer which implements four decimal digit chopped floatingpoint arithmetic.
lk = 0.8763
rk = 0.8766
x

=
=

=
chopped

l k + rk
0.8763 + 0.8766
1.7529 chopped 1.752
=
=

2
2
2
2
0.8760 which is outside the interval
0.8766 0.8763
0.0003
rk l k
= 0.8763 +
= 0.8763 +
= 0.8763 + 0.00015
lk +
2
2
2
0.8763 + 0.0001 = 0.8764 as it should be

The general principle is that it is best to arrange formulas so that they express the
desired quantity as a small correction to a good approximation.
Forsythe, et al., Computer Methods for Mathematical Computations,
Prentice-Hall, 1977, p. 162
3. If f (l0 )f (xk ) > 0, set lk+1 = xk and rk+1 = rk ; else, set lk+1 = lk and rk+1 = xk
The test f (l0 )f (xk ) > 0 may fail due to underflow. For example, if f (xk ) = 1030 and f (l0 ) = 1020
(in single precision) then an underflow will occur. To avoid this, we can define a multiplier as
follows:
if f (l0 ) < 0 then f L0 1
else f L0 +1
The test above then becomes f L0 f (xk ) > 0 . . .

32

Module 1: Roots of Single Equations


4. Repeat steps 2 and 3 until
a. Absolute error criterion: |rk+1 lk+1 | <
or
If the absolute error criterion is used, it is possible to determine, beforehand, the number of
iterations needed to reduce the initial interval r0 l0 to the specified tolerance .
Let 0 = r0 l0 = original interval containing x
. Then:
1

0
= interval after the the 1st iteration
2
1
0
=
= interval after the the 2nd iteration
2
4

..
.
k

0
= interval after the the kth iteration
2k

Now, let n be the number of iterations needed to reduce 0 to ; then




0
log(0 /)
0
0
n
n
= 2
= log 2 log
= n =
2n

log 2
Example: Let 0 = 1.0, = 106
 
 


log(1.0/106 )
6
log(0 /)
=
=
= d19.93e = 20
n=
log 2
log 2
0.3010



xk+1 xk rk+1 lk+1
=
<
b. Relative error criterion:
or
xk+1 rk+1 + lk+1


xk+1 xk
can be expressed in terms of the current interval limits lk+1
The relative error
xk+1
and rk+1 , thus obviating the need to keep xk .





k+1
xk+1 xk rk+1 l
rk+1 lk+1
2

=
xk+1 rk+1 +lk+1 = rk+1 + lk+1
2

Note that rk+1 + lk+1 may become zero; this means that a zero test must be included to avoid
a floating-point divide exception.

c. |f (xk )| <
d. the number of iterations > itmax

or

E. P. Quiwa

1.9.2

33

EASY Implementation

procedure HALF INTERVAL(, itmax, L, R)


f L0 f (L)
for iter 0 to itmax do
//Computation//
xerr R L
x L + xerr/2
output iter, L, R, x, xerr
//Test for termination//
if xerr < then return
//Updating//
f x f (x)
if f L0 f x > 0 then L x
else R x
end for
return
end procedure

// not satisfied in itmax iterations//

Example 1. Find the root of the equation 2 ln x + x2 8 = 0. Iterate until the absolute error < 106 or
the number of iterations exceeds 20, whichever occurs first.
Solution:
a. Find initial estimates

From the plot of f (x) = 0, we see that the root lies between 2 and 3. We set l0 = 2 and r0 = 3.
b. EASY procedures
procedure MAIN()
1: input L, R
call HALF INTERVAL(106 , 20, L, R)
go to 1
end procedure
procedure f(x)
return 2 ln(x) + x2 8
end procedure

//initial interval//

34

Module 1: Roots of Single Equations


c. Results
Given equation: 2 ln x + x2 8 = 0
itmax =20, =106
Iterations of half-interval method:
Initial interval: [2, 3]
k
0
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20

lk
2.0000000
2.0000000
2.2500000
2.3750000
2.4375000
2.4687500
2.4843750
2.4843750
2.4843750
2.4843750
2.4853516
2.4853516
2.4855957
2.4857178
2.4857178
2.4857178
2.4857178
2.4857254
2.4857292
2.4857311
2.4857321

rk
3.0000000
2.5000000
2.5000000
2.5000000
2.5000000
2.5000000
2.5000000
2.4921875
2.4882813
2.4863281
2.4863281
2.4858398
2.4858398
2.4858398
2.4857788
2.4857483
2.4857330
2.4857330
2.4857330
2.4857330
2.4857330

xk
2.5000000
2.2500000
2.3750000
2.4375000
2.4687500
2.4843750
2.4921875
2.4882813
2.4863281
2.4853516
2.4858398
2.4855957
2.4857178
2.4857788
2.4857483
2.4857330
2.4857254
2.4857292
2.4857311
2.4857321
2.4857326

rk l k
1.0000000
.5000000
.2500000
.1250000
.0625000
.0312500
.0156250
.0078125
.0039063
.0019531
.0009766
.0004883
.0002441
.0001221
.0000610
.0000305
.0000153
.0000076
.0000038
.0000019
.0000010

Example 2. Find the roots of the equation x4 2 2x3 + 4 2x 4 = 0. Iterate until the absolute error
< 107 or the number of iterations exceeds 30, whichever occurs first.
Solution:
a. Find initial estimates

From the plot of f (x) = 0, we see that there is a distinct negative root between 2 and 1 and
three equal positive roots between 1 and 2.
b. EASY procedures
procedure MAIN()
1: input L, R
call HALF INTERVAL(107 , 30, L, R)
go to 1
end procedure

//initial interval//

E. P. Quiwa

35

procedure f(x)

return x4 2 2 x3 + 4 2 x 4
end procedure
c. Results (see also Newtons method Example 1, Richmonds method, Example 1)

Given equation: x4 2 2x3 + 4 2x 4 = 0


itmax =30, =107
Iterations of half-interval method:
Initial interval: [2, 1]
xk
1.5000000
1.2500000
1.3750000
1.4375000
1.4062500

rk l k
1.0000000
.5000000
.2500000
.1250000
.0625000

22 1.4142137 1.4142134 1.4142135


23 1.4142137 1.4142135 1.4142136
24 1.4142136 1.4142135 1.4142136

.0000002
.0000001
.0000001

k
0
1
2
3
4
..
.

lk
2.0000000
1.5000000
1.5000000
1.5000000
1.4375000

rk
1.0000000
1.0000000
1.2500000
1.3750000
1.3750000

Initial interval: [1, 2]


xk
1.5000000
1.2500000
1.3750000
1.4375000
1.4062500

rk l k
1.0000000
.5000000
.2500000
.1250000
.0625000

21 1.4142127 1.4142132 1.4142129


22 1.4142129 1.4142132 1.4142131
23 1.4142131 1.4142132 1.4142131
24 1.4142131 1.4142131 1.4142131

.0000005
.0000002
.0000001
.0000001

k
0
1
2
3
4
..
.

lk
1.0000000
1.0000000
1.2500000
1.3750000
1.3750000

rk
2.0000000
1.5000000
1.5000000
1.5000000
1.4375000

Example 3. Roots of Legendre polynomials.


Let Pn (x) be the Legendre polynomial of degree n. Then
Pn (x)

m
X
k=0

(1)k (2n 2k)!


x(n2k) ,
k)!(n 2k)!

2n k!(n

2n 1
n1
x Pn1 (x)
Pn2 (x)
n
n

Examples
P0 (x) = 1
P1 (x) = x
1
(3x2 1)
P2 (x) =
2
1
P3 (x) =
(5x3 3x)
2
1
P4 (x) =
(35x4 30x2 + 3)
8

m=

jnk
2

36

Module 1: Roots of Single Equations

P5 (x)

P6 (x)

1
(63x5 70x3 + 15x)
8
1
(231x6 315x4 + 105x2 5)
16

..
.

n=3

n=4

n=5

n=6

Some pertinent properties of Legendre polynomials


1. All n roots are real and lie in the interval [1, 1].
2. The roots are symmetrically arranged about the origin. This means that if n is odd, then zero is a
root.
The roots of Legendre polynomials are used as base points in the Gauss-Legendre quadrature formulas for
numerical integration.
The half-interval method is a most suitable method for finding all the roots of a Legendre polynomial
since they all lie within a well-defined interval.

E. P. Quiwa

37

Solution:
a. Only bn/2c roots of Pn (x) need to be calculated, say those in [1, 0]. We choose an interval size
and march to the right in steps of until we find an interval which contains a root. We then apply
the half-interval method to reduce to . The value of should not be too small (to avoid a long
march) nor too large (to avoid having more than one root in the interval). A reasonable value is a
fraction of the average spacing between roots.
b. EASY procedures
procedure MAIN()
1: input n, , itmax
b0.5/(n + 1)c
L 1
for j 1 to bn/2c do
while f (L) f (L + ) > 0 do
LL+
end while
RL+
call HALF INTERVAL(, itmax, L, R)
LR
end for
go to 1
end procedure

//n is assumed to be global//

procedure f(x)
case
: n = 2 : return (3 x2 1)/2
: n = 3 : return (5 x3 3 x)/2
: n = 4 : return (35 x4 30 x2 + 3)/8
: n = 5 : return (63 x5 70 x3 + 15 x)/8
: n = 6 : return (231 x6 315 x4 + 105 x2 5)/16
: else :[output n is out of range; stop]
end case
end procedure
c. Results
Iterations of the half-interval method for the Legendre polynomial of degree 6 ( = 1.0D 15)
k
lk
rk
xk
rk l k
0 1.000000000000000 .928571425378323 .964285712689161 .714285746216774D 01
1 .964285712689161 .928571425378323 .946428569033742 .357142873108387D 01
2 .946428569033742 .928571425378323 .937499997206032 .178571436554194D 01
3 .937499997206032 .928571425378323 .933035711292177 .892857182770968D 02
..
.
44
45
46
k
0
1
2
3
..
.

.932469514203153 .932469514203149 .932469514203151 .410782519111308D 14


.932469514203153 .932469514203151 .932469514203152 .199840144432528D 14
.932469514203152 .932469514203151 .932469514203152 .999200722162641D 15
lk
.718183790338119
.682469503027281
.664612359371861
.664612359371861

rk
.646755215716442
.646755215716442
.646755215716442
.655683787544152

xk
.682469503027281
.664612359371861
.655683787544152
.660148073458006

rk l k
.714285746216774D 01
.357142873108387D 01
.178571436554194D 01
.892857182770968D 02

44 .661209386466265 .661209386466261 .661209386466263 .399680288865056D 14


45 .661209386466265 .661209386466263 .661209386466264 .199840144432528D 14
46 .661209386466265 .661209386466264 .661209386466265 .999200722162641D 15

38

Module 1: Roots of Single Equations

k
0
1
2
3
..
.

lk
.304066513357877
.268352226047039
.250495082391619
.241566510563910

rk
.232637938736200
.232637938736200
.232637938736200
.232637938736200

xk
.268352226047039
.250495082391619
.241566510563910
.237102224650055

rk l k
.714285746216774D 01
.357142873108387D 01
.178571436554194D 01
.892857182770968D 02

45 .238619186083198 .238619186083196 .238619186083197 .202615701994091D 14


46 .238619186083197 .238619186083196 .238619186083197 .102695629777827D 14
47 .238619186083197 .238619186083197 .238619186083197 .499600361081320D 14

1.10

Regula-falsi method

Regula-falsi is also known as method of false position, and is also called linear interpolation method.

1.10.1

Derivation

By similar triangles:
rk xk
rk l k
=
f (rk )
f (rk ) f (lr )
Solving for xk , we obtain:
xk

=
=
=
=
=

lk f (rk ) rk f (lk )
= traditional form (standard)
f (rk ) f (lk )
lk f (rk )
rk f (lk )
f (rk ) f (lk )

+ lk lk
f (rk ) f (lk ) f (rk ) f (lk )
f (rk ) f (lk )
lk f (rk )
rk f (lk )
lk [f (rk ) f (lk )]
lk +

f (rk ) f (lk ) f (rk ) f (lk )


f (rk ) f (lk )
lk f (rk )
rk f (lk )
lk f (rk )
lk f (lk )
lk +

+
f (rk ) f (lk ) f (rk ) f (lk ) f (rk ) f (lk ) f (rk ) f (lk )
f (lk ) (lk rk )
alternative form (requires one less
lk +
=
f (rk ) f (lk )
multiplication than the standard form)

E. P. Quiwa

1.10.2

39

Alternative Derivation of the Alternate Form

tan =

f (lk )
lk xk
lk xk
f (lk )

=
=

f (rk ) f (lk )
rk l k
rk l k
f (rk ) f (lk )

Solving for xk , we get:


xk = lk

1.10.3

f (lk ) (lk rk )
f (lk ) (rk lk )
= lk +
f (rk ) f (lk )
f (rk ) f (lk )

Algorithm

1. Choose lk and rk , k = 0, such that f (lk )f (rk ) < 0.


2. Calculate
xk =

lk f (rk ) rk f (lk )
f (rk ) f (lk )

3. If f (l0 )f (xk ) > 0, set lk+1 = xk and rk+1 = rk ; else, set lk+1 = lk and rk+1 = xk
4. Repeat steps 2 and 3 until


xk+1 xk
<
a. Relative error criterion:
xk+1

or

b. |f (xk )| <

or

c. the number of iterations > itmax


The absolute error criterion rk lk is not suitable for the regula-falsi method. The estimate may be
already be very close to x
but rk lk may still be very large. The test |f (x)| < appears to be the
most appropriate.

40

Module 1: Roots of Single Equations

1.10.4

EASY Implementation

procedure REGULA FALSI(, itmax, L, R)


f L f (L)
f R f (R)
for iter 0 to itmax do
//Computation//
x (L f R R f L)/(f R f L)
f x f (x)
output iter, L, R, x, f x
//Test for termination//
if |f x| < then return
//Updating//
if f L f x > 0 then [L x; f L f x]
else [R x; f R f x]
end for
return
end procedure

// not satisfied in itmax iterations//

Example 1. Find the root of the equation 2 ln x + x2 8 = 0. Iterate until |f (x)| < 106 or the number of
iterations exceeds 20, whichever occurs first.
Solution:
a. Find initial estimates

We set l0 = 2 and r0 = 3.
b. EASY procedures
procedure MAIN()
1: input L, R
call REGULA FALSI(106 , 20, L, R)
go to 1
end procedure
procedure f(x)
return 2 ln(x) + x2 8
end procedure

//initial interval//

E. P. Quiwa

41

c. Results
Given equation: 2 ln x + x2 8 = 0
itmax =20, =106
Iterations of regula-falsi method:
Initial interval: [2, 3]
k
0
1
2
3
4
5

lk
2.0000000
2.4497913
2.4831744
2.4855509
2.4857195
2.4857314

rk
3.0000000
3.0000000
3.0000000
3.0000000
3.0000000
3.0000000

xk
2.4497913
2.4831744
2.4855509
2.4857195
2.4857314
2.4857323

|f (xk )|
0.2065171
0.0147695
0.0010482
0.0000744
0.0000053
0.0000004

Example 2. Find the roots of the equation x4 2 2x3 + 4 2x 4 = 0. Iterate until |f (x)| < 107 or the
number of iterations exceeds 30, whichever occurs first.
Solution:
a. Find initial estimates

From the plot of f (x) = 0, we see that there is a distinct negative root between 2 and 1 and
three equal positive roots between 1 and 2.
b. EASY procedures
procedure MAIN()
1: input L, R
call REGULA FALSI(107 , 30, L, R)
go to 1
end procedure
procedure f(x)

return x4 2 2 x3 + 4 2 x 4
end procedure

//initial interval//

42

Module 1: Roots of Single Equations


c. Results (see also Newtons method Example 1, Richmonds method, Example 1)

Given equation: x4 2 2x3 + 4 2x 4 = 0


itmax =30, =107
Iterations of regula-falsi method:
Initial interval: [2, 1]
k
0
1
2
3
4
..
.

lk
2.0000000
2.0000000
2.0000000
2.0000000
2.0000000

rk
1.0000000
1.2000000
1.3128073
1.3685111
1.3941050

xk
1.2000000
1.3128073
1.3685111
1.3941050
1.4054626

|f (xk )|
3.8271030
2.0565063
0.9848056
0.4453696
0.1961789

19
20
21
22

2.0000000
2.0000000
2.0000000
2.0000000

1.4142135
1.4142135
1.4142135
1.4142136

1.4142135
1.4142135
1.4142136
1.4142136

0.0000007
0.0000003
0.0000001
0.0000001

Initial interval: [1, 2]


k
0
1
2
3
4
5
..
.

lk
1.0000000
1.2000000
1.2288735
1.2473286
1.2606553
1.2709443

rk
2.0000000
2.0000000
2.0000000
2.0000000
2.0000000
2.0000000

xk
1.2000000
1.2288735
1.2473286
1.2606553
1.2709443
1.2792373

|f (xk )|
0.0256970
0.0168275
0.0123704
0.0096855
0.0078964
0.0066234

497 1.3943998 2.0000000 1.3944191 0.0000218


498 1.3944191 2.0000000 1.3944383 0.0000217
499 1.3944383 2.0000000 1.3944575 0.0000217
500 1.3944575 2.0000000 1.3944766 0.0000216
..
.

Example 3.
Iterations of the regula-falsi method for the Legendre polynomial of degree 6 ( = 1.0E 15)
k
0
1
2
3
..
.

lk
1.000000000000000
1.000000000000000
1.000000000000000
1.000000000000000

rk
.928571425378323
.931043560959287
.931951982076715
.932282223862327

xk
.931043560959287
.931951982076715
.932282223862327
.932401806504425

|f (xk )|
.133497073864128D 01
.487673700001607D 02
.176902130462632D 02
.640069208769073D 03

28 1.000000000000000 .932469514203150 .932469514203151 .608974676241658D 14


29 1.000000000000000 .932469514203151 .932469514203152 .188998122707673D 14
30 1.000000000000000 .932469514203152 .932469514203152 .840473524110763D 15

E. P. Quiwa

k
0
1
2
3
4
5
6
7
8
k
0
1
2
3

43

lk
.718183790338120
.718183790338120
.718183790338120
.718183790338120
.718183790338120
.718183790338120
.718183790338120
.718183790338120
.718183790338120
lk
.304066513357868
.238687901784039
.238687901784039
.238687901784039

rk
.646755215716442
.660657257594325
.661193188688707
.661208916885283
.661209372857669
.661209386071887
.661209386454836
.661209386465933
.661209386466255
rk
.232637938736191
.232637938736191
.238619064960429
.238619186081093

xk
.660657257594325
.661193188688707
.661208916885283
.661209372857669
.661209386071887
.661209386454836
.661209386465933
.661209386466255
.661209386466264

|f (xk )|
.173174649775357D 02
.508363257247090D 04
.147379557694644D 05
.427110542237583D 07
.123776642602970D 08
.358703208195449D 10
.103951959887216D 11
.300677451686715D 13
.797322277645840D 15

xk
|f (xk )|
.238687901784039
.146293711950872D 03
.238619064960429 .257862337553098D 06
.238619186081093 .447854104604524D 11
.238619186083197 .674102700742862D 16

Roots of Legendre polynomials: summary


True value

0.577350269189626

0.577350269189626

48

0.577350269189626

12

0.0
0.774596669241483

0.0
0.774596669241483

47

0.774596669241483

17

0.861136311594053
0.339981043584856

0.861136311594053
0.339981043584857

47
47

0.861136311594053
0.339981043584856

15
6

0.0
0.906179845938664
0.538469310105683

0.0
0.906179845938664
0.538469310105683

47
47

0.906179845938664
0.538469310105683

11
8

0.932469514203152
0.661209386466265
0.238619186083197

0.932469514203152
0.661209386466265
0.238619186083197

46
46
47

0.932469514203152
0.661209386466264
0.238619186083197

30
8
3

Half-interval method

Regula-falsi method

Note: Initial interval size = 0.5/(n + 1)


= 1.0D 15

1.11

Graeffes Root-Squaring Method

1.11.1

Form of the Equation


f (x)

= xn + a1 xn1 + a2 xn2 + + an1 x + an = 0


= (x x
1 )(x x
2 )(x x
3 ) (x x
n )

an 6= 0

44

Module 1: Roots of Single Equations

1.11.2

Steps in Graeffes Root-Squaring Method

1. Generating the kth derived polynomial g(y) from the given polynomial f (x) such that
(a) f (x) and g(y) have the same degree
(b) the roots of g(y) = 0 are the negatives of some large even power, m of the roots of f (x) = 0,
that is
y1 =
x1m
m = 2k
m
y2 =
x2
(1.11)
..
.
yn

=
xnm

2. Finding the roots of the kth derived polynomial g(y) = 0 from the simple approximate relationships
between its coefficients and its roots.
3. Calculating the roots of f (x) = 0 from Eqs. (1.11).
Computationally steps 2 and 3 are carried out as a single step.

1.11.3

Root-Squaring Algorithm

Consider the polynomial equation


f (x) = 0 = x2 + x 6 = (x + 3)(x 2)
with roots x
1 = 3 and x
2 = +2. Now, form the polynomial
f (x)f (x) = 0 = (x2 + x 6)(x2 x 6) = x4 13x2 + 36
Letting p = x2 , we get
f (x)f (x) = 0 = h(p) = p2 + 13p + 36 = (p + 9)(p + 4)
We note that
p1
p2

= 9 = (3)2 =
x12
= 4 = (+2)2 =
x22

Now form the polynomial equation


h(p)h(p) = 0 = (p2 + 13p + 36)(p2 13p + 36) = p4 97p2 + 1296
Letting q = p2 , we get
h(p)h(p) = 0 = s(q) = q 2 + 97q + 1296 = (q + 81)(q + 16)
We note that
q1
q2

= 81 = (9)2 = (3)4 =
x14
= 16 = (4)2 = (+2)4 =
x24

Repeating this root-squaring process on successive derived polynomials, we obtain


k = 3:
x18 = 6561

x28 = 256
k = 4:
x116 = 43046721

x216 = 65536
k = 5:
x132 = 1.853020 1015

x232 = 4.294967 109

E. P. Quiwa

45

Inspection of the above results show that at some large even power m, say 64, we will have x
1m >> x
2m .
This is the key to Graeffes root-squaring method.
In general for the nth degree polynomial equation
f (x) =

n
X

a0i xni = 0,

a00 = 1

(1.12)

i=0

the kth derived polynomial equation, which is obtained after k root-squaring steps, will be
Pn
g(y) = Pi=0 aki y ni = 0,
ak0 = 1
n
ni
=
= 0,
b0 = 1
i=0 bi y

(1.13)

where bi = aki , for every i. The roots of the two equations are related as found in Eqs. (1.11).
Let two successive polynomials be defined by the coefficients
aj0

aj1

aj2

aj3

aj4

aj5

ajn2

ajn1

ajn

aj+1
0

aj+1
1

aj+1
2

aj+1
3

aj+1
4

aj+1
5

aj+1
n2

aj+1
n1

aj+1
n

Then:

aj+1
0
aj+1
1
aj+1
2
aj+1
3
..
.

= (aj0 )2
= (aj1 )2 2aj0 aj2
= (aj2 )2 2aj1 aj3 + 2aj0 aj4
= (aj3 )2 2aj2 aj4 + 2aj1 aj5 2aj0 aj6

aj+1
n1
aj+1
n

= (ajn1 )2 2ajn2 ajn


= (ajn )2

(1.14)

To summarize: Starting with the original polynomial (1.12), we use (1.14) to generate k successive polynomials, culminating in (1.13). The roots of (1.12) and (1.13) are related according to (1.11).

1.11.4

Relations Between Coefficients and Roots of g(y) = 0

Consider the 3rd degree polynomial equation


f (x) = x3 + a1 x2 + a2 x + a3 = 0
with roots x
1 , x
2 , and x
3 , such that |
x1 | |
x2 | |
x3 |. This can be expressed as
f (x)

= (x x
1 )(x x
2 )(x x
3 ) = 0
3
2
= x (
x1 + x
2 + x
3 )x + (
x1 x
2 + x
1 x
3 + x
2 x
3 )x x
1 x
2 x
3 = 0

from which
a1
a2
a3

= (
x1 + x
2 + x
3 )
= x
1 x
2 + x
1 x
3 + x
2 x
3
=
x1 x
2 x
3

Now define the Enke roots of a polynomial as the negatives of its roots, such that
r1 =
x1
r2 =
x2
..
.
rn =
xn

46

Module 1: Roots of Single Equations

In terms of the Enke roots, we therefore have


a1
a2
a3

= r1 + r 2 + r 3
= r1 r2 + r 1 r 3 + r 2 r 3
= r1 r2 r3

Thus, for the kth derived polynomial g(y) = y 3 + b1 y 2 + b2 y + b3 = 0, in which yi =


xim = ri m ,
k
m = 2 , we have
b1
b2
bn

= (
y1 + y2 + y3 ) = r1 m + r2 m + r3 m
= y1 y2 + y1 y3 + y2 y3 = r1 m r2 m + r1 m r3 m + r2 m r3 m
=
y1 y2 y3 = r1 m r2 m r3 m

In general, for the nth degree, kth derived polynomial equation (1.12):
b1
b2
b3

= r 1 m + r 2 m + r3 m + + r n m
= r 1 m r 2 m + r 1 m r 3 m + + r 1 m rn m + r2 m r 3 m + r2 m r 4 m + +
r2 m rn m + + rn1 m rn m
= r 1 m r 2 m r3 m + r 1 m r 2 m r4 m + + r 1 m r 2 m r n m + r 1 m r 3 m r4 m +
r1 m r3 m r5 m + + r1 m r3 m rn m + + rn2 m rn1 m rn m

(1.15)

..
.
bn

= r 1 m r2 m r3 m r n m

Note that Eqs. (1.15) relate the Enke roots of the original polynomial to the coefficients of the kth derived
polynomial. By making suitable approximations based on the fact that the roots of (1.12) are all well
separated, we can solve for the Enke roots, ri , i = 1, 2, . . . , n; and consequently, for the actual roots, x
i ,
i = 1, 2, . . . , n. The working approximate relations between the Enke roots ri m and the coefficients bi
depend on the nature of the roots x
i of the original polynomial.

1.11.5

Finding the Roots

CASE 1: Distinct, real roots


Consider again the 3rd degree polynomial equation
f (x) = x3 + a1 x2 + a2 x + a3 = 0
with roots x
1 , x
2 , and x
3 and Enke roots r1 , r2 and r3 . Let the kth derived polynomial equation be
g(y) = y 3 + b1 y 2 + b2 y + b3 = 0
Then, from Eqs. (1.15) we have
b1
b2
b3

= r1 m + r 2 m + r 3 m
= r1 m r 2 m + r1 m r3 m + r 2 m r3 m
= r1 m r 2 m r 3 m

Now assume that |


x1 | > |
x2 | > |
x3 |. Then the above relations become
b1
b2

r1 m
r1 m r 2 m

since r1 m >> r2 m >> r3 m . Using these working approximate relations, we obtain the following
expressions for the Enke roots ri , for every i,
p
r1 m b1
r
r
b2
m
m b2
r2

r m
b1
r 1
r
b3
m
m b3
r3 =

r1 m r2 m
b2

E. P. Quiwa

47

In general, for an nth degree polynomial equation with distinct real roots, the Enke roots will be,
approximately
s
ri =

bi

(1.16)

i = 1, 2, . . . , n

bi1

where b0 = 1. Eqs. (1.16) yield the magnitude of the actual roots x


i , i = 1, 2, . . . , n. Substitution of
+ri and ri into Eq. (1.12) gives the sign of x
i , for every i.
Example. Find all the roots of f (x) = x4 2x3 13x2 + 14x + 24 = 0 using GRSM.
(a) Generate Graeffes table
k
0
1
2
3
4
5
6
7

m
1
2
4
8
16
32
64
128

ak0
ak1
ak2
1.0 2.00000D+00 1.30000D+01
1.0
3.00000D+01
2.73000D+02
1.0
3.54000D+02
2.64810D+04
1.0
7.23540D+04
4.48511D+08
1.0
4.33808D+09
1.85169D+17
1.0
1.84486D+19
3.41823D+34
1.0
3.40282D+38
1.16842D+69
1.0
1.15792D+77
1.36521D+138

ak3
1.40000D+01
8.20000D+02
3.57904D+05
1.10524D+11
1.21168D+22
1.46811D+44
2.15536D+88
4.64557D+176

ak4
2.40000D+01
5.76000D+02
3.31776D+05
1.10075D+11
1.21166D+22
1.46811D+44
2.15536D+88
4.46557D+176

(a61 )2 = (3.40282D + 38)2 = 1.15792D + 77 = a71


Regular squared
(a62 )2 = (1.16842D + 69)2 = 1.36521D + 138 = a72 relationship: all roots
(a63 )2 = (2.15536D + 88)2 = 4.64558D + 176 a73
real and distinct
s
bi
, i = 1, 2, . . . , n for real, distinct roots.
(b) Find Enke roots from the equations ri = m
bi1
r
r1 =

r
r2 =

r
r3 =

r4 =

b1
b0

b2
b1

b3
b2

b4
b3

128

1.15792D + 77 = 4.00000
r
128 1.36521D + 138
= 3.00000
1.15792D + 77
r
128 4.64557D + 176
= 2.00000
1.36521D + 138
r
128 4.64557D + 176
= 1.00000
4.64557D + 176

(c) Find actual roots


ri
f (+ri ) f (ri )
4.00000
0.0
144.0
3.00000 24.0
0.0
2.00000
0.0 24.0
1.00000 +24.0
0.0

x
i
+4.00000
3.00000
+2.00000
1.00000

CASE 2: Repeated real roots


Consider again the 3rd degree polynomial equation
f (x) = x3 + a1 x2 + a2 x + a3 = 0
with roots x
1 , x
2 , and x
3 and Enke roots r1 , r2 and r3 . Let the kth derived polynomial equation be
g(y) = y 3 + b1 y 2 + b2 y + b3 = 0
Then, we have
b1
b2
b3

= r1 m + r 2 m + r 3 m
= r1 m r 2 m + r1 m r3 m + r 2 m r3 m
= r1 m r 2 m r 3 m

48

Module 1: Roots of Single Equations


Now assume that |
x1 | > |
x2 | = |
x3 |. Then r2 m = r3 m and for large m, r1 m >> r2 m . The above
relations can therefore be expressed approximately as
b1
b2
b3

= r1 m + 2r2 m r1 m
= 2r1 m r2 m + r2 2m 2r1 m r2 m
= r1 m r2 2m

Performing the root-squaring step one more for the equation g(y) = 0, we obtain,s ay
h(z) = z 3 + c1 z 2 + c2 z + c3 = 0
where
c1
c2
c3

= b1 2 2b0 b2 r1 2m 4r1 m r2 m r1 2m
= b2 2 2b1 b3 4r1 2m r2 2m 2r1 2m r2 2m 2r1 2m r2 2m
= b3 2 = r1 2m r2 4m

Comparing the coefficients of the two successive derived polynomial equations g(y) = 0 and
h(z) = 0, we note that:
c1
c2
c3

b1 2
1 2
b2 half-squared relationship

2
= b3 2

We see that c2 takes on a half-squared relationship with respect to the preceding coefficient b2 . This
indicates that |
x2 | has multiplicity 2 and that, specifically, |
x2 | = |
x3 | (as originally assumed). In
general, if ci takes on the half-squared relationship with respect to bi , then it follows that |
xi | =
|
xi+1 |.
1
1
Following the same development, we can show that if ci = bi 2 and ci+1 = bi+1 2 , then |
xi | =
3
3
|
xi+1 | = |
xi+2 |.
It should be noted that equality of the roots is in terms of magnitude only; the roots may vary in
sign. When a root, say x
i , has multiplicity 3, and both +
xi and
xi satisfy f (x) = 0, Descartess
rule of signs may be used to determine the number of positive and negative roots.
Pursuing the example above, we calculate the Enke roots from the resulting approximate relations
to yield
p
r 1 = m b1
r
r
b2
b2
m
m
=
= r3
r2 =
m
2r1
2b1
The actual roots are finally determined by substitution into f (x) = 0.
Example. Find all the roots of f (x) = x4 4x3 x2 + 16x 12 = 0 using GRSM.
(a) Generate Graeffes table
k
0
1
2
3
4
5
6
7
8

m
1
2
4
8
16
32
64
128
256

ak0
ak1
ak2
1.0 4.00000D+00 1.00000D+00
1.0
1.80000D+01
1.05000D+02
1.0
1.14000D+02
2.96100D+03
1.0
7.07400D+03
3.43184D+06
1.0
4.31778D+07
5.64656D+12
1.0
1.85303D+15
1.59173D+25
1.0
3.43368D+30
1.26681D+50
1.0
1.17902D+61
8.02398D+99
1.0
1.39008D+122
3.21922D+199

ak3
ak4
1.60000D+01 1.20000D+01
2.32000D+02
1.44000D+02
2.35840D+04
2.07360D+04
4.33406D+08
4.29982D+08
1.84890D+17
1.84884D+17
3.41822D+34
3.41822D+34
1.16842D+69
1.16842D+69
1.36521D+138
1.36521D+138
1.86380D+276
1.86380D+276

E. P. Quiwa

49
(a71 )2
1 7 2
2 (a2 )

= (1.17902D + 61)2 = 1.39009D + 122 a81 x


1 is real and distinct
= 12 (8.02398D + 99)2 = 3.21921D + 199 a82 |
x2 | = |
x3 |
x
4 is real and distinct

(b) Find Enke roots: r1 m >> (r2 m = r3 m ) >> r4 m


b1
b2
b3
b4

=
=
=
=

r 1 m + r 2 m + r3 m + r 4 m r 1 m
r1 m r2 m + r1 m r3 m + r1 m r4 m + r2 m r3 m + r2 m r4 m + r3 m r4 m 2r1 m r2 m
r1 m r2 m r3 m + r1 m r2 m r4 m + r1 m r3 m r4 m + r2 m r3 m r4 m r1 m r2 2m
r1 m r2 m r3 m r4 m = r1 m r2 2m r4 m

Hence:
p
r1 = m b1
r
b2
m
r2 =
2b1
r
b4
r4 = m
b3

=
=
=

256

1.39008D + 122 = 3.00000


s
3.21922D + 199
256
= 2.00000 = r3
2(1.39008D + 122)
r
256 1.86380D + 276
= 1.00000
1.86380D + 276

(c) Find actual roots: substitution into f (x) = 0 yields x


1 = 3.00000, x
2 = 2.00000, x
3 = 2.00000
and x
4 = 1.00000. Applying Descartess rule of signs confirms that there are three positive
roots and one negative root.
CASE 3: Complex roots
Consider now the polynomial equation
f (x) = x4 + a1 x3 + a2 x2 + a3 x + a4 = 0
with real roots |
x1 | > |
x2 | and complex roots x
3 and x
4 . Then we can write the last two roots as
x
3
x
4
where R =

= a + ib = Rei = R(cos + i sin )


= a ib = Rei = R(cos i sin )

a2 + b2 , and |
x2 | > |R|. For the final derived polynomial g(y) = 0, we again have
b1
b2
b3
b4

=
=
=
=

r 1 m + r2 m + r 3 m + r 4 m
r 1 m r 2 m + r 1 m r 3 m + r1 m r 4 m + r2 m r 3 m + r2 m r4 m + r 3 m r4 m
r1 m r2 m r3 m + r1 m r2 m r4 m + r1 m r3 m r4 m + r2 m r3 m r4 m
r 1 m r 2 m r 3 m r4 m

Substituting the expressions for x


3 and x
4 , and noting that cos m =
b1
b2
b3
b4

1 im
(e
+ eim ), we obtain
2

= r1 m + r2 m + 2Rm cos m r1 m
= (r1 r2 )m + 2Rm (r1 m + r2 m ) cos m + R2m (r1 r2 )m
= 2(r1 r2 R)m cos m + R2m (r1 m + r2 m ) 2(r1 r2 R)m cos m
= (r1 r2 R2 )m

The approximations derive from the fact that r1 m >> r2 m >> Rm . From these relations we see
that the sign of successive coefficients of aj3 , j = 1, 2, . . . , k will fluctuate because of the cosine
term. This indicates that x
3 is a complex root; its conjugate pair is x
4 . In general, if the sign of aji ,
j = 1, 2, . . . , k fluctuates, then x
i = a + ib and x
i+1 = a ib for some real a and b.

50

Module 1: Roots of Single Equations


Example. Find all the roots of f (x) = x4 2x3 14x2 + 32x 32 = 0 using GRSM.
(a) Generate Graeffes table
k
0
1
2
3
4
5
6
7

m
1
2
4
8
16
32
64
128

ak0
ak1
ak2
ak3
ak4
1.0 2.00000D+00 1.40000D+01
3.20000D+01 3.20000D+01
1.0
3.20000D+01
2.60000D+02
1.28000D+02
1.02400D+03
1.0
5.04000D+02
6.14560D+04 5.16096D+05
1.04858D+06
1.0
1.31104D+05
4.29916D+09
1.37473D+11
1.09951D+12
1.0
8.58994D+09
1.84467D+19
9.44473D+21
1.20893D+24
1.0
3.68935D+19
3.40282D+38
4.46015D+43
1.46150D+48
1.0
6.80565D+38
1.15792D+77
9.94646D+86
2.13599D+96
1.0
2.31584D+77
1.34078D+154
4.94661D+173
4.56255D+192

= 12 (6.80565D + 38)2 = 2.31584D + 77 = a71 |


x1 | = |
x2 |
3 = a + ib and x
4 = a ib
aj3 , j = 1, 2, . . . , 7 changes sign at j = 2 x

(b) Find Enke roots: (r1 m = r2 m ) >> Rm where R = a2 + b2


1 6 2
2 (a1 )

b1
b2
b3
b4

=
=
=

r1 m + r2 m + r3 m + r4 m 2r1 m
r1 m r2 m + r1 m r3 m + r1 m r4 m + r2 m r3 m + r2 m r4 m + r3 m r4 m r1 2m
r1 m r 2 m r 3 m + r 1 m r 2 m r 4 m + r 1 m r 3 m r 4 m + r 2 m r 3 m r 4 m
r1 2m (Rei )m + r1 2m (Rei )m r1 2m Rm (eim + eim ) = 2r1 2m Rm cos m
r1 m r2 m r3 m r4 m = r1 2m R2m

Hence:
r

b1
r1 =
2
r
b
4
R = 2m
b2
m

=
=

2.31584D + 77
= 4.00000 = r2
2
r

256 4.56244D + 192


= 1.41421 = 2
1.34078D + 154
128

(c) Find actual roots: substitution into f (x) = 0 yields the real roots x
1 = 4.00000 and x
2 =
4.00000. To find the complex roots, we use the relation a1 = (
x1 + x
2 + x
3 + x
4 ), or
2 =(4 4 + a+ ib +
pa ib), from which we obtain a = 1.00000. Finally, substitution into
2
2
R = a + b or 2 = (1.00000)2 + b2 yields b = 1.00000. Hence, x
3 = 1.00000 + 1.00000i
and x
4 = 1.00000 1.00000i.

1.11.6

Horners Rule
pn (x)

= a0 xn + a1 xn1 + a2 xn2 + + an1 x + an


= an + an1 x + an2 x2 + + a2 xn2 + a1 xn1 + a0 xn
= an + x(an1 + x(an2 + + x(a2 + x(a1 + xa0 )) ))

Example
p4 (x)

= a0 x4 + a1 x3 + a2 x2 + a3 x + a4
= a4 + a3 x + a2 x2 + a1 x3 + a0 x4
= a4 + x(a3 + x(a2 + x(a1 + xa0 )))

E. P. Quiwa

1.11.7

EASY Implementation

procedure GRAEFFE(A, n, )
array A(0:n), B(0:n), X(1:n), T (0:n)
k0
m1
//Normalize original polynomial//
temp A(0)
for i 0 to n do
B(i) A(i)/temp
end for
output k, m, B(0 : n)
//Perform root-squaring step//
switch 1
while switch > 0 do
kk+1
for i 1 to n do
j i1
li+1
sign 1
T (i) B(i)2
while j 0 and l n do
T (i) T (i) + sign 2 B(j) B(l)
j i1
li+1
sign sign
end while
if |T (i)| > 10150 or |T (i)| < 10150 then switch 0
end for
m 2k
for i 1 to n do
B(i) T (i)
end for
output k, m, B(0 : n)
end while
//Calculate roots assuming that they are all real and distinct//
for i 1 to n do
X(i) |B(i)/B(i 1)|(1.0/m)
end for
//Determine sign and legitimacy of calculated roots//
for i 1 to n do
1: f x f (A, x, X(i))
case
: |f x| < :[output X(i), f x; stop]
: X(i) > 0 :[X(i) X(i); go to 1]
: else : output X(i), f x, probably not a root
end case
end for
end procedure
procedure f(A, n, x)
//Evaluates the polynomial f (x) = a0 xn + a1 xn1 + + an1 x + an using Horners rule//
array A(0:n)
f A(0)
for i 0 to n do
f A(i) + x f
end for
end procedure

51

Potrebbero piacerti anche