2 Finding roots of the equation f ( x ) = 0

A first investigation into the roots of f ( x ) might be graphical. Such an analysis will supply information as to the approximate location of the roots.

Task!

Sketch the function

f ( x ) = x 2 + ln x x > 0

and estimate the value of the root.

No alt text was set. Please request alt text from the person who provided you with this resource.

A simple root is located near 1.5

One method of obtaining a better approximation is to halve the interval 1 x 2 into 1 x 1.5 and 1.5 x 2 and test the sign of the function at the end-points of these new regions. We find

x f ( x )
1 < 0
1.5 < 0
2 > 0

so a root must lie between x = 1.5 and x = 2 because the sign of f ( x ) changes between these values and f ( x ) is a continuous curve. We can repeat this procedure and divide the interval ( 1.5 , 2 ) into the two new intervals ( 1.5 , 1.75 ) and ( 1.75 , 2 ) and test again. This time we find

x f ( x )
1.5 < 0
1.75 > 0
2.0 > 0

so a root lies in the interval ( 1.5 , 1.75 ) . It is obvious that proceeding in this way will give a smaller and smaller interval in which the root must lie. But can we do better than this rather laborious bisection procedure? In fact there are many ways to improve this numerical search for the root. In this Section we examine one of the best methods: the Newton-Raphson method.

To derive the method we examine the general characteristics of a curve in the neighbourhood of a simple root. Consider Figure 24 showing a function f ( x ) with a simple root at x = x whose value is required. Initial analysis has indicated that the root is approximately located at x = x 0 . The aim is to provide a better estimate to the location of the root.

Figure 24

No alt text was set. Please request alt text from the person who provided you with this resource.

The basic premise of the Newton-Raphson method is the assumption that the curve in the close neighbourhood of the simple root at x is approximately a straight line. Hence if we draw the tangent to the curve at x 0 , this tangent will intersect the x -axis at a point closer to x than is x 0 : see Figure 25.

Figure 25

No alt text was set. Please request alt text from the person who provided you with this resource.

From the geometry of this diagram we see that

x 1 = x 0 P Q

But from the right-angled triangle P Q R we have

R Q P Q = tan θ = f ( x 0 )

and so P Q = R Q f ( x 0 ) = f ( x 0 ) f ( x 0 ) x 1 = x 0 f ( x 0 ) f ( x 0 )

If f ( x ) has a simple root near x 0 then a closer estimate to the root is x 1 where

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

This formula can be used iteratively to get closer and closer to the root, as summarised in Key Point 5:

Key Point 5

Newton-Raphson Method

If f ( x ) has a simple root near x n then a closer estimate to the root is x n + 1 where

x n + 1 = x n f ( x n ) f ( x n )

This is the Newton-Raphson iterative formula . The iteration is begun with an initial estimate of the root, x 0 , and continued to find x 1 , x 2 , until a suitably accurate estimate of the position of the root is obtained. This is judged by the convergence of x 1 , x 2 , to a fixed value.

Example 4

f ( x ) = x 2 + ln x has a root near x = 1.5 . Use the Newton-Raphson method to obtain a better estimate.

Solution

Here x 0 = 1.5 , f ( 1.5 ) = 0.5 + ln ( 1.5 ) = 0.0945

f ( x ) = 1 + 1 x f ( 1.5 ) = 1 + 1 1.5 = 5 3

Hence using the formula:

x 1 = 1.5 ( 0.0945 ) ( 1.6667 ) = 1.5567

The Newton-Raphson formula can be used again: this time beginning with 1.5567 as our estimate:

x 2 = x 1 f ( x 1 ) f ( x 1 ) = 1.5567 f ( 1.5567 ) f ( 1.5567 ) = 1.5567 { 1.5567 2 + ln ( 1.5567 ) } 1 + 1 1.5567 = 1.5567 { 0.0007 } { 1.6424 } = 1.5571

This is in fact the correct value of the root to 4 d.p., which calculating x 3 would confirm.

Task!

The function f ( x ) = x tan x has a simple root near x = 4.5 . Use one iteration of the Newton-Raphson method to find a more accurate value for the root.

First find d f d x :

d f d x = 1 sec 2 x = tan 2 x

Now use the formula x 1 = x 0 f ( x 0 ) f ( x 0 ) with x 0 = 4.5 to obtain x 1 :

f ( 4.5 ) = 0.1373 , f ( 4.5 ) = 21.5048

x 1 = 4.5 0.1373 21.5048 = 4.4936 .

As the value of x 1 has changed little from x 0 = 4.5 we can expect the root to be 4.49 to 3 d.p.

Task!

Sketch the function f ( x ) = x 3 x + 3 and confirm that there is a simple root between x = 2 and x = 1 . Use x 0 = 2 as an initial estimate to obtain the value to 2 d.p.

First sketch f ( x ) = x 3 x + 3 and identify a root:

No alt text was set. Please request alt text from the person who provided you with this resource.

Clearly a simple root lies between x = 2 and x = 1 .

Now use one iteration of Newton-Raphson to improve the estimate of the root using x 0 = 2 :

f ( x ) = x 3 x + 3 , f ( x ) = 3 x 2 1 x 0 = 2

x 1 = 2 { 8 + 2 + 3 } 11 = 2 + 3 11 = 1.727

Now repeat this process for a second iteration using x 1 = 1.727 :

x 2 = 1.727 { ( 1.727 ) 3 + 1.727 + 3 } { 3 ( 1.727 ) 2 1 } = 1.727 + { ( 0.424 ) } { ( 7.948 ) } = 1.674

Repeat for a third iteration and state the root to 2 d.p.:

x 3 = 1.674 { ( 1.674 ) 3 + 1.674 + 3 } { 3 ( 1.674 ) 2 1 } = 1.674 + { 0.017 } { 7.407 } = 1.672

We conclude the value of the simple root is 1.67 correct to 2 d.p.