You are on page 1of 13

TABLE OF CONTENTS

Introduction……………………………………………………………………………………1

Newton-Raphson method for real roots and zeros of functions……………….…………1

Newton-Raphson method for complex roots………………………………………………9

Conclusion…………………………………………………………………………………..11

Bibliography…………………………………………………………………………………12
Approximating real and complex roots and zeros of functions
with the Newton Raphson method
INTRODUCTION
When I was younger and in school, we were introduced to irrational numbers I was
amazed. Numbers that never end – suddenly mathematics became more abstract than
ever before. Soon we got used to using approximations of square roots and pi number,
but the disturbing thought stayed – how are these “infinite” numbers approximated?
How does a calculator calculate a square root? As my mathematical skills developed
the question broadened to 𝑛-th roots not only of real numbers but also of complex
numbers.

This is the reason why as a research subject of my work I chose Newton-Raphson


method. This method was firstly proposed by Isaac Newton in 1669, however it differs
from the modern form, because he saw it as purely algebraic and made no mention of
the connection with calculus. In 1690, Joseph Raphson published a much-simplified
description of it, which was also closer to now-used version1.

In general - it approximates non-linear functions to linear functions, by using


differentiation in order to find their zeroes.

In this work I will show how the formula for this method is derived and what are some
of its applications, failures, different mathematical interpretations and connections with
other areas of mathematics.

NEWTON-RAPHSON METHOD FOR REAL ROOTS AND ZEROS OF FUNCTIONS2


Suppose we want to calculate a cube root of some unknown real number 𝐾.
First of all, we have to consider the function 𝑓(𝑥) = 𝑥 3 − 𝐾 for 𝑥 ≥ 0 (see Figure 1.)
and notice its one important property - zero of the function which is:

𝑥3 − 𝐾 = 0

𝑥3 = 𝐾

3
𝑥 = √𝐾

1 en.wikipedia.org. Newton’s method. Retrieved 04 November 2018 from


https://en.wikipedia.org/wiki/Newton%27s_method
2 The process presented was analysed with the help from: numericalmethodsguy. 18 February 2009. Newton

Raphson Method: Derivation (video). Retrieved 02 February 2019 from


https://www.youtube.com/watch?v=nRbsfnUftT4

1
The second step, which determines the accuracy of the solution, is to find the most
possible approximation 𝑎 (which is 𝑥-coordinate of point 𝐴) of the root. It must be done
in the easiest way - simply by guessing or more accurately - by comparison to the two
3 3
numbers which cube roots are known, for example if you want to find √34: √27 <
3 3 3
√34 < √64 ⇒ 3 < √34 < 4

Figure 1. (by author)

Then the last step - consider a tangent to 𝑓(𝑥) at point 𝑥 = 𝑎 and the angle 𝜃.

Figure 2. (by author)

2
𝑏 coordinate of the place where the tangent meets the 𝑥-axis is the sought
approximation of the root.
In order to state the formula for 𝑏 we have to consider the tangent of 𝜃:
𝑓(𝑎) − 0
tan 𝜃 =
𝑎−𝑏
And since the derivative (𝑓 ′ (𝑎)) is defined as the gradient of tangent line (tan 𝜃) to the
function at a point:
𝑓 ′ (𝑎) = tan 𝜃
𝑓(𝑎)
𝑓 ′ (𝑎) =
𝑎−𝑏
Now, we have to transform it to get the general formula for 𝑏:
𝑓(𝑎)
𝑎−𝑏 =
𝑓′(𝑎)
𝑓(𝑎)
𝑏=𝑎− , where 𝑓 ′ (𝑎) ≠ 0
𝑓′(𝑎)

(𝑎 cannot be a stationary point, because tangent at this point would not intersect 𝑥-axis
anywhere and there would not be any approximation – this is one of the failures of this
method)
For the function: 𝑓(𝑥) = 𝑥 3 − 𝐾:
𝑎3 − 𝐾
𝑏=𝑎−
3𝑎2
3
An important thing to notice is that the closer 𝑎 is to √𝐾 the better approximation of
root will be obtained. If 𝑎 is not an approximation good enough of the root then calculate
𝑏 and in further steps treat 𝑏 as 𝑎. Repeat till the result is satisfactory. For example,
3
let’s find √6754 by using rather poor approximations 𝑎1 = 150, 𝑎1 = 40 and better ones
𝑎1 = 15, 𝑎1 = 20 with using the formula above where 𝐾 = 6754

