# 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.
1

2

Module 1: Roots of Single Equations

1.1
1.1.1

Polynomial Equations
General Form

f (x)

= xn + a1 xn−1 + a2 xn−2 + · · · + an−1 x1 + an = 0
n
X
=
ai xn−i = 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

3

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 consideration—the 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 procedure—plot the given equation, as a whole or by parts
3. another numerical method—e.g., Graeffe’s Root-Squaring Method, for polynomial equations.
4. others

4

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 x2 + 4 to both sides and divide by 2x

E. P. Quiwa

1.5.1

5

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 .

whichever occurs first. or or and c. F (x) = middle root. xnew. Hence. x3 + 1 will yield the 3 . then |F 0 (x)| < 1 if |x| < 1. ’Initial estimate’ for iter ← 1 to itmax do xnew ← F (xold) xerr ← |(xnew − xold)/xnew| output iter. such as procedure MOSS given above. a procedure to implement an iterative numerical method. Find initial estimates: see graph of f (x) = x3 − 3x + 1 = 0 c. xold) iter ← 0 output iter. Iterate until the relative error is less than ε = 10−6 or the number of iterations exceeds 20. x = F (x). itmax 1.5. 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. Let x= x3 + 1 3 b.2 EASY Implementation procedure MOSS(ε. Solution: a. Perform analysis for convergence of the chosen F (x) Since F 0 (x) = x2 . has four parts: a. itmax. xold. modification Example 1. Find the roots of the equation x3 − 3x + 1 = 0. computation c. A prescribed maximum number of iterations. or if −1 < x < 1. testing d. others d. initialization b.. but probably not the other roots. i.e. Cast the given equation into a form suitable for the MoSS.

EASY procedures procedure MAIN() 1: input x0 call MOSS(10−6 .6 Module 1: Roots of Single Equations d. x0) go to 1 end procedure procedure F(x) return (xˆ3 + 1)/3 end procedure e. 20. Results: Original equation: x3 − 3x + 1 = 0 x3 + 1 Transformed equation: x = 3 itmax =20. ε =10−6 Iterations of the MoSS: .

.

.

xk −xk−1 .

k k xk .

xk .

3473919 10 .3472964 Original equation: x3 − 3x +√1 = 0 Transformed equation: x = 3 3x − 1 itmax =20.8881960 5 .3472971 .5668969 6 .3472964 //initial estimate// xk 0 1.3477369 .4583333 2 1.5000000 .3473496 .3537306 8 .3472964 .3750000 . ε =10−6 Iterations of the MoSS: . 0 1 2 3 4 5 6 7 8 .3480869 9 .1851380 4 .3473079 11 .3671634 3 1.3940616 7 .3472977 12 .3473028 .5000000 1 1.3472965 13 .3509115 .

.

.

xk −xk−1 .

k xk .

xk .

0022111 4 1.3333333 .5318940 .5261895 .5320825 .0000056 11 1.5320535 .0009433 5 1.0000311 9 1.5000000 1 1.0000133 10 1.0000020 .5310157 .0000004 .5182945 .0120494 2 1.0051730 3 1.5316315 .0000024 12 1.5320877 .0001713 7 1.5320884 .0091291 .0004021 6 1.5320059 .0686456 .0000010 13 1.5320738 .0011152 . 0 1.0001347 .5320862 .5295715 .0000163 .0000730 8 1.0000002 .

.

.

xk −xk−1 .

.

xk .

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

.

.

xk −xk−1 .

.

xk .

8000000 1 −1.0004945 8 .0041238 7 .0594891 .5202296 3 −.3472935 .1893423 5 .3472963 .1175497 2 −1.3456697 .6106667 . 0 −1.3471011 .3332496 1.3472728 .0000009 k xk .0000072 10 .0000596 9 .3472960 .0630982 5.7911022 4 .0359306 6 .

.

.

xk −xk−1 .

.

xk .

0348884 .5320698 1.5289016 1.2872868 .0011944 .5146492 1.5320441 1.5320874 1.0000030 .0000013 .0152063 .1136324 1.5318421 1.0002170 .0000071 .7937005 1.5000000 .5307298 1.5315097 1.4916170 1.5246229 1.0065417 .0000006 .1612850 .5319837 1.0000925 .5320854 1.5320808 1.5320883 .0776567 .0000168 .4395768 1.3700395 . 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 .3277841 1.0000394 .0027985 .0005092 .

E. P. Quiwa 7 Original equation: x3 − 3x + 1p= 0 Transformed equation: x = − 3 |3x − 1| itmax =20. ε =10−6 Iterations of the MoSS: k xk .

.

.

xk −xk−1 .

.

xk .

8566355 −1.8729222 −1.8788665 −1.8793819 −1.0006988 .8793735 −1.0001979 .0000045 .0024668 .8793850 .0086958 .0000560 . 0 1 2 3 4 5 6 7 8 9 10 −1.8000000 −1.8793843 −1.0000013 .8793437 −1.0305044 .0000159 .8775536 −1.8792384 −1.0000004 Original equation: x3 − 3x + 1 = 0 2x3 − 1 Transformed equation: x = 2 3x − 3 itmax =20. ε =10−6 Iterations of the MoSS: k xk .

.

.

xk −xk−1 .

.

xk .

k xk .

.

.

xk −xk−1 .

.

xk .

3472964 .0000000 0 1 2 3 4 −1. k 0 1 2 3 4 .5000000 .3472222 .0448515 .0400000 .3333333 .5320906 .8793852 .5000000 1 1.5000000 .0217391 2 1.0002135 .3472964 .0000011 4 1.5320889 .8793852 −1.0000000 xk .5320889 .8794047 −1.0008111 3 1.5333333 .0027238 .0000000 0 1.8845238 −1.8000000 −1.0000104 .

.

.

xk −xk−1 .

.

xk .

.e. To this end.74 ln(Re f ) − 0. Example 2. 0. Cast given equation in a form suitable for the MoSS. find an initial estimate. 100000. 50000.40 f Calculate f for Re = 5000. . For turbulent flow (Re > 2000) of a fluid in a smooth pipe. Solution: a. f= 1 √ [1. the relationship between the friction factor f and the Reynold’s number Re is given by the equation r p 1 = 1. Iterate until the relative error is less than ε = 10−6 or the number of iterations exceeds 20. whichever occurs first. f = F (f ).40]2 b. we use another empirical formula relating f and Re explicitly. 10000. Given Re. i.74 ln(Re f ) − 0. 500000. 1000000.316 f= (Blassius’s equation) Re0.25 Blassius’s equation gives an approximate value of f for a very smooth pipe for 3000 < Re < 100000.

8 Module 1: Roots of Single Equations c.74 ∗ ln(Re ∗ f ) − 0. EASY procedures procedure MAIN() 1: input Re f 0 ← 0.25 call MOSS(10−6 . Results: r p 1 = 1.74 ln(Re f ) − 0.40)2 −6 itmax =20.74 ln(Re f ) − 0.40 f 1 √ Transformed equation: f = (1.40)ˆ2 end procedure d. ε =10 Iterations of the MoSS: Original equation: . f 0) go to 1 end procedure //Re is assumed to be global// procedure F(f ) √ return 1. 20.316/Re0.0/(1.

.

.

fk −fk−1 .

.

fk .

0073364 5 .0096868 .0074765 4.0000350 8 .0077103 .0076677 .0093296 .0012386 6 .0263074 2 .0077048 .0077046 .0092710 .0002080 7 .0093395 .2281781 3 .0077046 .0079513 .0448467 4 .0000059 9 .0077038 .0316000 .0093299 .0077046 . 0 .0093296 .0062784 .0093296 .0093280 .0375789 (Re = 5000) 1 .0000010 k fk k fk 0 1 2 3 4 5 6 7 8 9 .

.

.

fk −fk−1 .

.

fk .

