Laplace displays solutions of Laplace’s equation in three dimensions, sampled on the surface of a sphere. The intensity of each colour cycles between two randomly oriented spherical harmonics — functions whose angular dependence has a simple pattern of regularly spaced peaks and troughs.

**Click on the applet** to pause or redraw.

Spherical harmonics can sometimes seem a bit unwieldy to work with. Many physics students first encounter them in the context of solving Schrödinger’s equation for the hydrogen atom, where they describe the shape of wave functions with different amounts of angular momentum.

But they also arise as part of the answer to a much simpler question:

Which polynomialsPinx,yandzsolve Laplace’s equation in three dimensions?

That is, if you take the second derivatives of *P* with respect to each of the three variables *x*, *y* and *z* in turn, and add them all together, you get zero.

We can simplify this question by considering **homogeneous polynomials**: those where the total degree of all the variables in each
term are identical, such as *x*^{2} *y* + *z*^{3}, which is homogeneous of degree 3. If we had just two
variables to worry about, we could easily write down an example of a homogeneous polynomial of degree *m* that solved Laplace’s equation:

P(x,y) = (x±iy)^{m}

Here *i* is the square root of minus one. The second derivative of *P*(*x*, *y*) with respect to *y* is
exactly the same as that with respect to *x*, except for an overall factor of (±*i*)^{2}=–1. So when they are
added together, they give zero.

It turns out that the step to three dimensions isn’t too hard. We define the function:

R_{n, m}(u,b) = ∂_{u}^{n+m}(u^{2}–b)^{n}

That is, we start with the polynomial (*u*^{2} – *b*)^{n}, and take its derivative with respect to *u* a total of *n*+*m* times. The original polynomial will be of degree 2*n* in *u*, so the final result will be of degree *n*–*m* in *u*. It’s easy to calculate the derivatives of *R* with respect to *u* and *b*:

∂_{u}R_{n, m}(u,b) =R_{n, m+1}(u,b)

∂_{b}R_{n, m}(u,b) = –nR_{n–1, m+1}(u,b)

We then define:

S_{n, m}(x,y,z) =R_{n, |m|}(z,x^{2}+y^{2}+z^{2}) (x±iy)^{|m|}

We allow *n* to be any non-negative integer, and *m* to be any integer from –*n* to *n*, and we adopt the convention that when *m* is negative, we choose the negative sign in (*x* ± *i* *y*).

Starting with the derivatives of *R*, it is not too hard to verify that *S* satisfies Laplace’s equation. It is also not hard to check that it is a homogeneous
polynomial of degree *n*.

How does this connect to spherical harmonics? A *homogeneous* polynomial of degree *n* in *x*, *y* and *z* will scale in a very simple
manner if you multiply all three coordinates by the same number: it will be multiplied by the *n*th power of that number.
And it follows from this property that if you divide such a polynomial by *r*^{n}, where *r*=√(*x*^{2} + *y*^{2} + *z*^{2}), you will end up with a function that, in spherical coordinates, depends only on
the *angular* coordinates, and not on *r*. The simplest definition of the spherical harmonics is that they are the result of taking **homogenous polynomials of degree n in x, y and z that satisfy Laplace’s equation, and dividing them by r^{n}**.