Nancy Street Network — Polynomials


(as substantive) a mathematical expression consisting of a sum of terms each of which is a product of a constant and one or more variables or indeterminates raised to a non-negative integral power. If there is a single variable, x, then general form is given by

a0xn + a1xn-1 + a2xn-2 + ... + an-1x + an

where the ai are real numbers. [Collins Dictionary of Mathematics (1989) ISBN 0004343476]

Polynomial Plotter

You don't have Java applet support

Java Source (

When I was young I loved composing quadratic equations and plotting them on graph paper. I soon discovered that quadratics were simply subsets of polynomials, and I explored plots of cubics, quadratics, quintics, etc. I was fascinated by the undulations of the curves and how often they crossed the x-axis to have real roots. At that time I didn't fully comprehend complex numbers, so I found it difficult to visualize where the complex roots were or what they meant.

I wondered how changing the coefficients of a polynomial affected the shape of the graph, but without a visualization tool (like a computer) it was practically impossible to explore families of curves for various changing coefficients. I did try plotting multiple polynomials for slightly changing coefficients on a single graph, but it was rather tedious.

Now, almost 30 years later I decided to use the tools at hand and my skills as a professional programmer create a Java Applet that could animate polynomial curves as the coefficients are adjusted. The result is the Java Applet above.

The applet can work with polynomials up to degree 5 (quintic equations). The 6 sliders at the top left adjust the coefficients a to f respectively of the polynomial:

The coefficients can range from -8 to 8 in steps of 1. The Random button generates a polynomial with random coefficients. The Slider to the right of the Random button adjusts the zoom. The Log checkbox makes the y-axis logarithmic, effectively "squashing" the plot vertically. The Contour button generates a contour plot of the absolute value of the polynomial in the complex plane using random colours for contour shading (like this small sample):

The zeros of the polynomial can usually be seen clearly in the contour plot, as in the sample above, which has one real root on the centre x-line and 2 pairs of conjugate complex roots either side of it. The contour plot may take up to a minute to generate on slower computers, as it has to calculate the real and imaginary values of the polynomial at 307,200 (640x480) points.

When I have more time, I will use a Gridbag Layout (in Java talk) in the controls so they are labelled and attractively laid-out.

The following 3D plot by Mathematica shows the Log of the absolute value of a quintic polynomial in the complex plane. You can see where the 5 roots punctuate the surface. The Fundamental Theorem of Algebra states that every polynomial p(z)=0 has a solution in the complex numbers. An extension of the fundamental theorem claims that every nth degree polynomial has n roots. Gauss and D'Alembert were the first to prove this in the late 1700s, but their proofs are considered flawed by modern standards and were not patched until 1920.

These kinds of plots are a great help in visualizing the structure of polynomials in the complex plane. However, polynomials are actually 4-dimensional objects, which are impossible to draw. We can collapse one dimension in a convenient manner and generate a plot of the resulting 3D object. The following parametric plot uses the real and imaginary parts of a quintic polynomial p[x+iy] to generate the surface as the values of x and y range from -2 to 2. In this sense, the resulting plot is a kind of slice through the 4D object.

Mathematica program to generate the following image

Copyright © 1999-2014 Greg Keogh | Visitor Book

Last Updated: 02-Jan-2014 15:21 AEST