0000007 .0032814 . we obtain xk+1 = F (xk ) − xk + xk = δk + xk .0331477 .0177700 .1). where δk = F (xk ) − xk = xk+1 − xk (1. Summary of results for the friction problem using MoSS 1.0000010 .0093296 .0000030 .0008468 .0000004 .0044870 .0211322 .0000009 Wegstein’s Method Consider again the iterative formula for the MoSS: xk+1 = F (xk ) (1.0369872 . (Re = 10000) 4.0316000 .0375789 . and from the right side of (1.0077046 .0055261 .0099928 .0000005 .0000005 e.1) Adding and subtracting xk to.0029040 9 9 8 8 8 7 .0052110 .0000001 .2103952 .0001293 .2) .6 Reynolds number Initial estimate Final estimate Number of iterations Relative error 5000 10000 50000 100000 500000 1000000 .0000197 .0118835 .

so that in one iteration we find x ¯: δk ek xk+1 = xk + · δk = xk + ek = x ¯ δk Unfortunately. The figures below show the geometrical representation of the quantities. x ¯ − xk of the kth estimate xk . we see that our estimate. From the figures above. is either too small or too large. such that xk+1 = xk + ω · δk (1. and is either less than or greater than unity depending on whether δk over-estimates or under-estimates ek .2) by applying an appropriate factor on δk .3). ek . the factor ω is called a relaxation factor. P. Quiwa 9 is the kth iteration estimate of the error ek .E. consider the figure below: .3) In (1. we see that the best choice ek for ω is . To arrive at a workable expression for ω. This suggests that we might be able to improve on (1. 0 < F 0 (x) < 1 −1 < F 0 (x) < 0 From these figures. δk . of the root x ¯. this expression for ω cannot be used since ek is not known in the first place. We either undershoot or overshoot the root. of the error.

3). ω · δk ω x ¯ − xk where xk ≤ ξ ≤ x ¯ (mean value theorem). we obtain the following relations: tan θ = F (¯ x) − F (xk ) (ω − 1)δk ω−1 = = = F 0 (ξ).5) in (1. 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.10 Module 1: Roots of Single Equations From the figure above.4).6) Equation (1.4) The value of ξ is unknown. xk+1 = [F (xk )]2 − xk · F [F (xk )] 2F (xk ) − xk − F [F (xk )] (1. too steep 1 2 Given below is the graphical representation of Wegstein’s formula: . From Eq. but we can approximate the value of F 0 (ξ) by the slope of the chord QR.6) may be applied to both the convergent and divergent cases of the MoSS.. Hence. 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. ω−1 = F 0 (ξ) ω or ω= 1 1 − F 0 (ξ) (1.e.5) Substituting (1. ω= 1 1− F [F (xk )]−F (xk ) F (xk )−xk = F (xk ) − xk 2F (xk ) − xk − F [F (xk )] (1. i. (1. too steep 0 < ω < 21 Negative slope. F 0 (ξ) = F [F (xk )] − F (xk ) F (xk+1 ) − F (xk ) = xk+1 − xk F (xk ) − xk Hence.

Absolute error criterion: |xk+1 − xk | < ε .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. 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.E.6.

.

.

xk+1 − xk .

.

Relative error criterion: .<ε b.

.

xk+1 .

or or and c.e.6.2 EASY Implementation procedure WEGSTEIN(ε. others d. xold. xold) iter ← 0 output iter. ’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 xoldˆ2 − xold ∗ F F xold)/(2 ∗ F xold − xold − F F xold) xerr ← |(xnew − xold)/xnew| output iter. Find the roots of the equation x3 − 3x + 1 = 0. A prescribed maximum number of iterations. whichever occurs first. Solution: a. i. Cast the given equation into a form suitable for Wegstein’s method. xnew. Iterate until the relative error is less than ε = 10−6 or the number of iterations exceeds 20. 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. itmax.. itmax 1. Let x= x3 + 1 3 b. x = F (x). Find initial estimates: see graph of f (x) = x3 − 3x + 1 = 0 .

20. ε =10−6 Iterations of Wegstein’s method: k 0 1 2 3 xk . Results: Original equation: x3 − 3x + 1 = 0 x3 + 1 Transformed equation: x = 3 itmax =20. x0) go to 1 end procedure //initial estimate// procedure F(x) return (xˆ3 + 1)/3 end procedure d. EASY procedures procedure MAIN() 1: input x0 call WEGSTEIN(10−6 .12 Module 1: Roots of Single Equations c.

.

.

xk −xk−1 .

.

xk .

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

.

.

xk −xk−1 .

.

xk .

8803619 −1.0099481 .8000000 −1.8793852 −1.0000013 .0000000 k xk . 0 1 2 3 4 5 −1.0521665 .8793852 .8793877 −1.0005183 .8990678 −1.

.

.

xk −xk−1 .

.

xk .

we use another empirical formula relating f and Re explicitly.0000154 4 1.0019308 3 1. f = F (f ). whichever occurs first. 20.316 f= (Blassius’s equation) Re0. To this end.40]2 b. Given Re. 0 1.25 call WEGSTEIN(10−6 . the relationship between the friction factor f and the Reynold’s number Re is given by the equation r p 1 = 1.5320889 . 50000. 0. f 0) go to 1 end procedure //Re is assumed to be global// .5321124 . 1000000.0228463 2 1.5320889 .5350706 .0000000 Example 2. 100000.40 f Calculate f for Re = 5000.74 ln(Re f ) − 0.5000000 1 1. Iterate until the relative error is less than ε = 10−6 or the number of iterations exceeds 20. i. Solution: a. 10000.25 Blassius’s equation gives an approximate value of f for a very smooth pipe for 3000 < Re < 100000. f= 1 √ [1.316/Re0.e. 500000. c. EASY procedures procedure MAIN() 1: input Re f 0 ← 0.74 ln(Re f ) − 0. find an initial estimate.. For turbulent flow (Re > 2000) of a fluid in a smooth pipe. Cast given equation in a form suitable for Wegstein’s method.

P.74 ln(Re f ) − 0.0093296 .40)2 itmax =20.0/(1.74 ∗ ln(Re ∗ f ) − 0.74 ln(Re f ) − 0.0093297 .40 f 1 √ Transformed equation: f = (1.E.0375789 .0095356 . ε =10−6 Iterations of Wegstein’s method: Original equation: k fk 0 1 2 3 4 .40)ˆ2 end procedure d.0093296 . Results: r p 1 = 1. Quiwa 13 procedure F(f ) √ return 1.

.

.

fk −fk−1 .

.

fk .

0077046 .9409245 .0000000 k fk 0 1 2 3 4 . (Re = 5000) 2.0220679 .0000072 .0078476 .0316000 .0077046 .0077047 .

.

.

fk −fk−1 .

.

fk .

0044870 .0000042 .0185538 .0000000 k fk 0 1 2 3 .0267003 . (Re = 10000) 3.0177700 .0045330 .0044870 .

.

.

fk −fk−1 .

.

fk .

0000005 .0000007 . such that ω= 1 1 = 1 − F 0 (ξ) 1 − F 0 (xk ) Then.7 Newton’s Method Let ξ = xk in the expression for ω.0000007 .0029040 4 4 4 3 3 3 .0000004 .0029040 9 9 8 8 8 7 .0118835 .0000001 .0375789 .0118835 .0052110 .0211322 .0099928 .0000009 Initial estimate Final estimate # of Iterations Relative error .0000000 .0000005 . we have xk+1 = xk + ω · δk 1 = xk + · [F (xk ) − xk ] 1 − F 0 (xk ) or xk+1 = xk + F (xk ) − xk .0044870 .0000007 e.0093296 .0000002 .0316000 .0099928 .0093296 .0000000 .0375789 .0077046 .0052110 .0000001 5000 10000 50000 100000 500000 1000000 1.7) .0211322 . 1 − F 0 (xk ) (1.0177700 .9201082 .0316000 .0032814 .0102679 .0177700 . Summary of results for the friction problem: MoSS and Wegstein • MosS Reynolds number 5000 10000 50000 100000 500000 1000000 • Wegstein’s method Reynolds number Initial estimate Final estimate # of Iterations Relative error .0044870 .0032814 . (Re = 100000) 2.0077046 .0000010 .

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 Newton’s 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. 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) + .7) to yield xk+1 = xk + xk − f (xk ) − xk 1 − [1 − f 0 (xk )] or f (xk ) . The graphical representation of this formula is shown below: From the figure: tan θ = F 0 (xk ) = xk+1 − F (xk ) xk+1 − xk Hence.1 Taylor Series Expansion of a Function Given a function y = f (x).14 Module 1: Roots of Single Equations which is Newton’s formula for the form of the equation x = F (x). xk+1 = xk − 1. f 0 (xk ) which is Newton’s iterative formula for the form of the equation f (x) = 0.7.

