JavaScript is required to use this site and many others. Consider enabling it.

!header Newton’s Method
!begin-text-block
Newton’s method is a technique to find the roots of a function, commonly taught in beginning calculus courses. Given a function \(f(x)\) and an initial guess \(x_0\) at a root (a value of \(x\) for which \(f(x) = 0\)), we can make a better guess: \(x_1 = x_0 - \frac{f(x_0)}{f'(x_0)}\). If we take \(x_2 = x_1 - \frac{f(x_1)}{f'(x_1)}\), and repeat this recursively to create an \(x_n\) for every positive integer \(n\), then the sequence \((x_n)\) converges (assuming the function and initial guess are somewhat well-behaved) to a root of \(f\).
It turns out that Newton’s method generalizes to polynomials defined over the complex numbers. Just like the Mandelbrot set, this makes it easy to create images. For a function \(f\), we color every point in the plane based on which root of \(f\) that point eventually converges to when chosen as the initial guess. We also give it a brightness based on how long it takes to converge: bright for a short time and dark for a long one.
This applet applies Newton’s method to polynomials only. The white dots represent the roots, so an arrangement of them uniquely determines the (monic) polynomial with those roots. The polynomials \(f(z) = z^n - 1\) have their roots spaced evenly around the point \(0\), and have plots that look particularly nice, so there’s a button to align the roots that way. The algorithm can also be generalized to produce incredible — and wildly chaotic — results. Changing the original formula \(x_{n + 1} = x_n - \frac{f(x_n)}{f'(x_n)}\) to \(x_{n + 1} = x_n - a\frac{f(x_n)}{f'(x_n)} + c\) gives us two new parameters to modify — here, \(a\) and \(c\) are represented by the red and blue dots, respectively. To produce a higher-resolution image that doesn’t have the white dots (and to see the polynomial at work), use the download button below. Finally, to move around and zoom, drag on the scene, and either pinch on a touchscreen or use the scrollwheel on a mouse.
!wilson
!end-text-block

!begin-text-boxes
resolution 500 Resolution
!end-text-boxes
!begin-text-buttons
add-root l Add Root
remove-root l Remove Root
spread-roots l Spread Roots
randomize-roots l Randomize Roots
!end-text-buttons

Root \(a\)

Root \(b\)

!begin-text-buttons
download l Download
!end-text-buttons