𝑛 𝑎𝑛 𝑏𝑛 𝑎𝑛 𝑏𝑛 𝑎𝑛 𝑏𝑛 𝑎𝑛 𝑏𝑛
1 150 100.1000593 40 28.0737500 15 20.0059259 20 18.96167
2 100.100059 66.95805631 28.07375 21.57236436 20.0059259 18.96228346 18.96167 18.90273
3 66.9580563 45.14085497 21.5723644 19.21933611 18.9622835 18.90273609 18.90273 18.90255
4 45.140855 31.19874548 19.2193361 18.90774097 18.9027361 18.90254811 18.90255 18.90255
5 31.1987455 23.1121099 18.907741 18.90254954 18.9025481 18.90254811
6 23.1121099 19.62271452 18.9025495 18.90254811
7 19.6227145 18.92865535 18.9025481 18.90254811
8 18.9286553 18.9025841
9 18.9025841 18.90254811

3
So, you see that in fact the more accurate a is the less iterations you need to make.
However, even approximation two times bigger than the final result doesn’t lengthen
the process much if you use an easy program such as Microsoft Excel. It is because
of the fast, quadratic convergence of this method (which basically means that the
number of correct decimal places is roughly doubled with each iteration3)

With the general formula for 𝑏 not only can you obtain approximation of any root of a
number that you want but also an approximation of zero of any function. Let’s analyse
four cases:
6
a) number √2345 (so, the function is: 𝑓(𝑥) = 𝑥 6 − 2345)

𝑎6 −2345
here: 𝑏 = 𝑎 −
6𝑎5

For 𝑎1 = 10

𝑛 𝑎𝑛 𝑏𝑛
1 10 8.337242
2 8.337242 6.957404
3 6.957404 5.821811
4 5.821811 4.909948
5 4.909948 4.228588
6 4.228588 3.812901
7 3.812901 3.662386
8 3.662386 3.645147
9 3.645147 3.644941
10 3.644941 3.644941

6
Figure 4. Newton-Raphson method for approximating √2345 (by author)

No matter what real root you want to get because, since every real root can be
considered as zero of a function 𝑓(𝑥) = 𝑥 𝑛 − 𝐾 where 𝑛𝜖ℕ, Newton-Raphson method
will suffice.

3math.stackexchange.com. Proof that Newton Raphson method has quadratic convergence. Retrieved 04
November 2018 from https://math.stackexchange.com/questions/786453/proof-that-newton-raphson-method-has-
quadratic-convergence

4
b) function 𝑔(𝑥) = 7𝑥 3 − √𝑥 3 + 5
7𝑎3 −√𝑎3 +5 7𝑎3 −√𝑎3 +5
here: 𝑏 = 𝑎 − 1 =𝑎− 3𝑎2
1 −
21𝑎2 − (𝑎3 +5) 2 ×3𝑎2 21𝑎2 −
2 2 𝑎3 +5

Where initial approximation of zero of the function is for example 𝑎1 = 2

𝑛 𝑎𝑛 𝑏𝑛
1 2 1.36365
2 1.36365 0.969132
3 0.969132 0.763299
4 0.763299 0.697566
5 0.697566 0.69097
6 0.69097 0.690906
7 0.690906 0.690906

Figure 5. Newton-Raphson
method for approximating zero of
𝑔(𝑥) = 7𝑥 3 − √𝑥 3 + 5 (by
author)

If a function has one zero then you can be sure that whatever initial approximation you
choose you will eventually get the sought number. It is more complex when the function
has 2 or more zeros which will be presented in subsequent examples.

c) function ℎ(𝑥) = (𝑥 − 2)2 − 3

Figure 6. Function
ℎ(𝑥) = (𝑥 − 2)2 − 3