say xk+1 . P. Quiwa 1.9) is to be of any computational use.E. thus: 0 = f (xk ) + f 0 (xk ) (xk+1 − xk )1 1! Solving for xk+1 gives xk+1 = xk − 1. (1.9) If (1.2 15 Derivation of Newton’s 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. we obtain the approximation f (¯ x) = 0 ≈ f (xk ) + f 0 (xk ) (¯ x − xk )1 1! (1.10). (1.7.8) where · · · means the remaining terms of the series (an infinite number of terms). We can do this provided that we replace x ¯ by an estimate of x ¯.8) at x=x ¯.3 f (xk ) f 0 (xk ) Graphical Representation of Newton’s 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.7. the ≈ must be replaced by =. we obtain f 0 (xk ) (¯ x − xk )1 + · · · f (¯ x) = 0 = f (xk ) + 1! Dropping the remaining terms of the series.10) . Evaluating (1.

7.4 Condition for Convergence of Newton’s Method From MoSS: xk+1 = F (xk ) = xk − f (xk ) f 0 (xk ) Newton’s 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 1− and the condition for convergence of Newton’s method is .16 Module 1: Roots of Single Equations 1.

.

.

f (x)f 00 (x) .

0 .

.

<1 |F (x)| = .

[f 0 (x)]2 .

−1 Example: Calculate sin . 1. . . f 0 (xk ) should not be close to zero for k = 0. . x0 should be sufficiently close to x ¯ 2. Qualitatively: 1. 2.

.

.

xk+1 − xk .

.

.

< 0.001 0.52 using .

xk+1 .

Taking x0 = = 0. Let x = sin−1 0.866025 6 sin .52 or sin x = 0.52 = −0.02 6 π cos = 0.52.523599: 6 6 π − 0.52 = 0 cos x π π .50 = 30o = f (x0 ) = f 0 (x0 ) = = = sin x − 0. Then: f (x) f 0 (x) 1st iteration: We note that sin−1 0.

E. P. Quiwa 17 x1 .

.

.

x1 − x0 .

.

.

.

x1 .

023094 = = 0.020000 = 0.000135 f 0 (x1 ) = 0.866025 = 0.042243 0.523599 − = 0.546693 = x0 − 2nd iteration f (x1 ) = 0.023094 f 0 (x0 ) 0.546535 f (x1 ) .854248 f (x1 ) x2 = x1 − 0 = 0. f (x0 ) −0.523599 + 0.546693 0.

.

.

x2 − x1 .

.

.

.

x2 .

5 Summary Form of the equation: f (x) = 0 f (xk ) Iterative formula: xk+1 = xk − 0 f (x.001 sin−1 0.000289 < 0.52 ≈ 0.546535 1.7. = 0.

k ) .

.

f (x)f 00 (x) .

.

<1 Convergence criterion: .

.

[f 0 (x)]2 .

|f (xk )| < ε or b. Absolute error criterion: |xk+1 − xk | < ε . Criteria for termianting the iterations: a.

.

.

xk+1 − xk .

.

.

Relative error criterion: .<ε c.

xk+1 .

2. 1. f x.6 EASY Implementation procedure NEWTON(ε. .7. . x) iter ← 0 f x ← f (x) output iter. ’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. others e. x. k = 0. x. 2. . . itmax. itmax 1.// //zero slope. terminate iterations// //function call to evaluate f (xk ). or or and d. . k = 1.// //method converges within itmax iterations// //method fails to converge in itmax iterations// . 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 ). . A prescribed maximum number of iterations.

but does not.0005477 1.0000484 1.5 and three equal positive roots near 1.4526524 . 20. In contrast.4211748 −1. Results √ √ Given equation: x4 − 2 2x3 + 4 2x − 4 = 0 itmax =20. ε =10−6 Iterations of Newton’s method: xk |f (xk )| 1.4142645 −1.0018398 1.5000000 −1. we see that there is a distinct negative root near −1.0011517 . . otherwise).0001628 1. .1586797 . the method exhibits slow convergence (linear) in finding the multiple root.0000013 1. k 0 1 2 3 xk −1.4193051 .4256567 .4142136 |f (xk )| 2. Find the roots of the equation x4 − 2 2x3 + 4 2x − 4 = 0. Solution: a. a tolerance of 10−6 notwithstanding. Likewise. Note the rapid convergence (quadratic) of Newton’s method in finding x ¯1 and the accuracy of the result. b.4398965 .4313611 .5.414213562 .0000004 √ √ The true roots are x ¯1 = − 2 = −1.0000143 1. x0) go to 1 end procedure //initial estimate// procedure f(x) √ √ return xˆ4 − 2 ∗ 2 ∗ xˆ3 + 4 ∗ 2 ∗ x − 4 end procedure procedure df(x) √ √ return 4 ∗ xˆ3 − 6 ∗ 2 ∗ xˆ2 + 4 ∗ 2 end procedure c. and x ¯2 = x ¯3 = x ¯4 = 2. Find initial estimates From the plot of f (x) = 0.4218475 . the final estimate is accurate only to three digits. whichever occurs first.1231602 .18 Module 1: Roots of Single Equations √ √ Example 1.4716824 . This is because the function is tangent to the x-axis at a multiple root (crosses the axis if the multiplicity is odd.5000000 . Iterate until |f (xk )| < ε or the number of iterations exceeds 20.0000001 k 0 1 2 3 4 5 6 7 . A very small tolerance must be used to get more nearly accurate estimates. EASY procedures procedure MAIN() 1: input x0 call NEWTON(10−6 .0000043 1.

4716824 1.5477439D − 03 .5477439D − 03 . Quiwa 19 √ √ Given equation: x4 − 2 2x3 + 4 2x − 4 = 0 itmax =20.4835084D − 04 .4144124 16 1..4835084D − 04 .1952177D − 11 ..4143019 18 1.2223609D − 10 . Shown below is the schematic diagram of a 4-bar mechanism.4142159 .3426079D − 16 Example 2.4716824 1.4313611 |f (xk )| .1839828D − 02 .4526524 1.4142213 1.4142170 1.4398965 1. where R1 = R2 = R3 = d c d a a2 − b2 + c2 + d2 2ac .1434750D − 04 23 24 25 26 1.3911801D − 15 . θ = 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 Freudenstein’s equation R1 cos θ − R2 cos Φ + R3 − cos(θ − Φ) = 0.5784258D − 12 k 0 1 2 3 4 . xk 1. .1434750D − 04 15 1.4398965 1.E. .4142725 √ √ 3 4 Given equation: x − 2 2x + 4 2x − 4 = 0 itmax =30.4142187 1. k 0 1 2 3 4 .6588547D − 11 .5000000 1.4313611 |f (xk )| . P.1320558D − 14 .5000000 1.4143461 17 1. ε =10−16 Iterations of Newton’s method: .1162265D − 15 .1628243D − 03 .4526524 1.1839828D − 02 . ε =10−12 Iterations of Newton’s method: xk 1.1628243D − 03 .

9290949 |f (Φk )| .8537284 .0174533 call NEWTON(10−6 .0000000 k 0 1 2 3 Φk . Solution: We will use Newton’s method with the following termination criteria: |f (x)| < 10−6 . c. b. one for each value of θ.. It is desired to generate a table of θ vs Φ values for the full range of motion of the mechanism. 2.9291011 . For θ = 0o .9325267 .1443298(θ = 30o ) . Φ) end for end procedure procedure f(Φ) return R1 ∗ cos(θ) − R2 ∗ cos(Φ) + R3 − cos(θ − Φ) end procedure procedure df(Φ) return R2 ∗ sin(Φ) − sin(θ − Φ) end procedure c.8537284 . ε =10−6 Iterations of Newton’s method: k Φk |f (Φk )| 0 . Φ //1. 2. say with a protractor. .. 30o .7227343 . 10o . we draw the mechanism (more or less to scale) and measure Φ. .0059042 .6981317 . 20. . respectively.7870801 .8537332 .20 Module 1: Roots of Single Equations For b = c = d = 2a. We find that Φ is approximately 40o . Results Given equation: R1 cos θ − R2 cos Φ + R3 − cos(θ − Φ) = 0 itmax =20. 20o .7846756 . Initial estimates: we need to generate 36 initial estimates of Φ.0481333(θ = 0o ) 1 . 40// R1 ← d/c R2 ← d/a R3 ← (aˆ2 − bˆ2 + cˆ2 + dˆ2)/(2 ∗ a ∗ c) Φ ← Φ ∗ 0. the input crank describes a full circle while the output crack oscillates.0047886 . . b. a. R2. For θ = 10o . . EASY procedures procedure MAIN() //R1.0068645 .7846724 .0007109 2 .0174533 for θ ← 0 to 360 by 10 do θ ← θ ∗ 0. .0000000 k 0 1 2 3 Φk .7230924 .0000000 |f (Φk )| .0000001 k 0 1 2 3 Φk . 2.0000065 . 20o . itmax = 20. R3 and θ are assumed to be global variables// input a.7227343 . we will use as Φ0 the final estimate of Φ that we obtained for θ = 0o . d.7846724 |f (Φk )| . with θ varying in increments of 10o .1321611(θ = 20o ) .0000095 .0000124 .8566891 .1186553(θ = 10o ) .

0000000 .0000000 .0000000 .0000001 . Solution: a.0000000 .0000000 .0901000 94. Summary of results for Freudenstein’s equation: Newton’s method θ.7480900 82.7474100 77.0000008 .0000004 .0000003 .0000000 .4096200 |f (Φ)| .8526700 62.3727300 55.0000000 .0000006 .0000001 .0000001 .7856700 75.2332200 57.6425100 38. whichever occurs first. Find the roots of the equation x4 − 2 2x3 + 10 2x − 25 = 0.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.0229700 29.7450900 91. iterate until |f (xk )| < 10−6 or the number of iterations exceeds 20.0036100 30.7057300 84.1293600 37.0000000 .0000000 . .0000002 .0000000 .0000000 .1571700 42.4410400 35.5106600 97.0000007 .0000001 . Find initial estimates.9150400 53.0000000 .0000000 . P.0000000 .4837700 30.3715600 31.0006900 29.1608200 95.7013200 67.0869300 91.9584200 48.2992900 41.3411000 96.5225100 65.0000000 .6969800 72.0000000 .9497900 48.5772100 87.0000002 .0000001 .0000008 .0000003 .6277500 34.0000004 . degrees 41. 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 Φ. Quiwa 21 d.0000000 .0000000 .4096300 44.E.4179500 29.0000000 .0000008 .6876900 33.4471100 29.3411000 32.

