The shapes that nature uses to describe angular momentum.

Drag to rotate. Pick a harmonic below.

Y₀⁰

Spherical harmonics are the angular part of solutions to Laplace's equation in spherical coordinates. In quantum mechanics, they describe the angular behavior of electron orbitals, gravitational fields, and anything with rotational symmetry.

When you solve the Schrödinger equation for a central potential — like the hydrogen atom — the wave function naturally separates into a radial piece $R(r)$ and an angular piece $Y_l^m(\theta, \phi)$. These angular functions are the spherical harmonics.

They are classified by two quantum numbers: $l$ (the orbital angular momentum, $l = 0, 1, 2, \ldots$) and $m$ (the magnetic quantum number, $-l \le m \le l$). Together, $(l, m)$ define the “shape” of the angular probability distribution.

The Mathematical Definition

A spherical harmonic is defined as:

$$Y_l^m(\theta, \phi) = \sqrt{\frac{(2l+1)}{4\pi}\frac{(l-m)!}{(l+m)!}} \; P_l^m(\cos\theta) \; e^{im\phi}$$

where $P_l^m$ is the associated Legendre function and $e^{im\phi}$ is the azimuthal phase factor. The square root prefactor is a normalization constant that ensures $\int |Y_l^m|^2 \, d\Omega = 1$.

There are two ingredients to unpack: the Legendre functions that handle the polar angle $\theta$, and the complex exponential that handles the azimuthal angle $\phi$. Let's start with Legendre.

Legendre Polynomials $P_l(x)$

The Legendre polynomials $P_l(x)$ are solutions to Legendre's differential equation on the interval $[-1, 1]$. They emerge naturally when separating variables in Laplace's equation. The first few are:

$$P_0(x) = 1 \qquad P_1(x) = x \qquad P_2(x) = \tfrac{1}{2}(3x^2-1) \qquad P_3(x) = \tfrac{1}{2}(5x^3 - 3x)$$

Each $P_l$ has exactly $l$ zeros in the interval $(-1, 1)$, and they oscillate with increasing frequency as $l$ grows. They are orthogonal under integration: $\int_{-1}^{1} P_l(x) P_{l'}(x) \, dx = \frac{2}{2l+1} \delta_{ll'}$.

Explore · Legendre Polynomials $P_l(x)$

But what do these polynomials look like mapped onto a sphere? Since $P_l(\cos\theta)$ depends only on the polar angle $\theta$, we can revolve the polar profile around the $z$-axis. The result is a zonal harmonic — a 3D surface whose radius at each direction equals $|P_l(\cos\theta)|$. Blue lobes are positive, pink are negative:

Explore · Legendre Polynomials in Spherical Coordinates (3D)
P₀(cos θ)

Notice how $P_0$ is a perfect sphere (constant in all directions), $P_1$ produces two lobes (a dipole), $P_2$ gives a quadrupolar shape with a “doughnut” pinch. Each higher $l$ adds another nodal ring where the surface passes through zero.

The key property: Legendre polynomials form a complete orthogonal basis for functions on $[-1, 1]$. Any well-behaved function can be expanded in a Legendre series, analogous to a Fourier series but on the sphere.

Associated Legendre Functions $P_l^m$

The associated Legendre functions generalize $P_l$ by introducing the $m$ parameter. They are defined as:

$$P_l^m(x) = (-1)^m (1-x^2)^{m/2} \frac{d^m}{dx^m} P_l(x)$$

The factor $(1 - x^2)^{m/2} = \sin^m\theta$ ensures these functions vanish at the poles when $m \ne 0$. The derivatives create additional oscillations. For $m = 0$, we recover the ordinary Legendre polynomial: $P_l^0(x) = P_l(x)$.

The first few associated Legendre functions (with $x = \cos\theta$):

$$P_1^1 = -\sin\theta \qquad P_2^1 = -3\sin\theta\cos\theta \qquad P_2^2 = 3\sin^2\theta$$
Explore · Associated Legendre Functions $P_l^m(\cos\theta)$

The 2D plot above shows the function vs $\theta$. To see how these functions actually distribute on a sphere, we revolve $|P_l^m(\cos\theta)|$ around the $z$-axis. As $m$ increases from 0 toward $l$, the lobes compress from the poles toward the equatorial plane:

Explore · Associated Legendre Functions in Spherical Coordinates (3D)
P₂⁰(cos θ)
Zonal vs Sectoral: when $m = 0$, the surface is axially symmetric (zonal). When $m = l$, the lobes concentrate near the equator (sectoral). Intermediate values produce tesseral patterns with both polar and azimuthal nodal structure.

Visualizing Spherical Harmonics in 3D

Now for the main event. Each spherical harmonic $Y_l^m(\theta, \phi)$ defines a function on the surface of a sphere. To visualize it, we plot $|Y_l^m(\theta,\phi)|$ as the radial distance from the origin — the resulting surface shows the angular probability distribution.

The real-valued spherical harmonics (used in chemistry for orbital shapes) are formed by taking linear combinations of $Y_l^m$ and $Y_l^{-m}$:

