Newton’s Method and Composition


Newton’s Method and Composition

Hope
Today we're exploring a beautiful algorithm for solving two-dimensional equations. That includes equations with two unknown real numbers, and equations involving one complex number, since a complex number can be represented as a point in two dimensions.

Simon
So this could help find complex roots of a polynomial, and even numerical candidates for things like the zeros of the Riemann zeta function. But the deeper lesson is broader than the algorithm itself: in mathematics, it is extremely useful to define constructs that compose nicely with one another.

Hope
Let's build toward the two-dimensional case by starting in one dimension. Suppose we want to solve f of x equals g of x. Geometrically, we're looking for where the graphs of f and g intersect.

Simon
For example, take f of x equal to x squared and g of x equal to 2. Solving f of x equals g of x means finding the square root of 2. Since 1 squared is less than 2 and 2 squared is greater than 2, a solution must lie between 1 and 2.

Hope
Then we can test the midpoint, 1.5. Its square is 2.25, which is too high, so we narrow our search to the interval from 1 to 1.5. Repeating this process gives the familiar bisection method: evaluate the midpoint, keep the half whose endpoints still bracket the solution, and continue.

Simon
It helps to reframe the problem by defining a difference function, f minus g. Then we're not asking where two functions have equal outputs; we're asking where one function equals zero. In the square-root example, the difference is negative at one endpoint and positive at the other.

Hope
As long as the function changes continuously, with no sudden jumps, a continuous function that is negative at one point and positive at another must equal zero somewhere in between. The bisection algorithm keeps a region whose boundary has opposite signs, repeatedly cutting that region in half.

Simon
The key question is how to generalize that idea to two dimensions. Now the input is a point in a plane, and the output is also a point in a plane. Complex-valued functions are an important example: the input complex number is two-dimensional, and the output complex number is two-dimensional.

Hope
A function with a two-dimensional input and a two-dimensional output would technically need four dimensions to graph directly, so we need other visualizations. One option is to display the input plane and output plane side by side, showing where each input point lands.

Simon
Another option is to attach an arrow to each input point. The arrow represents the corresponding output vector, pointing from the output origin to the output point. If all the arrows have the same length, the picture emphasizes direction rather than magnitude, although a dense collection of arrows can become cluttered.

Hope
The most useful visualization here assigns a color to each output direction. Hue, such as red, yellow, green, or blue around a color wheel, represents direction from the output origin. Brightness represents distance from the origin, although for the algorithm the direction, or hue, is the important part.

Simon
The output origin itself has no direction, so its colors fade to black. To visualize the function, we color each input point according to the color of its output. A stripe of pink in the input plane means those inputs all map somewhere in the pink direction, while black points indicate inputs that map exactly to zero.

Hope
A complete color map already seems to show us the zeros: just look for black dots. But producing that map required evaluating the function at every pixel. Our goal is more efficient: inspect the function at as few points as possible, and ideally have a general rule telling us whether a region contains a zero.

Simon
In one dimension, we inspect the signs on the boundary of an interval, which consists of two endpoints. In two dimensions, the boundary of a region is a loop. Since two-dimensional outputs have directions all around a circle, the natural replacement for asking about positive and negative is asking how the output directions behave along that loop.

Hope
Suppose a loop around an input region produces every possible output direction as you travel around it. That means its colors pass through the whole rainbow. This suggests a tempting hypothesis: perhaps every such region must contain an input whose output is zero.

Simon
There is a good reason that hypothesis feels plausible. Take a tiny loop around an input point. Continuity sends it to a tiny loop around the corresponding output point. If that output point is not zero, a sufficiently tiny loop around it will have nearly one color, not every color. The only output point that can be surrounded by arbitrarily small loops still containing every direction is the origin.

Hope
So we might imitate bisection. Find a region whose boundary shows every color, split the region into two, and continue with a subregion whose boundary still shows every color. Repeating that should produce smaller and smaller loops converging to a zero.

Simon
But this first algorithm fails. A large region can have a boundary that goes through every color, while neither of the two regions formed by splitting it has a boundary that goes through every color. Then the algorithm has nowhere to continue, even though the original region may contain a zero.

Hope
The contrast with one dimension reveals the problem. In one dimension, if two intervals each have endpoints with no sign change, combining them cannot suddenly create a sign change. But in two dimensions, two regions whose individual boundaries do not cover every direction can combine into a larger boundary that does.

Simon
In fact, even a loop whose colors cover the entire rainbow might enclose no zero at all. The issue is not that the tiny-loop reasoning was wrong. The issue is that the property 'does this boundary pass through every color?' does not combine predictably when regions are joined.