line may be used to find xk+1 .0478859i 11.0095732 + .9209792 1.0000000i −2. Results xk f (xk ) |f (xk )| −2.2487340 + .4142136 + 1.0000008 + . then a secant.7 xk f (xk ) |f (xk )| 2.0003821i .0555213i 11.5 ± 1. we see that there is a negative root near −2.0749252 + .0000000i .0000000i −9.2360680 + .1473827i 7. so the test if |f x| < ε then return where ε is real is valid.0000000 A Variation on Newton’s Method If f (x) is such that evaluating f 0 (xk ) as k = 0.0095732 −2.0000000i .0000000i 9. The two other roots are complex.0563212 −2. .0000001 + . b.7327260i .1000000 + .4098347 + 1.1814712i 2.2360680 + . 2.7424264 + −2.0000000i .8958894 1. .7872348i 2.0000000 + .1189559 1.0000000i 1.2361753 + .0004554 1.0563212 + .0000000i . 1.0799369i .0000000i .0880942 + .7.2099738 + .0017637 + .0000000i 2. 20. EASY procedures procedure NEWTON can be used to find all the roots of the given equation by simply declaring x.3000000i −6.7320346i −.5000000 + 1.0000000i . . in lieu of a tangent.7320508i . These turn out to be 1.0000008 k 0 1 2 3 k 0 1 2 3 k 0 1 2 3 4 5 1.0000000i . .22 Module 1: Roots of Single Equations From the plot of f (x) = 0. 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.0017637 2.7189498 + 4.0474788 2.2501331 + .0002478 + .0000000i .0828458 1.2811528 + 2.2361991 + .2099738 2.0000000i .0365531 −2. is too cumbersome.0000000i . Note that |f x| is real.4142084 + 1.0000001 xk f (xk ) |f (xk )| 1.1.0000000i . f x and df x to be complex.1 and a positive root near 2.3648547 + 1.3i if we replace 2 2 and 10 2 in the equation by 3 and 14 respectively (just to simplify the computations).0000000i 1.0365531 + .1000000 + .0474788 + . x0)go to 1 end procedure //initial estimate must be a complex number// procedure f(x) √ √ return xˆ4 − 2 ∗ 2 ∗ xˆ3 + 10 ∗ 2 ∗ x − 25 end procedure //function must be declared as complex// procedure df(x) √ √ return 4 ∗ xˆ3 − 6 ∗ 2 ∗ xˆ2 + 10 ∗ 2 end procedure //function must be declared as complex// c. procedure MAIN() 1: input x0 call NEWTON(10−6 .

1 s 1 + e cos θ 1 − e2 3 " 2 tan −1 r 1−e θ tan 1+e 2 ! # √ e 1 − e2 sin θ − =0 1 + e cos θ Richmond’s Method Motivation Consider applying a relaxation factor ω to Newton’s method.E. P.8. Example: πφ f (e) = − 360 1. as: xk+1 = xk − ω Newton’s method undershoots the root: Apply ω > 1 f (xk ) f 0 (xk ) Newton’s method overshoots the root: Apply ω < 1 . Quiwa 23 The iterative formula now becomes xk+1 = xk − where s= f (xk ) s f (xk ) − f (xk − δ) δ for some suitable δ.8 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 .2 Module 1: Roots of Single Equations Richmond’s 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 Newton’s method to replace the expression within the f 0 (xk ) brackets.24 1. we have: xk+1 = xk − xk+1 = xk − f (xk ) f 0 (xk ) + 1 00 2 f (xk ) h k) − ff0(x (xk ) i 2f (xk )f 0 (xk ) Richmond’s 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.

f (x) f 0 (x) f 00 (x) = 2 cos x − ex = 0 = −2 sin x − ex = −2 cos x − ex . P.E. Then ξ = xk − f (xk ) f 0 (xk ) from which ξ − xk = − f (xk ) f 0 (xk ) From the figure above. Quiwa 25 Let ξ be the estimate of x ¯ predicted by Newton’s formula. 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 .001 to stop the iterations. Use the criterion f (xk ) < 0. 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.

106444 f 0 (x0 ) = −2 sin(0.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.607572 f 00 (x0 ) = −2 cos(0.001 x ¯ ≈ 0.403886 2f (x0 )f 0 (x0 ) x1 = x0 − 2[f 0 (x0 )]2 − f (x0 )f 00 (x0 ) 2(0.8. Absolute error criterion: |xk+1 − xk | < ε .50 = −3.50 = −2.50 = 0.50 f (x0 ) = 2 cos(0.607572)2 − (0.403886) 2nd iteration f (x1 ) = 2 cos(0.539762 = 0.539762) − e0. |f (xk )| < ε or b.539762 2(−2.26 Module 1: Roots of Single Equations 1st iteration: Take x0 = 0.000064 < 0.607572) = 0.50) − e0.50) − e0.539762 1.50 − = 0.106444)(−2.106444)(−3.50) − e0.

.

.

xk+1 − xk .

.

<ε c. Relative error criterion: .

.

xk+1 .

or d. k = 1. . x. 2.// ddf x ← ddf (x) //function call to evaluate f 00 (xk ). . ’Initial estimate’ for iter ← 1 to itmax do df x ← df (x) //function call to evaluate f 0 (xk ). 1. . . . others or and e. x) iter ← 0 f x ← f (x) //function call to evaluate f (x0 )// output iter. k = 0. f x if |f x| < ε then return //method converges within itmax iterations// end for return //method fails to converge in itmax iterations// end procedure .5 EASY Implementation procedure RICHMOND(ε.// 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 ). f x. k = 0. 1. x. . A prescribed maximum number of iterations. . . itmax 1. 2. itmax. . 2.// output iter.8.

EASY procedures procedure MAIN() 1: input x0 call RICHMOND(10−6 .0000000 k 0 1 2 3 4 xk 1.5000000 1. whichever occurs first.4250311 1.1231602 .0092335 . Find initial estimates From the plot of f (x) = 0.4196258 |f (xk )| . Iterate until |f (xk )| < ε or the number of iterations exceeds 20.E.5000000 1 −1. x0) go to 1 end procedure //initial estimate// procedure f(x) √ √ return xˆ4 − 2 ∗ 2 ∗ xˆ3 + 4 ∗ 2 ∗ x − 4 end procedure procedure df(x) √ √ return 4 ∗ xˆ3 − 6 ∗ 2 ∗ xˆ2 + 4 ∗ 2 end procedure procedure ddf(x) √ return 12 ∗ xˆ2 − 12 ∗ 2 ∗ x end procedure c. ε =10−6 Iterations of Richmond’s method: k xk 0 −1. b. Solution: a. Results √ √ Given equation: x4 − 2 2x3 + 4 2x − 4 = 0 itmax =20.0000288 . 20.4573202 1.0002300 .4358212 1.0018398 . we see that there is a distinct negative root near −1. P.0000004 .4142136 |f (xk )| 2.5 and three equal positive roots near 1. Find the roots of the equation x4 − 2 2x3 + 4 2x − 4 = 0.0000036 .5.4146215 2 −1. Quiwa 27 √ √ Example 1.

1839828D − 02 .2875238D − 04 .4142559 1.4142100 1.4145520 9 1.4978656D − 15 .2025290D − 15 .5000000 1.5139118D − 15 .4142982 1.4142196 1.5615769D − 07 .7019713D − 08 .8456777D − 16 .4148905 1.4142346 1.4142158 1.4196258 1.5000000 1 1.3594082D − 05 .3596949D − 14 .4169205 1.4142087 1.4142186 1.4145520 1.2320193D − 15 .1371091D − 10 .4142142 1.1839828D − 02 .4492613D − 06 .4196258 5 1.3594082D − 05 .1371091D − 10 .2875238D − 04 .4155673 1.4358212 3 1.4148905 8 1.2300106D − 03 . ε =10−12 Iterations of Richmond’s method: k xk 0 1.4142186 1.4142148 |f (xk )| .1096831D − 09 .4142559 √ √ Given equation: x4 − 2 2x3 + 4 2x − 4 = 0 itmax =30.2621514D − 13 .1131907D − 15 .4169205 6 1.7190429D − 15 .2143927D − 12 .1713973D − 11 .6557255D − 15 .4492613D − 06 .8774641D − 09 .4358212 1.4573202 2 1.4573202 1.4250311 4 1.4143828 10 1.2143927D − 12 |f (xk )| .4155673 7 1.4143828 1.28 Module 1: Roots of Single Equations √ √ Given equation: x4 − 2 2x3 + 4 2x − 4 = 0 itmax =20.4142982 11 1.4142242 1.1713973D − 11 .4142108 1.5615769D − 07 .8774641D − 09 .1096831D − 09 .2053479D − 15 .2300106D − 03 . ε =10−16 Iterations of Richmond’s 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.7019713D − 08 .4250311 1.1565588D − 15 .4142192 1.