$$Y_{l}^{m,\text{real}} = \begin{cases} \sqrt{2}\,\text{Re}(Y_l^m) & m > 0 \\ Y_l^0 & m = 0 \\ \sqrt{2}\,\text{Im}(Y_l^{|m|}) & m < 0 \end{cases}$$

Select a harmonic below and drag to rotate the 3D surface. Positive lobes are shown in blue, negative in pink.

Explore · Spherical Harmonics $Y_l^m$

The $l = 0$ Harmonic: Perfect Sphere

The simplest spherical harmonic is $Y_0^0 = \frac{1}{2\sqrt{\pi}}$. It's a constant — the same value in every direction. The 3D plot is a perfect sphere. This corresponds to the $s$-orbital in chemistry: an electron with zero angular momentum has no preferred direction.

The $l = 1$ Harmonics: Dipoles

For $l = 1$ there are three harmonics ($m = -1, 0, +1$). The $m = 0$ case gives:

$$Y_1^0(\theta) = \sqrt{\frac{3}{4\pi}} \cos\theta$$

This is a figure-eight (two lobes) aligned along the $z$-axis — the $p_z$ orbital. The $m = \pm 1$ harmonics give the $p_x$ and $p_y$ orbitals when combined as real-valued harmonics.

The $l = 2$ Harmonics: Quadrupoles

The five $l = 2$ harmonics produce classic shapes: the $d_{z^2}$ orbital (a donut with lobes along $z$), the clover-leaf $d_{xy}$ and $d_{x^2-y^2}$ patterns, and tilted two-lobe shapes for $d_{xz}$ and $d_{yz}$.

$$Y_2^0(\theta) = \sqrt{\frac{5}{16\pi}}(3\cos^2\theta - 1)$$

The $l = 3$ Harmonics: Octupoles

The seven $l = 3$ harmonics produce the $f$-orbital shapes — intricate multi-lobed surfaces that appear in lanthanides and actinides. The $m = 0$ case gives:

$$Y_3^0(\theta) = \sqrt{\frac{7}{16\pi}}(5\cos^3\theta - 3\cos\theta)$$

This creates three pairs of lobes along the $z$-axis. As $|m|$ increases, the lobes rotate and split into more complex patterns. Set the explorer above to $l = 3$ and drag the $m$ slider to see all seven f-orbital shapes morph smoothly between each other.

Associated Legendre Functions in Spherical Coordinates

To see how $P_l^m(\cos\theta)$ behaves on the sphere, we plot the absolute value as a radial distance at each polar angle $\theta$, holding $\phi$ constant. This gives a 2D “polar profile” that reveals the nodal structure.

For $m = 0$, the shapes are axially symmetric (zonal harmonics). For $m = l$, the function concentrates near the equator (sectoral harmonics). For intermediate $m$, the pattern is more complex (tesseral harmonics).

Explore · $P_l^m(\cos\theta)$ in Spherical Coordinates

Orthogonality and Completeness

The spherical harmonics form a complete orthonormal basis on the sphere $S^2$:

$$\int_0^{2\pi}\int_0^{\pi} Y_l^{m*}(\theta,\phi)\, Y_{l'}^{m'}(\theta,\phi)\, \sin\theta \, d\theta \, d\phi = \delta_{ll'} \delta_{mm'}$$

This means any function on the sphere can be expanded as $f(\theta,\phi) = \sum_{l=0}^{\infty}\sum_{m=-l}^{l} c_{lm} Y_l^m(\theta,\phi)$. This is the spherical Fourier expansion — precisely analogous to decomposing a periodic signal into sines and cosines, but on a sphere instead of a line.

The coefficients $c_{lm}$ tell you how much of each “angular mode” is present. Low $l$ captures broad features; high $l$ captures fine angular detail. This is used in cosmology (CMB analysis), computer graphics (environment lighting), and geophysics (Earth's gravitational field).

Connection to Angular Momentum

In quantum mechanics, $Y_l^m$ is an eigenfunction of two operators simultaneously:

$$\hat{L}^2 Y_l^m = \hbar^2 l(l+1)\, Y_l^m \qquad \hat{L}_z Y_l^m = \hbar m \, Y_l^m$$

So $l$ determines the total angular momentum, and $m$ determines its projection along the $z$-axis. The restriction $|m| \le l$ is the quantum statement that a component of angular momentum can never exceed the total.

Physical intuition: when $m = l$ (maximum $z$-projection), the probability distribution concentrates near the equatorial plane — the particle orbits roughly in the $xy$-plane. When $m = 0$, the distribution concentrates near the poles — the orbit is roughly in a plane containing the $z$-axis.

Exercises

1. How many spherical harmonics exist for a given $l$? (Answer in terms of $l$.)

2. For the hydrogen atom, what orbital shape corresponds to $l=1$, $m=0$?

3. What is $Y_0^0(\theta, \phi)$ equal to? (Give the numerical constant as a fraction.)

4. How many nodes (zeros) does $P_3(\cos\theta)$ have in the interval $\theta \in (0, \pi)$?

DeepExplain — built for curiosity