Hope
So we need a more precise property. Instead of merely recording which colors appear along a loop, we track how the color changes as we walk around it. Imagine the output direction as an arrow rotating around the output origin.

Simon
If the colors move from red to yellow to green to blue and back toward red, the output is turning clockwise. If they move in the reverse order, it is turning counterclockwise. A path might wind one-fifth of a turn clockwise, and another path might wind another one-fifth; together, their winding is two-fifths.

Hope
We can picture an odometer that increases for clockwise rotation and decreases for counterclockwise rotation. Opposite rotations cancel. If we follow a path and then retrace it backward, the second trip reverses the first, so the total winding is zero.

Simon
For a closed loop, the total winding must be a whole number, because when we return to the starting input, the output is also back at its starting direction. A loop might have winding number three, for example, if the output direction makes three full clockwise turns. It could also be negative if the output turns counterclockwise, or zero if the rotations cancel.

Hope
There is one technical exception: if the function hits zero somewhere along the path, its output has no direction, so the winding number is not defined there. But for a zero-finding algorithm, that is good news—we have already found a zero.

Simon
The important feature is that winding adds when paths are joined. More importantly, winding numbers add properly when regions are joined. When two neighboring regions combine, most boundary paths become part of the outside boundary, while the shared interior paths are traversed in opposite directions and cancel.

Hope
That cancellation is exactly the compositional behavior the first approach lacked. This general idea of oriented boundaries adding and shared boundaries canceling appears throughout mathematics and is often associated with Stokes' theorem, including in multivariable calculus.

Simon
Now return to the earlier troublesome region. Its boundary may have passed through every color, but its total winding was zero: the output first moved partway around the color wheel in one direction, then moved back in the other direction, so the net rotation canceled.

Hope
The corrected rule is to search only regions whose boundary has a nonzero winding number. If we split such a region into two pieces, the winding number of the original boundary equals the sum of the winding numbers of the two new boundaries. Since the sum is nonzero, at least one subregion must also have a nonzero winding number.

Simon
That gives us a reliable algorithm. Start with a region whose boundary has nonzero winding, split it into smaller regions, compute the winding number around each new boundary, and keep exploring any region with nonzero winding. If a boundary path hits a zero directly, stop there because the solution has been found.

Hope
As the selected regions are repeatedly halved, their loops become smaller and smaller. A nonzero winding number means the loop must pass through every direction, and the tiny-loop argument tells us that the point these loops approach must map to zero.

Simon
This is the two-dimensional analogue of bisection. It is also efficient: each round reduces the region by roughly half, while we only evaluate the function along the boundaries of the regions, rather than at all the points in their interiors. In that sense, the work is related to the perimeter of the search space rather than its full area.

Hope
The method solves equations of the form f of x equals g of x in two dimensions by applying the winding-number test to the difference f minus g. Any loop with nonzero winding is guaranteed to contain at least one solution.

Simon
For a complex example, consider the polynomial x to the fifth minus x minus one. Begin with a large region around the origin. Its winding number is five, and splitting the region repeatedly lets the algorithm locate the polynomial's complex zeros.

Hope
A region with winding number zero is not explored further, because the method provides no guarantee that it contains a zero. A rare boundary evaluation may land directly on a zero, in which case the winding calculation is interrupted, but the algorithm has succeeded immediately.

Simon
The winding number five in that example is not accidental. As a complex input travels once around the origin, raising it to the fifth power makes the output travel around the output origin five times. For a polynomial, when the input is sufficiently far from the origin, the leading term dominates the other terms.

Hope
Therefore, a complex polynomial whose leading term is x to the n has winding number n around a sufficiently large loop. Since a nonzero winding number guarantees a zero inside, this gives the fundamental theorem of algebra: every complex polynomial has a zero, under the usual nonconstant-polynomial setting.

Simon
So winding numbers are useful in two ways. Practically, they provide a numerical method for finding complex solutions while sampling only boundaries. Theoretically, they guarantee that solutions exist, as in the fundamental theorem of algebra.

Hope
And the broader mathematical lesson is the real unifying idea. The first property—whether a boundary contains every color—was suggestive but did not compose reliably. Winding number kept more information, and because it adds and shared paths cancel, it works naturally with the operation of combining regions.

Simon
That is why the algorithm succeeds: it is built around a construct whose behavior matches the way the search space is assembled. The same underlying ideas lead into topology and further applications, where properties of boundaries, paths, and winding can reveal information about spaces and functions.

Hope
So from square-root bisection to complex polynomial roots, the progression is: rewrite equations as zeros, replace signs with directions, replace direction coverage with winding, and choose the invariant that composes correctly. That is both a striking algorithm and a broadly useful way to think mathematically.

Ask anything
We've read this whole study set, so questions about it get the best answers.