8535511 .7227266 .0174533 for θ ← 0 to 360 by 10 do θ ← θ ∗ 0. Φ) 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. c.7845422 . Freudenstein’s equation Solution: We will use the Richmond method with the following termination criteria: |f (x)| < 10−6 .0000000 k Φk |f (Φk )| 0 . b.0000000 k Φk |f (Φk )| 0 . Quiwa 29 Example 2.8537284 .9288731 . Initial estimates: Same as in Newton’s method b.9290949 . a. 20.6981317 .1186555(θ = 10o ) 1 . R3 and θ are assumed to be global variables// input a. R2.7227342 . itmax = 20.1321613(θ = 20o ) 1 .8537284 .E.0000000 .0000152 2 . EASY procedures procedure MAIN() //R1. 2. ε =10−6 Iterations of Richmond’s method: k Φk |f (Φk )| 0 .0004428 2 .0481333(θ = 0o ) 1 .7846724 . d. P. 40// R1 ← d/c R2 ← d/a R3 ← (aˆ2 − bˆ2 + cˆ2 + dˆ2)/(2 ∗ a ∗ c) Φ ← Φ ∗ 0.7846724 .0000000 k Φk |f (Φk )| 0 . Results Given equation: R1 cos θ − R2 cos Φ + R3 − cos(θ − Φ) = 0 itmax =20.7227342 .0174533 call RICHMOND(10−6 . 2.1443299(θ = 30o ) 1 .0002586 2 . 2.0003530 2 . Φ //1.

4179500 29.0000000 .7856500 75.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 .30 Module 1: Roots of Single Equations d.0000000 .1293300 37.3410900 32.0000000 .6876900 33.0000000 .7057300 84.5106600 97.0000000 .8526700 62.9584200 48.0000000 .0000000 .0000000 .3726900 55.0000000 .3715600 31.2332200 57.1571400 42.0000000 .4096200 44.0000000 . Summary of results for Freudenstein’s equation: Richmond’s method θ.0000000 .2992900 41.9497500 48.0901000 94.4837600 30.6424900 38.0000000 .3410900 96.6969800 72.7474100 77.0000000 .0000000 .0000000 .0000000 .4410300 35.0000000 .0000000 .7013200 67.9150400 53.0000003 .0000000 .0000000 .7450900 91.4096200 |f (Φ)| .0000000 .7480900 82.0000000 . degrees 41.0000000 .0229700 29.0000000 .0000000 .0000000 .1608000 95.0000000 .5772100 87. 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 Φ.0000000 .0869300 91.0000000 .0000000 .4471100 29.0000004 .0000000 .0007000 29.0000004 .0000000 .6277300 34.0036100 30.5224900 65.

For example. such that f (lk )f (rk ) < 0.0001 = 0. et al. P. 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 .8763 + 0.8763 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. If f (l0 )f (xk ) > 0. else. set lk+1 = lk and rk+1 = xk The test f (l0 )f (xk ) > 0 may fail due to underflow.8763 + 0.9. 1977. if f (xk ) = 10−30 and f (l0 ) = 10−20 (in single precision) then an underflow will occur.8766 1.8760 which is outside the interval 0. k = 0. in which numbers are represented as floating-point numbers with fixed precision. .E.9 1.8766 x = = x = chopped −→ l k + rk 0.8766 − 0.1 31 Half-Interval Method Algorithm 1. To avoid this. .00015 lk + 2 2 2 0.8763 + 0.752 = = −→ 2 2 2 2 0.0003 rk − l k = 0.. 2. 162 3.8763 + = 0. p. Computer Methods for Mathematical Computations. set lk+1 = xk and rk+1 = rk . Calculate xk = l k + rk rk − l k = lk + 2 2 On a computer. the midpoint of the interval should be calculated as the rightmost formula. Prentice-Hall.8763 + = 0. Example: Suppose we have a computer which implements four decimal digit chopped floatingpoint arithmetic.7529 chopped 1. lk = 0.” Forsythe.8763 rk = 0. Quiwa 1. . Choose lk and rk .

0. ε = 10−6       log(1. then   δ0 log(δ0 /ε) δ0 δ0 n n ≤ ε =⇒ 2 ≥ =⇒ log 2 ≥ log =⇒ n = 2n ε ε log 2 Example: Let δ0 = 1. . beforehand.93e = 20 n= log 2 log 2 0. Absolute error criterion: |rk+1 − lk+1 | < ε or If the absolute error criterion is used.32 Module 1: Roots of Single Equations 4. it is possible to determine. Repeat steps 2 and 3 until a.. δk = δ0 = interval after the the kth iteration 2k Now. the number of iterations needed to reduce the initial interval r0 − l0 to the specified tolerance ε.0/10−6 ) 6 log(δ0 /ε) = = = d19. Let δ0 = r0 − l0 = original interval containing x ¯. Then: δ1 = δ2 = δ0 = interval after the the 1st iteration 2 δ1 δ0 = = interval after the the 2nd iteration 2 4 .3010 . let n be the number of iterations needed to reduce δ0 to ≤ ε.

.

.

.

.

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 .

thus obviating the need to keep xk . and rk+1 . .

.

.

.

.

.

k+1 .

.

xk+1 − xk .

.

.

rk+1 −l .

.

.

rk+1 − lk+1 .

.

2 .

.

=.

.

xk+1 .

.

rk+1 +lk+1 .

.

= .

rk+1 + lk+1 .

|f (xk )| < ε d. the number of iterations > itmax or . 2 Note that rk+1 + lk+1 may become zero. c. this means that a zero test must be included to avoid a floating-point divide exception.

x. R call HALF INTERVAL(10−6 . We set l0 = 2 and r0 = 3. Solution: a. L. R) go to 1 end procedure procedure f(x) return 2 ∗ ln(x) + xˆ2 − 8 end procedure //initial interval// .2 33 EASY Implementation procedure HALF INTERVAL(ε. Iterate until the absolute error < 10−6 or the number of iterations exceeds 20. itmax. R.E. P. EASY procedures procedure MAIN() 1: input L. L. 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. 20. L. we see that the root lies between 2 and 3. Find the root of the equation 2 ln x + x2 − 8 = 0. b. whichever occurs first.9. Find initial estimates From the plot of f (x) = 0. Quiwa 1. R) f L0 ← f (L) for iter ← 0 to itmax do //Computation// xerr ← R − L x ← L + xerr/2 output iter.

4857788 2.4855957 2.4863281 2.0019531 . L.0009766 . R) go to 1 end procedure //initial interval// .4853516 2.5000000 2.0000000 2.0000010 √ √ Example 2.4853516 2. ε =10−6 Iterations of half-interval method: Initial interval: [2.4857311 2.4857178 2.4857330 xk 2.0000153 . we see that there is a distinct negative root between −2 and −1 and three equal positive roots between 1 and 2.5000000 2. R call HALF INTERVAL(10−7 .2500000 2.0156250 .0000000 .4857321 2.4882813 2.4858398 2.2500000 2.4843750 2.5000000 2.0625000 .4857788 2.5000000 2.1250000 . Solution: a. b.5000000 2.4843750 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. Find the roots of the equation x4 − 2 2x3 + 4 2x − 4 = 0.4857330 2.0078125 .4858398 2. 30.0002441 .4375000 2.4882813 2.4857292 2.4863281 2.4857330 2.0039063 .3750000 2.4687500 2.5000000 2.4857178 2.4857178 2.0004883 .5000000 .4687500 2.0001221 . whichever occurs first.4858398 2. Find initial estimates From the plot of f (x) = 0.0000000 2.4857330 2.0000610 .4843750 2.4858398 2.4857292 2.4857311 2.0000019 .34 Module 1: Roots of Single Equations c.4857178 2.3750000 2.0000000 2. Iterate until the absolute error < 10−7 or the number of iterations exceeds 30.4921875 2.4921875 2.4857330 2.4857483 2.4857254 2. Results Given equation: 2 ln x + x2 − 8 = 0 itmax =20.4857326 rk − l k 1.4857330 2.4853516 2.4855957 2.4857178 2.4375000 2.2500000 .5000000 2.4843750 2.4857483 2.4857321 rk 3.0000305 .0000038 .0000076 .4857254 2.0312500 .4843750 2. EASY procedures procedure MAIN() 1: input L.4863281 2.

