Professional Documents
Culture Documents
Newton Fractals: Complex Roots of Polynomials
Newton Fractals: Complex Roots of Polynomials
Introducing Newton Fractals to learners can be a great way to motivate the study of
polynomials, complex numbers and numerical methods like the Newton method.
2 Complex Polynomials
A polynomial of degree n is a function of the form
p(x) = an xn + an−1 xn−1 + · · · + a1 x + a0
where an 6= 0. Quadratics, for example 2x2 + 3x − 2, are polynomials of degree 2. We
can extend this idea to√polynomials with complex coecients and a complex variable
z = x + iy . (Recall i = −1.)
Denition 2.1. A polynomial with complex coecients is a function of the form
p(z) = an z n + an−1 z n−1 + · · · + a1 z + a0
where aj ∈ C, j = 0, 1, . . . , n, and z is a complex variable. If an 6= 0, then n is the
degree of p(z). (The degree is essentially the highest power n of the polynomial.)
1
Example
Below are some examples of polynomials with complex coecients of a complex
variable z :
(a) z 2 + (8 + i)z + 4,
(b) z 16 − 64,
(c) 147,
√
(d) (7 − 8i)z 3 − (4 + 4i)z 2 − 17,
(e) z − 1.
What is the degree of each of these polynomials?
Solution.
(a) The degree of this polynomial is 2, this is a quadratic polynomial.
(b) The degree of this polynomial is 16.
(c) The degree of this polynomial is 0, this is a constant polynomial.
(d) The degree of this polynomial is 3, this is a cubic polynomial.
(e) The degree of this polynomial is 1, this is a quadratic polynomial.
2
Theorem 2.1 (Fundamental Theorem of Algebra). Let p(z) be a polynomial of degree
n ≥ 1. Then p(z) always has a root r ∈ C.
This theorem states that a root always exists for a polynomial of degree greater or equal
to one. The theorem however does not give us a method or algorithm to nd a root.
Applying the Fundamental Theorem of Algebra repeatedly we can obtain the following
result.
Corollary 2.1. Let p(z) be a polynomial of degree n ≥ 1. Then there exists complex
numbers z1 , z2 , . . . , zn ∈ C, such that
p(z) = an (z − z1 )(z − z2 ) · · · (z − zn ).
This corollary tells us that for any polynomial of degree n there are n roots. These root
z1 , z2 , . . . , zn ∈ C are in general complex and therefore may not be real. For example
z 3 − 1 only has one real root z = 1, but Corollary 2.1 guarantees the existence of three
roots in C. Let's investigate this with the following example.
Example
Find the three roots of z 3 − 1.
Solution. We know one root is z1 = 1 therefore, by Corollary 2.1 we can write the
polynomial in the form,
(z − 1)(az 2 + bz + c) = az 3 + (b − a)z 2 + (c − b)z − c = z 3 − 1
equating coecients,
a = 1, b − a = 0, c − b = 0, c = 1,
We can plot the three roots of z 3 − 1 are an Argand Diagram which is a representation
of the complex numbers on a two-dimensional plane where the x-axis refers to the real
part and the y -axis refers to the imaginary part of the complex number z = x+iy denoted
Re{z} = x and Im{z} = y . Below is an illustration of the Complex Plane (Argand
Diagram) where we have identied the locations of the roots of z 3 − 1.
3
Im{z}
1.5i
√
1 3 1i
z2 = − + i
2 2
0.5i
−0.5i
√
1 3
z3 = − − i
2 2 −1i
−1.5i
For polynomials of degree 3 and 4 solutions to the root nding problem can be found in
general but this is too complicated for our purposes (but still worthy of investigation).
For polynomials of degree 5 or higher there is in general no method to acquire the roots
exactly.
So, except for low degrees, root nding of polynomials consists of nding approximations
of the roots using numerical methods. What we mean by numerical method is the an
algorithm that given an initial guess at the root say z0 the method would then give
us a new and improved approximation to the root say z1 , we can then use z1 and the
method will produce a further improvement to our approximation say z2 . One numerical
method which has this feature is called Newton's method and is described by the following
recurrence relation,
f (zn )
zn+1 = zn −
f 0 (zn )
Newton's method uses the function in question f (z) and also it's derivative f 0 (z) to
improve an approximation to the root of f (z). This method is useful in practice because
of it's extremely fast convergence. The distance from the root to each approximation
is roughly squared at each iteration; assuming the distance between the root and the
approximation is less than 1. So, if you start with a reasonably good approximation to
4
the root the Newton method can very quickly provide an excellent approximation to the
root. Let's try the Newton method out with our test polynomial we studied earlier z 3 − 1.
Example
Use Newton's Method to nd an approximation to a root of the polynomial z 3 − 1.
(Experiment with dierent starting values z0 .)
Solution. In this case our function f (z) = z 3 − 1 and we require the derivative
f 0 (z) = 3z 2 , Newton's method can be written,
zn3 − 1
zn+1 = zn − .
3zn2
Since we studied this polynomial earlier we know the roots already, so let's start
with an initial guess of z0 = 2 and see which root the iterative method above
converges to,
z03 − 1 23 − 1
z1 = z0 − =2− = 1.416667,
3z02 3(22 )
z13 − 1
z2 = z1 − = 1.110534,
3z12
z23 − 1
z3 = z2 − = 1.010637,
3z22
z33 − 1
z4 = z3 − = 1.000112,
3z32
z43 − 1
z5 = z4 − = 1.000000,
3z42
5
2.3 Python Programming Newton's Method
step z
0 -1.000000-1.000000j
1 -0.666667-0.833333j
2 -0.508692-0.841100j
3 -0.499330-0.866269j
4 -0.500000-0.866025j
5 -0.500000-0.866025j
As we can see, after 5 iterations (step) the program has obtained an accuracy of 10−6 .
6
3 Newton Fractals
To motivate further investigation into the Newton method, let's ponder over a couple of
questions:
1. Does the Newton method always converge to a root?
2. Does the Newton method always converge to the closest root to the starting value?
To try and answer these questions we could experiment with dierent starting values for
the variable z in the program newton_method.py; which implements the Newton method
on the polynomial z 3 − 1. Doing so we can produce the following table where in the
rst column we have our starting value for the Newton method z0 , in the second column
we indicate which root this starting value is closet to, and in the last column the nal
approximation to the root which meets the tolerance set 10−6
Starting Value (z0 ) Closet root to z0 Final Approximation
0 neither does not converge
0.5 + 0.5i 1 1.000000 − 0.000000i
0.4 + 0.5i 1 −0.500000 + 0.866025i
0.3 + 0.5i 1 1.000000 − 0.866025i
As we can see above, for z0 = 0 the Newton method does not converge at all, this is
3
because in the Newton method, z1 = z0 − z3z 0 −1
2 = 10 , which is undened. Hence, the
0
Newton method will throw an error if z0 = 0 in this case. For the other starting values
the Newton method does converge to a root of z 3 − 1, but as we can see from the table
above it does not always converge to the closet root we start the iterations near.
In order to get a better understanding of how the Newton method behaves for dierent
starting values let's create an image where each point in the image refers to a point in
the complex plane. For the polynomial z 3 − 1 we will colour the starting point z0 in the
complex plane√ red, green√or blue depending on whether the Newton method converges
to 1, − 2 + i 23 or − 21 − i 23 respectively. Doing this we obtain the image below,
1
7
This is image is known as the Newton Fractal for the polynomial z 3 − 1. The image
contains repeated copies of itself at dierent levels of magnitude which is known as self-
similarity, a hallmark of a fractal. But, more than it's beautiful structure, this image also
describes the way in which the Newton method behaves for dierent starting points in
the complex plane.
We can go further. What if we also wanted, in some way, to display on this image how
quickly the Newton method converged? We could do this by adding a shading eect to
the colours such that a brighter point would indicate fast convergence and a darker point
would indicate slow convergence. Including shading we obtain the image below,
This has signicantly improved the image it terms of it's aesthetic value and has also
provided us with information about the rate of convergence to the roots from dierent
points in the complex plane.
Both fractal images were generated using the python program newton_fractal_ver1.py,
which can be downloaded from the Canvas page for this section. You should try to
familiarise yourself with this program and then start constructing your own Newton
fractals. Below are a few of my favourites.
Note the Newton Fractal on the right contains what looks like the Mandelbrot Set!!! I
think this a great place to stop, ponder and enjoy what we have constructed.