5
It sounds logic to say that this time you cannot choose whatever point you want to
obtain an approximation of the certain zero. This is where good initial approximations
are much desired. Why? If the expression has more than one real root, some starting
points for the iterative algorithm will lead to one of the roots asymptotically, and other
starting points will lead to another4. An area of influence of a zero is called a basin of
attraction. Let me explain it more in depth.
First of all, the easiest step - you need to notice that every 𝑎𝜖] − ∞; 𝐴[ will converge to
the zero 𝐴 and every 𝑎𝜖]𝐵; ∞[ will converge to the zero 𝐵. It is so because in these sets
there are no other zeroes that would “distract” 𝑎 (make it change its convergence).
Bigger problem starts when 𝑎𝜖]𝐴; 𝐵[ - an area between the two zeros, that can
potentially affect the process of approximating.
Then, in case of quadratic function, basins of attraction have rather simple and obvious
ranges. For the points in the interval ] − ∞; 𝐶[ every 𝑎 will converge to the zero 𝐴 and
for the points in the interval ]𝐶; ∞[ every 𝑎 will converge to the zero 𝐵. It is so because
all tangents to the curve to the left from 𝐶 inclines in a way that they intersect 𝑥-axis on
the left side of 𝐴. It is analogical to the right side of 𝐶 for 𝐵. Figure 7. shown below
nicely visualizes it.

Formula used here:


( 𝑎 − 2) 2 − 3
𝑏=𝑎−
2(𝑎 − 2)

Figure 7. Function ℎ(𝑥) = (𝑥 − 2)2 − 3, some of its tangents with basins of attraction (red and blue
rectangles)

4 en.wikipedia.org. Attractor. Retrieved 02 November 2018 from https://en.wikipedia.org/wiki/Attractor

6
For the zero 𝐵 and 𝐴 respectively:
Quadratic function is an intermediate stage
𝑛 𝑎𝑛 𝑏𝑛 𝑎𝑛 𝑏𝑛
1 0 between functions with 1 zero and 3 or
1 3 4
2 4 3.75 0 0.25 more. It is a good example to explain the
3 3.75 3.732143 0.25 0.267857 concept of basins of attraction because
4 3.732143 3.732051 0.267857 0.267949
here, this idea appears in its simplest form
5 3.732051 3.732051 0.267949 0.267949
– basins have shapes of rectangles.

d) and zeroes of 𝑗(𝑥) = 𝑥 3 − 𝑥

Figure 8.
Function 𝑗(𝑥) = 𝑥 3 − 𝑥

When it comes to 𝐴 and 𝐶 the