2] xk 1.4142132 1.5000000 −1.0000002 .4142132 1.4142131 23 1.3750000 −1.1250000 .3750000 Initial interval: [1.4142131 1. Then Pn (x) = m X k=0 = (−1)k (2n − 2k)! x(n−2k) .0000000 .4142136 −1.2500000 1.4142137 −1.1250000 .0000000 1.5000000 .4062500 rk − l k 1.0000002 .. −1] xk −1.0000000 1. Results (see also Newton’s method Example 1.4142131 1.5000000 1.E.4142129 1. ε =10−7 Iterations of half-interval method: Initial interval: [−2. Example 1) √ √ Given equation: x4 − 2 2x3 + 4 2x − 4 = 0 itmax =30.4375000 −1.4142135 −1.4142135 −1. lk 1.2500000 .4142136 .5000000 .4142127 1.2500000 −1.4142137 −1.0000000 −1.0000000 −1. lk −2.4142131 1.0000000 1.5000000 −1.2500000 . Richmond’s method.4142136 24 −1.0000000 . . .0000005 .2500000 −1. Roots of Legendre polynomials.4142132 1. P.5000000 −1.4142135 23 −1. Let Pn (x) be the Legendre polynomial of degree n.4375000 rk −1.4062500 rk − l k 1.4375000 1.5000000 1.4142131 .4375000 Example 3.4142129 22 1.3750000 −1.0000000 −1.5000000 1..0000001 .3750000 rk 2.0000001 .0000001 k 0 1 2 3 4 . − k)!(n − 2k)! 2n k!(n 2n − 1 n−1 · x · Pn−1 (x) − · Pn−2 (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 .3750000 1.4142134 −1.2500000 1. Quiwa 35 procedure f(x) √ √ return xˆ4 − 2 ∗ 2 ∗ xˆ3 + 4 ∗ 2 ∗ x − 4 end procedure c.0625000 22 −1.5000000 −1.0000001 k 0 1 2 3 4 .0625000 21 1.4142131 24 1.3750000 1.5000000 1.

The roots are symmetrically arranged about the origin. then zero is a root. .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. 2. 1].. All n roots are real and lie in the interval [−1. . 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. This means that if n is odd. The roots of Legendre polynomials are used as base points in the Gauss-Legendre quadrature formulas for numerical integration.

L.178571436554194D − 01 .655683787544152 xk −. b.0D − 15) k lk rk xk rk − l k 0 −1.718183790338119 −.357142873108387D − 01 2 −. 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).946428569033742 .933035711292177 .932469514203151 −.928571425378323 −.682469503027281 −. P.892857182770968D − 02 . ε.646755215716442 −.964285712689161 −.661209386466264 .664612359371861 rk −. .932469514203151 −. itmax δ ← b0.. say those in [−1.928571425378323 −. R) L←R end for go to 1 end procedure //n is assumed to be global// procedure f(x) case : n = 2 : return (3 ∗ xˆ2 − 1)/2 : n = 3 : return (5 ∗ xˆ3 − 3 ∗ x)/2 : n = 4 : return (35 ∗ xˆ4 − 30 ∗ xˆ2 + 3)/8 : n = 5 : return (63 ∗ xˆ5 − 70 ∗ xˆ3 + 15 ∗ x)/8 : n = 6 : return (231 ∗ xˆ6 − 315 ∗ xˆ4 + 105 ∗ xˆ2 − 5)/16 : else :[output ’n is out of range’.410782519111308D − 14 −.932469514203152 −.932469514203149 −. stop] end case end procedure c.928571425378323 −.999200722162641D − 15 lk −. Only bn/2c roots of Pn (x) need to be calculated.682469503027281 −.664612359371861 −.999200722162641D − 15 .000000000000000 −.946428569033742 −. A reasonable value is a fraction of the average spacing between roots.937499997206032 . 44 45 46 k 0 1 2 3 . Quiwa 37 Solution: a.714285746216774D − 01 .646755215716442 −.932469514203153 −.932469514203152 .661209386466265 .964285712689161 .932469514203151 .664612359371861 −. .661209386466265 −.660148073458006 rk − l k .661209386466263 −.5/(n + 1)c L ← −1 for j ← 1 to bn/2c do while f (L) ∗ f (L + δ) > 0 do L←L+δ end while R←L+δ call HALF INTERVAL(ε.661209386466265 −. We choose an interval size δ and ’march’ to the right in steps of δ until we find an interval which contains a root.661209386466265 −.199840144432528D − 14 −. 0]. −.937499997206032 −.932469514203153 −.646755215716442 −.178571436554194D − 01 3 −.661209386466264 −. We then apply the half-interval method to reduce δ to ε. Results Iterations of the half-interval method for the Legendre polynomial of degree 6 (ε = 1.399680288865056D − 14 45 −.932469514203152 .357142873108387D − 01 .199840144432528D − 14 46 −.661209386466261 −. EASY procedures procedure MAIN() 1: input n.655683787544152 −.928571425378323 −.892857182770968D − 02 44 −. itmax.661209386466263 ..E.714285746216774D − 01 1 −.

241566510563910 rk −.232637938736200 xk −.237102224650055 rk − l k .10 Regula-falsi method Regula-falsi is also known as method of false position.250495082391619 −. and is also called linear interpolation method.268352226047039 −.232637938736200 −.238619186083197 −.202615701994091D − 14 46 −.38 Module 1: Roots of Single Equations k 0 1 2 3 .714285746216774D − 01 .238619186083197 .238619186083197 .268352226047039 −.892857182770968D − 02 45 −. 1. .238619186083198 −.102695629777827D − 14 47 −.238619186083197 −.238619186083196 −. lk −.1 Derivation By similar triangles: rk − xk rk − l k = f (rk ) f (rk ) − f (lr ) Solving for xk .10. 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) .178571436554194D − 01 .250495082391619 −.238619186083197 .357142873108387D − 01 ..232637938736200 −.238619186083197 −.499600361081320D − 14 1.241566510563910 −.238619186083196 −.232637938736200 −.304066513357877 −.

2.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 . set lk+1 = lk and rk+1 = xk 4. Calculate xk = lk · f (rk ) − rk · f (lk ) f (rk ) − f (lk ) 3. Choose lk and rk . we get: xk = lk − 1. P. Quiwa 1. else.3 f (lk ) · (lk − rk ) f (lk ) · (rk − lk ) = lk + f (rk ) − f (lk ) f (rk ) − f (lk ) Algorithm 1. If f (l0 )f (xk ) > 0.10.10. set lk+1 = xk and rk+1 = rk . k = 0.E. such that f (lk )f (rk ) < 0. Repeat steps 2 and 3 until .

.

.

xk+1 − xk .

.

<ε a. Relative error criterion: .

.

xk+1 .

|f (xk )| < ε or c. The test |f (x)| < ε appears to be the most appropriate. or b. The estimate may be already be very close to x ¯ but rk − lk may still be very large. . the number of iterations > itmax The absolute error criterion rk − lk is not suitable for the regula-falsi method.

whichever occurs first. Find initial estimates We set l0 = 2 and r0 = 3. Find the root of the equation 2 ln x + x2 − 8 = 0. L. f x //Test for termination// if |f x| < ε then return //Updating// if f L ∗ f x > 0 then [L ← x.4 EASY Implementation procedure REGULA FALSI(ε. b. R call REGULA FALSI(10−6 . 20. L.10. f R ← f x] end for return end procedure //ε not satisfied in itmax iterations// Example 1. Solution: a. L. R. Iterate until |f (x)| < 10−6 or the number of iterations exceeds 20. itmax. EASY procedures procedure MAIN() 1: input 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. R) go to 1 end procedure procedure f(x) return 2 ∗ ln(x) + xˆ2 − 8 end procedure //initial interval// . f L ← f x] else [R ← x.40 Module 1: Roots of Single Equations 1. x.

4857314 2.4497913 2. Quiwa 41 c.4497913 2.0000000 3.4857314 rk 3. Find the roots of the equation x4 − 2 2x3 + 4 2x − 4 = 0.0000000 2. whichever occurs first. b.0000000 3.0000053 0.4855509 2. 3] k 0 1 2 3 4 5 lk 2.0147695 0.4831744 2.0000000 3. Iterate until |f (x)| < 10−7 or the number of iterations exceeds 30. R) go to 1 end procedure procedure f(x) √ √ return xˆ4 − 2 ∗ 2 ∗ xˆ3 + 4 ∗ 2 ∗ x − 4 end procedure //initial interval// .2065171 0. EASY procedures procedure MAIN() 1: input L. Find initial estimates From the plot of f (x) = 0.4857195 2. we see that there is a distinct negative root between −2 and −1 and three equal positive roots between 1 and 2. Results Given equation: 2 ln x + x2 − 8 = 0 itmax =20.0000000 3. R call REGULA FALSI(10−7 . P.0000000 3. Solution: a.0000004 √ √ Example 2.E. L.4831744 2.0010482 0.0000744 0.4857323 |f (xk )| 0.4855509 2.0000000 xk 2. 30. ε =10−6 Iterations of regula-falsi method: Initial interval: [2.4857195 2.

