Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
19: Newton-Raphson
Iteration
Christine Crisp
Newton-Raphson Iteration
It isnt always possible to find iterative formulae of
the type
x n 1 g ( x n )
Newton-Raphson Iteration
Suppose we want to find an approximate solution to
the equation
f ( x) 0
y f ( x)
Newton-Raphson Iteration
y f ( x)
x2
x1
x0
Newton-Raphson Iteration
To carry out the iteration we need to find the points
where the tangents meet the x-axis.
( x 0 , y 0 )x
y0
y f ( x)
x 0 x1
x1
The grad. of the tangent
x0
the change in y
the change in x
y0
dy
at x 0
dx
x 0 x1
Newton-Raphson Iteration
We have dy
y0
and we need to find
.
at x 0
x1
dx
x 0 x1
dy
Using y 0 and
at x 0 in the formula isnt very
dx
convenient, so, since y f ( x ) we have
y0
dy
y0 f ( x0 )
and
at x 0
f / ( x0 )
dx
x 0 x1
Then,
f ( x0 )
/
f ( x0 )
x 0 x1
f ( x0 )
f ( x0 )
Rearranging:
x 0 x1 /
x1 x 0 /
f ( x0 )
f ( x0 )
Newton-Raphson Iteration
So,
x1 x 0
f ( x0 )
f / ( x0 )
x 2 x1
Generalising gives
x n 1 x n
x2 :
f ( x1 )
f / ( x1 )
f ( xn )
f / ( xn )
Newton-Raphson Iteration
e.g. Use the Newton-Raphson method with x 0 2
to find the root of the equation
x3 x 1 0
correct to 4 d.p.
Solution:
Differentiate:
x n 1 x n
f ( x) x 3 x 1
Let
f / ( x) 3 x 2 1
f ( xn )
/
f ( xn )
x n 1 x n
( x n x n 1)
2
( 3 x n 1)
Newton-Raphson Iteration
SUMMARY
To use the Newton-Raphson method to estimate a
root of an equation:
rearrange the equation into the form f ( x ) 0
differentiate f ( x ) to find f / ( x )
substitute f ( x ) and f / ( x ) into the formula
x n 1 x n
f ( xn )
f / ( xn )
x0
Exercise
Newton-Raphson Iteration
x 2x 2 0 ;
x0 1
Newton-Raphson Iteration
(a)
x3 2x2 2 0 ;
x0 1
Solution: Let f ( x ) x 3 2 x 2 2
x n 1 x n
x0 1 ,
f ( x) 3 x 4 x
f ( xn )
f / ( xn )
3
2
( x n 2 x n 2)
x n 1 x n
2
(3 x n 4 x n )
(ANS 3 2ANS 2 2)
ANS
( 3ANS 2 4ANS)
x1 0 857143 , x 2 0 839545 , . . .
x 0 839287 ( 6 d.p. )
Newton-Raphson Iteration
3
x n 1 x n
( x n 2 x n 2)
2
(3 x n 4 x n )
y x 2x 2
At x = 0, there is a
stationary point.
At a stationary point
f / ( x ) 0 so in the
formula we are
dividing by 0.
Newton-Raphson Iteration
2. Use the Newton-Raphson method to estimate one
root of 3 cos x 1 x to 4 d.p. using x 0 2
Solution:
Let
f ( x ) 3 cos x 1 x
f ( x ) 3 sin x 1
( 3 cos x n 1 x n )
x n 1 x n /
x n 1 x n
( 3 sin x n 1)
f ( xn )
( 3 cos ANS 1 ANS )
x n1 ANS
( 3 sin ANS 1)
x 0 2,
Radians!
x1 1 8562, x 2 1 8624
x 1 8624 ( 4 d.p. )
f ( xn )
Newton-Raphson Iteration
The Newton-Raphson method will fail if
f ( x) 0
Newton-Raphson Iteration
y x3 2x2 5x 1
x0
With
x 0 1 9
x 1 576
x 0 187
Newton-Raphson Iteration
Newton-Raphson Iteration
It isnt always possible to find iterative formulae of
the type
x n 1 g ( x n )
Newton-Raphson Iteration
SUMMARY
To use the Newton-Raphson method to estimate a
root of an equation:
rearrange the equation into the form f ( x ) 0
differentiate
f ( x ) to find f / ( x )
substitute f ( x ) and f / ( x ) into the formula
choose a suitable starting value for
x0
Newton-Raphson Iteration
e.g. Use the Newton-Raphson method with x 0 2
to find the root of the equation
x3 x 1 0
correct to 4 d.p.
Solution:
Differentiate:
x n 1 x n
f ( x) x 3 x 1
Let
f / ( x) 3 x 2 1
f ( xn )
/
f ( xn )
x n 1 x n
xn xn 1
2
3 xn 1
Newton-Raphson Iteration
The Newton-Raphson method will fail if
f ( x) 0
Guess:
2.44948979592
f xn
f 2.44948979592
.00000013016
xn 1 xn
Newtons Method:
f xn
Amazingly close to zero!
This is Newtons Method of finding roots. It is an example
of an algorithm (a specific set of computational steps.)
It is sometimes called the Newton-Raphson method
This is a recursive algorithm because a set of steps are
repeated with the previous answer put in the next
repetition. Each repetition is called an iteration.
3
Find where y x x crosses y 1 .
1 x3 x
0
1
xn
1
1.5
0 x3 x 1 f x x3 x 1
f xn
1
.875
f xn
xn 1 xn
f xn
f xn
2
1
1
1.5
2
5.75
.875
1.5
1.3478261
5.75
1.3252004
f x 3x 2 1
1.3252004
1.3252004 1.0020584
Bad guess.
Failure to converge
http://numericalmethods.eng.us
f.edu
24
Advantages
Converges fast (quadratic convergence), if it
converges.
Requires only one guess
http://numericalmethods.eng.us
f.edu
25
Drawbacks
1.
f x x 1 0.512 0
xi 1 xi
3
i
1 0.512
2
3 xi 1
http://numericalmethods.eng.us
f.edu iterations the root converges
more
to the
26
f x x 3 0.03 x 2 2.4 10 6 0
the Newton-Raphson method
reduces to
xi3 0.03 xi2 2.4 10 6
xi 1 xi
3xi2 0.06 xi
http://numericalmethods.eng.us
f.edu
27
28
xi
0
1
2
3
4
5
6
7
8
9
1.0000
0.5
1.75
0.30357
3.1423
1.2529
0.17166
5.7395
2.6955
0.97678
f xi a %
3.00
2.25
5.063
2.092
11.874
3.570
2.029
34.942
9.266
2.954
300.00
128.571
476.47
109.66
150.80
829.88
102.99
112.93
175.96
http://numericalmethods.eng.us
f.edu
29
f(x)
For example
f x sin x 0
0.5
Choose
x0 2.4 7.539822
It will converge to x
instead of
1.5
-2
-0.06307
0.5499
4.461
7.539822
10
-0.5
-1
-1.5
intended
location of root for
http://numericalmethods.eng.us f x sin
30
. x0
f.edu