situation is similar to the one above
– you can simply choose 𝑎1 from
the interval ] − ∞; 𝐴[ to obtain 𝐴 and
from ]𝐶; ∞[ to obtain 𝐶. But what
with 𝐵?

Figure 9. Function 𝑗(𝑥) = 𝑥 3 − 𝑥 and its


basins of attraction5

5Newton’s Method and Basins of Attraction. Retrieved 05 November 2018 from http://www.acme.byu.edu/wp-
content/uploads/2017/01/Vol1B-NewtonsMethod-2017.pdf (edited by author)

7
Here, the situation when 𝑎𝜖]𝐴; 𝐶[ is much more complex than with quadratic function.
As it occurs – basins of attractions for functions of 3rd or higher degrees are not such
easily determined. Very advanced mathematics is used there – too advanced for this
exploration, but interesting when studied deeper, so with great potential to further
investigation. On the Figure 9. I superimposed the basins of attraction for this function
in complex plane on the Cartesian coordinate system so that you can see the whole
result of the mathematical calculations included – a fractal. We are, however,
interested only in one part of it, in that intensive straight line on the 𝑥-axis. It presents
the basins of attraction for the real part of the function (of course only most noticeable
ones, as fractals are never-ending figures). So, you see that in fact, zeroes can have
their influence on seemingly quite unexpected areas.
Newton-Raphson formula for this function is:
𝑎3 − 𝑎
𝑏=𝑎− 2
3𝑎 − 1
I would like to approximate zero 𝐴 and 𝐶 by using the approximations from the two
small basins shown on the Figure 9. to prove you that it is really true.

𝑛 𝑎𝑛 𝑏𝑛 𝑎𝑛 𝑏𝑛
1 -0.49 0.841251 0.49 -0.841251
2 0.841251 1.060192 -0.841251 -1.060192
3 1.060192 1.004766 -1.060192 -1.004766
4 1.004766 1.000034 -1.004766 -1.000034
5 1.000034 1 -1.000034 -1
6 1 1 -1 -1

I was quite astonished to see that simple basins of attraction (e.g. in rectangular
shapes as I imagined that in the beginning) do not exist for functions of 3rd and higher
degrees but they adopt beautiful and mesmerizing shapes. It is also very intriguing to
realize the connection between functions and fractals, especially somewhere where
you definitely would not look for it.

8
NEWTON-RAPHSON METHOD FOR COMPLEX ROOTS
It is in fact very interesting that the Newton-Raphson formula for complex roots can be
obtained in a quite easy way, almost the same as for real roots.
3
Suppose we want to calculate a cube root of some unknown complex number √4 + 𝑖 .
Again, zero of function 𝑓(𝑧) = 𝑧 3 − (4 + 𝑖) is the sought number.

We can use the already known formula:


𝑓(𝑎)
𝑏=𝑎−
𝑓′(𝑎)
But this time 𝑏 and 𝑎 are complex so let’s change it to:
𝑓(𝐴 + 𝑖𝑎)
(𝐵 + 𝑖𝑏) = (𝐴 + 𝑖𝑎) −
𝑓 ′ (𝐴 + 𝑖𝑎)

And then to:

(𝐴 + 𝑖𝑎)3 − (4 + 𝑖)
(𝐵 + 𝑖𝑏) = (𝐴 + 𝑖𝑎) −
3(𝐴 + 𝑖𝑎)2

(𝐴3 + 3𝐴2 𝑖𝑎 − 3𝐴𝑎2 − 𝑎3 𝑖) − (4 + 𝑖)


(𝐵 + 𝑖𝑏) = (𝐴 + 𝑖𝑎) −
(3𝐴2 + 6𝐴𝑖𝑎 − 3𝑎2 )

3
A calculator shows only one value of √4 + 𝑖 . However, if we look at the graph of the
function 𝑓(𝑧) = 𝑧 3 − (4 + 𝑖) (Figure 7.) we will see that there are 2 more zeros, as
every nonzero complex number has three distinct cube roots.6
To find each root we use the same method but different initial approximations. Very
important is to find the one that will best suit the searched number (because of the
basins of attraction). Fortunately, values of cube roots of complex numbers will always
be in different quadrants of the complex plane – it assures us that it is relatively easy
to find approximation that lie in a proper basin of attraction. It also helps us know at
least the signs of imaginary and real parts of the solutions, which is enough to state
the initial approximation.

6http://mathworld.wolfram.coml. Cube Root. Retrieved 01 November 2018 from


http://mathworld.wolfram.com/CubeRoot.html

9
Figure 10. Graph of 𝑓(𝑧) = 𝑧 3 − (4 + 𝑖) where black
spaces are zeros of the function1

Let’s start with 𝐴 = 2 and 𝑎 = 2 (which is not the best choice):

𝑛 𝐴𝑛 𝐵𝑛 𝑖𝑎𝑛 𝑖𝑏𝑛
1 2 1.375 2i 1.166667i
2 1.375 1.084578 1.166667i 0.389906i
3 1.084578 1.656832 0.389906i -0.185669i
4 1.656832 1.545803 -0.18567i 0.099347i
5 1.545803 1.599447 0.099347i 0.132879i
6 1.599447 1.598177 0.132879i 0.130801i
7 1.598177 1.596907 0.130801i 0.128723i
8 1.596907 1.598177 0.128723i 0.130801i
9 1.598177 1.598178 0.130801i 0.130798i
10 1.598178 1.598178 0.130798i 0.130797i

A calculator shows very similar solution: 1.598178 + 0.130797𝑖 – it is called "the


principal” cube root. By convention, "the principal” cube root is a complex number with
positive imaginary part7 or the greatest real part8.

To approximate the root in the second quarter we can start with 𝐴 = −2 and 𝑎 = 2
𝑛 𝐴𝑛 𝐵𝑛 𝑖𝑎𝑛 𝑖𝑏𝑛
1 -2 -1.375 2i 1.5i
2 -1.375 -1.024814 1.5i 1.313811i
3 -1.024814 -0.916568 1.313811i 1.312448i
4 -0.916568 -0.912329 1.312448i 1.318656i
5 -0.912329 -0.912363 1.318656i 1.318664i
6 -0.912363 -0.912363 1.318664i 1.318664i

7 http://mathworld.wolfram.coml. Cube Root. Retrieved 01 November 2018 from


http://mathworld.wolfram.com/CubeRoot.html
8 en.wikipedia.org. Cube root. Retrieved 01 November 2018 from https://en.wikipedia.org/wiki/Cube_root

10
To approximate the root in the third quarter we can start with 𝐴 = −2 and 𝑎 = −2
𝑛 𝐴𝑛 𝐵𝑛 𝑖𝑎𝑛 𝑖𝑏𝑛
1 -2 -1.291667 -2i 1.5i
2 -1.291667 -0.995743 1.5i -1.676121i
3 -0.995743 -0.754589 -1.676121i -1.467429i
4 -0.754589 -0.688362 -1.467429i -1.447815i
5 -0.688362 -0.685812 -1.447815i -1.449457i
6 -0.685812 -0.685815 -1.449457i -1.449462i
7 -0.685815 -0.685815 -1.449462i -1.449462i

This example shows that even though complex numbers belong to “non-real world” of
mathematics they are not as distant and unfamiliar as I perceived them for long time.
Because Newton-Raphson method is applicable to both real and complex numbers it
exposes their similarities and therefore demystifies the second type.

CONCLUSION
So, you see how complex the method is. It can be used to as simple problems as
finding the square root of 2, but it does not fail with increasing the level of difficulty. In
fact, focusing on more elaborate issues allows us to look deeper into the roots and
bases of the method and to find out the links between different areas of mathematics.
Of course, the topic is not exhausted here. There are many others aspects of this
method – its failures could be examined more deeply, it could be compared to other
finding-roots methods, bigger emphasis could be put on its applications in complex
calculus and consequently – what fascinated me the most – on its connections with
fractals. I did not expect to find it out so it was a nice surprise. However, I was so
distressed because, unfortunately, I could not comprehend the mathematics behind
the idea of basins of attraction. I hope that in the future, if my skills will be improved, I
will understand this concept. This is one of these moments when you realize the beauty
of mathematics and its complexity, when you notice the amazing things it can create,
things that just wait for you to discover them.

11
BIBLIOGRAPHY

1 en.wikipedia.org. Newton’s method. Retrieved 04 November 2018 from


https://en.wikipedia.org/wiki/Newton%27s_method
2numericalmethodsguy. 18 February 2009. Newton Raphson Method: Derivation
(video). Retrieved 02 February 2019 from
https://www.youtube.com/watch?v=nRbsfnUftT4
3 math.stackexchange.com. Proof that Newton Raphson method has quadratic
convergence. Retrieved 04 November 2018 from
https://math.stackexchange.com/questions/786453/proof-that-newton-raphson-
method-has-quadratic-convergence
4 en.wikipedia.org. Attractor. Retrieved 02 November 2018 from
https://en.wikipedia.org/wiki/Attractor
5 Newton’s Method and Basins of Attraction. Retrieved 05 November 2018 from
http://www.acme.byu.edu/wp-content/uploads/2017/01/Vol1B-NewtonsMethod-
2017.pdf (edited by author)
6 http://mathworld.wolfram.coml. Cube Root. Retrieved 01 November 2018 from
http://mathworld.wolfram.com/CubeRoot.html
7 http://mathworld.wolfram.coml. Cube Root. Retrieved 01 November 2018 from
http://mathworld.wolfram.com/CubeRoot.html
8 en.wikipedia.org. Cube root. Retrieved 01 November 2018 from
https://en.wikipedia.org/wiki/Cube_root

12

You might also like