0000000 1.3685111 −1.4054626 |f (xk )| 3.000000000000000 −1.0000217 500 1.932469514203151 −.0000000 xk 1.932469514203152 −.932282223862327 xk −.3128073 −1.4142135 −1.0256970 0.3941050 −1. .3685111 −1.932469514203150 −. Results (see also Newton’s method Example 1..0096855 0.0E − 15) k 0 1 2 3 .0000217 499 1.2709443 1.0000003 0. lk −1. . Richmond’s method.0000000 2. −1] k 0 1 2 3 4 .840473524110763D − 15 .0168275 0.0000000 rk −1.640069208769073D − 03 28 −1. .2606553 1.932282223862327 −.42 Module 1: Roots of Single Equations c. lk 1.176902130462632D − 02 −.3944575 0...2473286 1.2000000 −1.000000000000000 −.000000000000000 rk −.4142136 −1.2288735 1. lk −2.2000000 1.3944383 2.0066234 497 1.0000000 −2.2000000 1.931043560959287 −.0000000 2.3944383 0.2792373 |f (xk )| 0.0000000 −2.2000000 −1.0000007 0.3128073 −1. Example 1) √ √ Given equation: x4 − 2 2x3 + 4 2x − 4 = 0 itmax =30.0000001 Initial interval: [1.0565063 0.3944191 0.0000000 1.3943998 2. ε =10−7 Iterations of regula-falsi method: Initial interval: [−2.0000000 2.487673700001607D − 02 −. Iterations of the regula-falsi method for the Legendre polynomial of degree 6 (ε = 1.4453696 0.4142135 −1.931951982076715 −.000000000000000 −.0000000 2.3944575 2.932469514203152 −.000000000000000 −1.0000000 −1.3944766 0.928571425378323 −.0078964 0. .0000218 498 1.188998122707673D − 14 30 −1.4142135 −1.3944191 2.0000000 −2.4142136 0.0000000 −2.0000000 −2.0000000 2.2606553 1.4142136 −1. Example 3.0000000 −1.1961789 19 20 21 22 −2.9848056 0.3941050 xk −1.0000000 1.0000216 .8271030 2.608974676241658D − 14 29 −1.133497073864128D − 01 −.2709443 rk 2.2473286 1.2288735 1.000000000000000 −1.4142135 −1.4142135 −1.0000000 1. 2] k 0 1 2 3 4 5 .932401806504425 |f (xk )| −.0000000 −2.0000001 0.0123704 0.931043560959287 −.0000000 −2.0000000 1.000000000000000 −.931951982076715 −.932469514203151 −.932469514203152 −..

577350269189626 48 ±0.718183790338120 −.238687901784039 −.718183790338120 −.238619186083197 ±0.427110542237583D − 07 .238619186081093 xk −.339981043584856 ±0.661209386466264 ±0.661208916885283 −.718183790338120 −.932469514203152 ±0.718183790338120 −. Quiwa k 0 1 2 3 4 5 6 7 8 k 0 1 2 3 43 lk −.103951959887216D − 11 .238687901784039 −.508363257247090D − 04 .232637938736191 −.358703208195449D − 10 .932469514203152 ±0.238619186081093 −.718183790338120 −.661209386466264 |f (xk )| .5/(n + 1) ε = 1.538469310105683 0.661193188688707 −.538469310105683 47 47 ±0.861136311594053 ±0.123776642602970D − 08 .932469514203152 ±0.E.661209386466255 −.861136311594053 ±0.774596669241483 47 ±0.11 Graeffe’s Root-Squaring Method 1.577350269189626 ±0.660657257594325 −.304066513357868 −.661209386454836 −.718183790338120 lk −.661209386071887 −.447854104604524D − 11 −.661209386071887 −.861136311594053 ±0.660657257594325 −.0 ±0.0 ±0.661209386454836 −.774596669241483 0.906179845938664 ±0.661209386465933 −.661209372857669 −.0D − 15 1.661209386466265 ±0.238619186083197 46 46 47 ±0.661208916885283 −.238619186083197 −.0 ±0.661193188688707 −. P.11.147379557694644D − 05 .146293711950872D − 03 −.232637938736191 −.238619064960429 −.718183790338120 −.238619186083197 30 8 3 6 Half-interval method Regula-falsi method n Note: Initial interval size δ = 0.339981043584857 47 47 ±0.1 Form of the Equation f (x) = xn + a1 xn−1 + a2 xn−2 + · · · + an−1 x + an = 0 = (x − x ¯1 )(x − x ¯2 )(x − x ¯3 ) · · · (x − x ¯n ) an 6= 0 .718183790338120 −.238687901784039 rk −.774596669241483 17 4 ±0.661209386466255 rk −.257862337553098D − 06 −.0 ±0.906179845938664 ±0.646755215716442 −.173174649775357D − 02 .906179845938664 ±0.577350269189626 12 3 0.538469310105683 11 8 ±0.797322277645840D − 15 xk |f (xk )| −.238687901784039 .674102700742862D − 16 Roots of Legendre polynomials: summary True value 2 ±0.661209372857669 −.339981043584856 15 6 5 0.661209386466265 ±0.718183790338120 −.661209386465933 −.238619064960429 −.300677451686715D − 13 .

11) .44 Module 1: Roots of Single Equations 1. we get h(p)h(−p) = 0 = s(q) = q 2 + 97q + 1296 = (q + 81)(q + 16) We note that q¯1 q¯2 = −81 = −(−9)2 = −(−3)4 = −¯ x14 = −16 = −(−4)2 = −(+2)4 = −¯ x24 Repeating this root-squaring process on successive derived polynomials. Computationally steps 2 and 3 are carried out as a single step.294967 × 109 . Finding the roots of the kth derived polynomial g(y) = 0 from the simple approximate relationships between its coefficients and its roots. we obtain k = 3: −¯ x18 = −6561 −¯ x28 = −256 k = 4: −¯ x116 = −43046721 −¯ x216 = −65536 k = 5: −¯ x132 = −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. Now. .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.2 Steps in Graeffe’s Root-Squaring Method 1. 1. form the polynomial f (x)f (−x) = 0 = (x2 + x − 6)(x2 − x − 6) = x4 − 13x2 + 36 Letting p = −x2 .11. y¯n = −¯ xnm 2. (1.853020 × 1015 −¯ x232 = −4. 3.11. m of the roots of f (x) = 0. we get f (x)f (−x) = 0 = h(p) = p2 + 13p + 36 = (p + 9)(p + 4) We note that p¯1 p¯2 = −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 . that is y¯1 = −¯ x1m m = 2k m y¯2 = −¯ x2 (1. Calculating the roots of f (x) = 0 from Eqs.11)..

11..13) are related according to (1. 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.12).14) to generate k successive polynomials.13). x ¯2 . .11). culminating in (1. we will have x ¯1m >> x ¯2m . will be Pn g(y) = Pi=0 aki y n−i = 0.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 . such that r1 = −¯ x1 r2 = −¯ x2 . Let two successive polynomials be defined by the coefficients aj0 aj1 aj2 aj3 aj4 aj5 · · · ajn−2 ajn−1 ajn aj+1 0 aj+1 1 aj+1 2 aj+1 3 aj+1 4 aj+1 5 · · · aj+1 n−2 aj+1 n−1 aj+1 n Then: aj+1 0 aj+1 1 aj+1 2 aj+1 3 . we use (1. a00 = 1 (1. Quiwa 45 Inspection of the above results show that at some large even power m. In general for the nth degree polynomial equation f (x) = n X a0i xn−i = 0.12) and (1. and x ¯3 .14) To summarize: Starting with the original polynomial (1. for every i. = (aj0 )2 = (aj1 )2 − 2aj0 aj2 = (aj2 )2 − 2aj1 aj3 + 2aj0 aj4 = (aj3 )2 − 2aj2 aj4 + 2aj1 aj5 − 2aj0 aj6 aj+1 n−1 aj+1 n = (ajn−1 )2 − 2ajn−2 ajn = (ajn )2 (1. ak0 = 1 n n−i = = 0. 1. .E. such that |¯ x1 | ≥ |¯ x2 | ≥ |¯ x3 |. (1. The roots of (1. say 64.11). rn = −¯ xn . This is the key to Graeffe’s root-squaring method. which is obtained after k root-squaring steps. b0 = 1 i=0 bi y (1.. P. The roots of the two equations are related as found in Eqs.13) where bi = aki .12) i=0 the kth derived polynomial equation.

k m = 2 . kth derived polynomial equation (1. 1. x ¯2 . . real roots Consider again the 3rd degree polynomial equation f (x) = x3 + a1 x2 + a2 x + a3 = 0 with roots x ¯1 . Then the above relations become b1 b2 ≈ r1 m ≈ r1 m r 2 m since r1 m >> r2 m >> r3 m . we have b1 b2 bn = −(¯ y1 + y¯2 + y¯3 ) = r1 m + r2 m + r3 m = y¯1 y¯2 + y¯1 y¯3 + y¯2 y¯3 = r1 m r2 m + r1 m r3 m + r2 m r3 m = −¯ y1 y¯2 y¯3 = r1 m r2 m r3 m In general. and consequently. for every i. for the kth derived polynomial g(y) = y 3 + b1 y 2 + b2 y + b3 = 0. for the nth degree. x ¯i .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. . r2 and r3 . in which y¯i = −¯ xim = −ri m .. . for the actual roots. n. ri . 2. and x ¯3 and Enke roots r1 . . (1. 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 .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 + · · · + rn−1 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 + · · · + rn−2 m rn−1 m rn m (1.11. i = 1. we obtain the following expressions for the Enke roots ri .12) are all well separated. . bn = r 1 m r2 m r3 m · · · r n m Note that Eqs. n. 2. from Eqs. . Let the kth derived polynomial equation be g(y) = y 3 + b1 y 2 + b2 y + b3 = 0 Then.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 |. . (1. we can solve for the Enke roots. . By making suitable approximations based on the fact that the roots of (1.15) . 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. . Using these working approximate relations.15) relate the Enke roots of the original polynomial to the coefficients of the kth derived polynomial.5 Finding the Roots CASE 1: Distinct. i = 1.

15536D + 88)2 = 4.10524D+11 1.00000D+01 2. (1.31776D+05 1.64557D + 176 = 2.16) i = 1.15792D + 77 r 128 4.00000 1.64557D + 176 (c) Find actual roots ri f (+ri ) f (−ri ) 4.40282D+38 1.0 3. n for real.16842D + 69)2 = 1. x ¯2 .15792D + 77 = 4. .0 144.64557D + 176 = 1.15536D+88 4. r2 and r3 .85169D+17 1. 2.30000D+01 1.00000 0. 2.00000 −24. . i = 1.0 −24.15536D+88 4.00000 4.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 .48511D+08 1.00000 0.21166D+22 1. Example. .00000 +24. .0 1.73000D+02 1.46811D+44 2.57904D+05 1.0 2.41823D+34 1.64558D + 176 ≈ a73 real and distinct s bi . .10075D+11 1.15792D + 77 = a71 Regular squared (a62 )2 = (1.00000 1.46557D+176 (a61 )2 = (3.12) gives the sign of x ¯i . Find all the roots of f (x) = x4 − 2x3 − 13x2 + 14x + 24 = 0 using GRSM. i = 1.00000 −1. and x ¯3 and Enke roots r1 .36521D + 138 = 3. 2. (b) Find Enke roots from the equations ri = m bi−1 r r1 = m r r2 = m r r3 = m r4 = m r b1 b0 = b2 b1 = b3 b2 = b4 b3 = √ 128 1.33808D+09 1. Eqs. .00000 +2.0 3.16) yield the magnitude of the actual roots x ¯i . (1. . P.0 0.76000D+02 3. .00000D+00 −1. .0 −2.20000D+02 3.21168D+22 1.64810D+04 1. for an nth degree polynomial equation with distinct real roots. approximately s ri = bi m (1.0 3.0 7. n.40000D+01 8.40282D + 38)2 = 1.0 1.23540D+04 4. (a) Generate Graeffe’s table k 0 1 2 3 4 5 6 7 m 1 2 4 8 16 32 64 128 ak0 ak1 ak2 1.16842D+69 1. Let the kth derived polynomial equation be g(y) = y 3 + b1 y 2 + b2 y + b3 = 0 Then.00000 −3.0 1.46811D+44 2.0 0.15792D+77 1.36521D+138 ak3 1. .E.00000 r 128 1. the Enke roots will be. distinct roots.84486D+19 3.0 4. 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 . Quiwa 47 In general. Substitution of +ri and −ri into Eq.0 3.0 x ¯i +4.54000D+02 2. .64557D+176 ak4 2. n bi−1 where b0 = 1. for every i.36521D + 138 = a72 ⇒ relationship: all roots (a63 )2 = (2.36521D + 138 r 128 4. .40000D+01 5.

0 1. we obtain.14000D+02 2.86380D+276 . When a root.85303D+15 1. say x ¯i .0 1.00000D+00 1.86380D+276 1.43368D+30 1. has multiplicity ≥ 3. 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 .36521D+138 1.60000D+01 −1.17902D+61 8.35840D+04 2.0 3. Find all the roots of f (x) = x4 − 4x3 − x2 + 16x − 12 = 0 using GRSM.0 −4.07400D+03 3.0 7.84884D+17 3. and both +¯ xi and −¯ xi satisfy f (x) = 0.33406D+08 4.26681D+50 1. 1 1 Following the same development.41822D+34 1.48 Module 1: Roots of Single Equations Now assume that |¯ x1 | > |¯ x2 | = |¯ x3 |.29982D+08 1.84890D+17 1. specifically.21922D+199 ak3 ak4 1. the roots may vary in sign.44000D+02 2.0 4.02398D+99 1.0 1.0 1.0 1. 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. |¯ x2 | = |¯ x3 | (as originally assumed). Then r2 m = r3 m and for large m.59173D+25 1.39008D+122 3.32000D+02 1. Pursuing the example above. Example.80000D+01 1. then |¯ xi | = 3 3 |¯ xi+1 | = |¯ xi+2 |.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. 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.64656D+12 1.07360D+04 4. This indicates that |¯ x2 | has multiplicity 2 and that. (a) Generate Graeffe’s 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. then it follows that |¯ xi | = |¯ xi+1 |.16842D+69 1.36521D+138 1.43184D+06 1. Descartes’s rule of signs may be used to determine the number of positive and negative roots.31778D+07 5. In general. It should be noted that equality of the roots is in terms of magnitude only.41822D+34 3.05000D+02 1.00000D+00 −1. we can show that if ci = bi 2 and ci+1 = bi+1 2 .20000D+01 2. if ci takes on the half-squared relationship with respect to bi . r1 m >> r2 m .96100D+03 1.16842D+69 1.

P. and noting that cos mθ = b1 b2 b3 b4 1 imθ (e + e−imθ ). Applying Descartes’s rule of signs confirms that there are three positive roots and one negative root.02398D + 99)2 = 3.00000 = r3 2(1.00000 and x ¯4 = 1. 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 . 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 . .00000.86380D + 276 = 1. . For the final derived polynomial g(y) = 0. k fluctuates.17902D + 61)2 = 1. and |¯ x2 | > |R|. Then we can write the last two roots as x ¯3 x ¯4 where R = √ = a + ib = Reiθ = R(cos θ + i sin θ) = a − ib = Re−iθ = R(cos θ − i sin θ) a2 + b2 . In general. From these relations we see that the sign of successive coefficients of aj3 . Quiwa 49 (a71 )2 1 7 2 2 (a2 ) = (1. k will fluctuate because of the cosine term.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.00000. x ¯2 = 2. 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 .39009D + 122 ≈ a81 ⇒ x ¯1 is real and distinct = 12 (8. . its conjugate pair is x ¯4 .39008D + 122) r 256 1. x ¯3 = −2. . This indicates that x ¯3 is a complex root. .00000 s 3.00000 1. if the sign of aji .E. 2.39008D + 122 = 3. . 2.00000.86380D + 276 (c) Find actual roots: substitution into f (x) = 0 yields x ¯1 = 3. . . then x ¯i = a + ib and x ¯i+1 = a − ib for some real a and b. . j = 1.21922D + 199 256 = 2. j = 1.

00000i.00000 − 1. Hence.14560D+04 −5.13599D+96 1.50 Module 1: Roots of Single Equations Example.0 5.58994D+09 1.44473D+21 1.00000.02400D+03 1.34078D+154 4.60000D+02 1.00000.11.0 2.20000D+01 2.20000D+01 −3.31584D + 77 = a71 ⇒ |¯ x1 | = |¯ x2 | ¯3 = a + ib and x ¯4 = a − ib aj3 . . 1.94646D+86 2. To find the complex roots.31104D+05 4.20000D+01 1.0 3.46015D+43 1.0 8.46150D+48 1.09951D+12 1. x ¯3 = 1.28000D+02 1.31584D+77 1.80565D+38 1. or −2 =√−(4 − 4 + a√+ ib + pa − ib).00000 + 1.34078D + 154 128 (c) Find actual roots: substitution into f (x) = 0 yields the real roots x ¯1 = 4.00000i and x ¯4 = 1.80565D + 38)2 = 2.04000D+02 6. j = 1. substitution into 2 2 R = a + b or 2 = (1.00000)2 + b2 yields b = ±1.84467D+19 9. 2.40282D+38 4.0 3.56255D+192 = 12 (6. 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 (Re−iθ )m ≈ r1 2m Rm (eimθ + e−imθ ) = 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 r = = 2. from which we obtain a = 1.41421 = 2 1.29916D+09 1. .40000D+01 3.0 6.31584D + 77 = 4.15792D+77 9.00000.20893D+24 1.04858D+06 1. we use the relation a1 = −(¯ x1 + x ¯2 + x ¯3 + x ¯4 ).00000 = r2 2 r √ 256 4.94661D+173 4.0 −2.0 1.68935D+19 3. Finally.37473D+11 1. .6 Horner’s Rule pn (x) = a0 xn + a1 xn−1 + a2 xn−2 + · · · + an−1 x + an = an + an−1 x + an−2 x2 + · · · + a2 xn−2 + a1 xn−1 + a0 xn = an + x(an−1 + x(an−2 + · · · + 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 ))) . . (a) Generate Graeffe’s 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.16096D+05 1.00000D+00 −1.00000 and x ¯2 = −4. Find all the roots of f (x) = x4 − 2x3 − 14x2 + 32x − 32 = 0 using GRSM.56244D + 192 = 1.

’probably not a root’ end case end for end procedure procedure f(A. n. T (0:n) k←0 m←1 //Normalize original polynomial// temp ← A(0) for i ← 0 to n do B(i) ← A(i)/temp end for output k. m. go to 1] : else : output X(i). B(0 : n) //Perform root-squaring step// switch ← 1 while switch > 0 do k←k+1 for i ← 1 to n do j ←i−1 l←i+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 ←i−1 l←i+1 sign ← −sign end while if |T (i)| > 10150 or |T (i)| < 10−150 then switch ← 0 end for m ← 2ˆk for i ← 1 to n do B(i) ← T (i) end for output k.11. f x. ε) array A(0:n). x) //Evaluates the polynomial f (x) = a0 xn + a1 xn−1 + · · · + an−1 x + an using Horner’s rule// array A(0:n) f ← A(0) for i ← 0 to n do f ← A(i) + x ∗ f end for end procedure 51 . n. P. X(i)) case : |f x| < ε :[output X(i). X(1:n). B(0:n).E. Quiwa 1.7 EASY Implementation procedure GRAEFFE(A. m. x. stop] : X(i) > 0 :[X(i) ← −X(i). 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. f x.0/m) end for //Determine sign and legitimacy of calculated roots// for i ← 1 to n do 1: f x ← f (A.