Page 36 - Essentials of physical chemistry
P. 36
xxxiv Introduction: Mathematics and Physics Review
NEWTON–RAPHSON ROOT FINDER
A numerical technique that sometimes is useful is the Newton–Raphson root finding method
(Figure I.3). The basic idea is that if the slope of a line=curve y ¼ f (x) is the first derivative
dy dxÞ, maybe one can extrapolate the slope back to where the function crossed y ¼ 0. In order
=
ð
to use this idea, you have to rearrange your equation so that y(x) ¼ 0. Then the key equation is
y(x n )
x nþ1 ¼ x n
dy(x n )
dx
2
Let us try it on a quadratic for which we know the roots: y(x) ¼ x x 6 ¼ (x þ 2)(x 3) ¼ 0
Here we can see the roots are x ¼ 2 and x ¼þ3. Let us try an initial guess of x ¼ 3.5.
2
dy (3:5) 3:5 6
2
y(x) ¼ x x 6 ¼ 0 so ¼ 2x 1 and we have x 1 ¼ 3:5 ¼
dx 2(3:5) 1
2
2:65 (3:0583) 3:0583 6 0:29489889
3:5 ¼ 3:0583 and then x 2 ¼ 3:0583 ¼ 3:0583 ¼
6 2(3:0583) 1 5:1166
3:000664287 leading to
2
(3:00066) 3:00066 6 3:3004356 10 3
¼ 3:000059287:
2(3:00066) 1 5:00132
x 3 ¼ 3:00066 ¼ 3:00066
Is that close enough? Well what if we make an initial guess of x ¼ 2.5?
2
(2:5) 2:5 6 ( 2:25)
¼ 3:0635,
x 1 ¼ 2:5 ¼ 2:5
2(2:5) 1 4
which we know will converge to 3.0.
How about a guess of x ¼ 1?
2
( 1:0) ( 1:0) 6 ( 4)
¼ 2:333333 so we continue to iterate as
2( 1:) 1 ( 3)
x 1 ¼ 1: ¼ 1:
2
( 2:333333) ( 2:333333) 6 (1:777776)
¼ 2:019608
x 1 ¼ 2:333333 ¼ 2:333333
2( 2:333333) 1 ( 5:666666)
and it would seem that the process will converge to 2.0.
The message here is that the Newton–Raphson method will converge but probably to the nearest
root if there is more than one root. Even so, this method is quite valuable for finding roots of
complicated functions. Of course with a programmable calculator, the iteration can be automated
and will converge rapidly!
y
y= f(x)
[x , f(x )]
1 1
(r, 0)
x
O (x , 0)
2
FIGURE I.3 A graphical illustration of the Newton root-finding method, the root is r. (Adapted from Thomas,
G.B., Calculus and Analytic Geometry, Addison-Wesley Publishing Co., Reading, MA, 1953, p. 226.)