$\begingroup$

Whenever I hear "beautiful math", I immediately think fractals. A personal favorite of mine, for some time now, has been the Mandelbrot set.

Take a point on the complex plane: $(x,y) \to x + yi$. If you square this number $(x+yi)^2 = (x^2 - y^2) + 2xyi$, then square the result, and so on to infinity, one of three things will happen. If the magnitude of this complex number (straightline distance from the origin) is less than one, the value will asymptotically trend to zero. If the magnitude is more than one, it will trend to infinity. If the magnitude is exactly one, the value will either be unchanged, or it will move around to various other points that are of magnitude 1. This in itself can be used to draw some visually-interesting graphs. The set of all points for which the function does not diverge to infinity is the S-set, and its shape is the unit circle.

The Mandelbrot set adds a simple variation to the function; instead of just iteratively squaring, the value is squared, then the original value is added. The set of all points for which this function does not diverge is the M-set. Sounds easy, and it is, but the shape we get is, shall we say, more complex:

The shape of the M-set, in fact, has infinite detail given real coefficients of the complex numbers. The above image (and most other images of the Mandelbrot set) are colored, by using the number of iterations of squaring and adding needed to determine that the function diverges from that point (if the magnitude of the value ever exceeds 2 it will definitely diverge) to pick a color from a gradient or other palette (above, from dark blue to white).

Zoom in closer to any point on the edge of the set, and the M-set displays it true beauty:

"Pretty", I hear you say, "but how's it useful?" Well: