HALLEY'S METHOD FOR SOLVING f(X) = 0
N K Srinivasan Ph D
Introduction You have ,doubtless , heard of Edmond Halley, the astronomer who discovered the comet named after him,'Halley's comet' which visits us every 76 years. Edmond Halley
(1656-1742) was an accomplished
mathematician as well and was a close associate of Isaac Newton, if you can call anyone as "associate" of the lone worker Sir Isaac was. Halley was nine years younger than Newton. He often visited Newton and discussed astronomical problems that he would like to solve ,only to find that Newton had already solved them!..Then Newton would suggest new problems!
For his
astronomical achievements and study with John Flamsteed, Halley became the second "Astronomer -Royal " after Flamsteed and also Director of Greenwich Observatory. This article is about an important math cntribution from
Halley, in the foot steps of Newton.
Solving the equation f(x) = 0 We come across many such equations which cannot be solved easily with a formula or easy factorization. Take for example the simple equation:
f(x) = x2
- 2 = 0
The solution gives the square root of 2, which is an irrational number. We solve them numerically. Several numerical methods exist,for example ,'bisection method' and 'secant method'. In both , we start with two values of x, close to the root and then iterative method or repetitive method, leads to the root ,closer and closer. These are sometimes called 'bracketing methods' in which we bracket the root with two nearby values. These methods are so slow that several iterations are required to reach a value with sufficient accuracy, say ,to four decimal places.
Newt Newton on - Raph Raphso son n meth method od Isaac Newton invented a powerful method using his 'fluxions' or calculus which leads to formula ;but this method
an iterative
converges fast to the root [if
it does] in a few iterations. The iterative formula is as follows: xn+1
=
X
n
- f(x)/f(x')
-------------(1)
[We shall derive this formula shortly.] Let us apply this to the equation : x 2 - 2 = 0 f(x) = x2 - 2 The first derivative:
f'(x) = 2x
For simplicity, let us write the iterative formula as follows: x' = x - (x 2 -2)/ 2x Simplifying , we get the simple formula for finding square roots: x' = (1/2) [ x + 2/x] Let us work out this with initial value of x = 1.
First iteration:
x' = (1/2) [ 1+2 1+2 ] = 1.5
Second iteration: x' = (1/2) [1.5 + 2/1.5]
x' = (1/2) [2.8333] = 1.416665 Third iteration: x' = (1/2) [1.4166 + 2/1.4166] = (1/2) [1.4166 + 1.41183] = 1.4142155 We shall stop with three iterations; note that we already have the square root of 2 with four decimal accuracy .
Joseph Raphson (1678- 1715) is credited with modifying the Newton formula as we use today. There are several features of this N-R method we must study before we move on to Halley's method: 1 I have mentioned that the formula converges fast to the root, 'if it does'.
Why? because the first
derivative is in the denominator and if it is close to zero, the second term would be large and the value of x' would be far from the root or the root may oscillate between two values away from the root. The caveat is that the initial value or seed should be
close to the root and f'(x) must not be close to zero. 2 The iterative formula is the same as the formula given by Heron of Alexandria for square roots. The root is an arithmatic average of x and N/x where N is the given number. It works in the following manner: if x is an underestimate of the square root, N/x will be an overestimate of the root.So the average is the next best value..you repeat again. 3 N- R method uses the first derivative and constructs the tangent to the curve at the initial value of x; f'(x) is the tangent at that point. We find the point where the tangent cuts the x -axis. 4 Order of convergence: How rapidly we reach the root? The numerical analysts derive an expression for the error in each iteration and find that this method ---N-R method , has the second
order of convergence; in simple terms this means that if we get two decimal place accuracy, we will get 4 decimal place accuracy in the next iteration and 6th decimal place accuracy in the third iteration.
To compare with other methods: bisection may give first order and secant method 1.62 order of convergence.
Taylor series expansion for f(x):
Newton - Raphson method and Halley's method are based on Taylor series expansion for a function f(x) near x = a: f(x) = f(a) + f'(a)/1! [x-a] + f" (a)/ 2! [x-a] 2 + ---where f"(x) is the second derivative. This is an infinite series expansion, developed by Brook Taylor in 1715. Note that if (x-a) is small, only the first two terms are required in most cases of this
series.
We can derive the N-R formula easily as follows: Let a be the initial root: x 0 . Then, taking only the first derivative term in the expansion, f(x) = f(x0) + f'(x0 )[x - x0 ] = 0 rearranging:
x = x0
- f(x0 )/f'(x0 )
This is the N-R iterative formula. Note that the Taylor expansion was not formulated when
Newton and Raphson developed this method.
Edmond Halley further expanded the N-R method using the second term in the Taylor series, including the second derivative of the function: f"(x). His formula , in a convenient form ,is as follows:
x' = x - f(x)/f'(x) [ 1 -
(f(x)f"(x))/ 2 (f'(x)) 2 ] -----------------------(2) (2)
The term in the square bracket can be treated as a 'correction term' for N-R formula for each iteration.This
term includes the second derivative.
Example: Let us apply this to the equation: f(x )= x2 -2 =0 f'(x) = 2x f"(x) = 2 The square bracket term : [ 1 - (x 2 -2)2/8x2 Taking initial root x =1, we get: x' = 1- (-1)/2 [ 1- (-2)/8] -1 =
1 + (1/2) /1.25 = 1 + 0.5/1.25 = 1.4
]-1
-1
The next iteration :
x' = 1.4
- (-0.04)/2.8 [ 1- (-0.04)2/15.68] -1
= 1.4 + 0.014285/ [1.005102] = 1.41392
The calculator value is: sqrt(2) = 1.414213 The error is: 1.414213 -1.41392 = 0.00029 !
Halley's iterative formula for square roots We can can writ write e the the form formul ula a in a comp compac act t form form for for any any number n : x' = (x3
+ 3 n x )/(3x 2
+ n)
-------------(4)
Appl Applyi ying ng this this form formul ula, a,ta taki king ng x = 1.41 1.4139 392, 2, the next iteration gives: x' = ( 2.82666 + 8.48352)/(5.9975+2) = 1.41421442 The error is: -8.5x 10 -7
!!
Order of convergence The order of convergence, the numerical analysts say, is that the order for Halley's method is three. Therefore the additional computation involved in Halley's method
seems justified!.
Halley's method is the fastest iterative method for the prob proble lem: m: f(x) f(x) =0. =0. Note that Halley's formula inherits the limitation of Newton's method that it may not work if f'(x) is close to zero. For both N-R method and Halley's method , we may have to use other root finding methods
like bisection method as
a starter--- to get an initial root close to the actual value. Bisection method ,though slow in convergence rate, is sure to work.
Halley's method for finding cube root We can derive a compact formula for finding the cube root of a number n: f(x) = x3
-n = 0
f'(x) = 3x2
x' = ( x4
+
2nx)/(2x3 +n) --------------- (5)
Example
f(x) = x 3
- 9 = 0
Let the initial value of cube root be 2. x' = ( 24 +2(9)(2))/ (16 +9) = 52/ 25 = 2.08 x' = (18.7177 + 37.44)/(17.9978 + 9) =
56.1577/26.9978
=
2.080084
The calculator gives: x= 2.0800823 The error is : 1.7 x 10 -6 !
N - R meth method od for for cube cube root roots s We can derive the cube root formula as follows: x' = x - (x 3 -n)/3x2 Simpifying, we get:
x' = (1/3)[2x +n/x 2 ]
For x3 -9 =0 and intial root of x = 2; x' = (1/3) [ 4 + 9/4] = 6.25/3 = 2.083 x' = (1/3) [ 4.166 + 9/4.3389] = 2.080086 The error is : 0.000004 !
To sum up:
Halley's method uses second derivative of the function and has third order of convergence. It is much faster that Newton-Raphson method with second order of convergence . [It can be compared to other methods such as Muller meth method od whic which h use use para parabo boli lic c inte interp rpol olat atio ion n and and invo involv lves es lot of computation and has convergence rate of 1.84 .] It is to be emphasized that many text books do not ment mentio ion n Hall Halley ey's 's meth method od at all all at the the pres presen ent t time time. . With With a comp comput uter er prog progra ram, m, Hall Halley ey's 's meth method od can can be easi easily ly implemented and could replace Newton-Raphson method. -----------------------------------------------------