# Earnshaw's theorem

Earnshaw's theorem states that a collection of point charges cannot be maintained in a stable stationary equilibrium configuration solely by the electrostatic interaction of the charges. This was first proven by British mathematician Samuel Earnshaw in 1842. It is usually cited in reference to magnetic fields, but was first applied to electrostatic field.
Earnshaw's theorem applies to classical inverse-square law forces (electric and gravitational) and also to the magnetic forces of permanent magnets, if the magnets are hard (the magnets do not vary in strength with external fields). Earnshaw's theorem forbids magnetic levitation in many common situations.
If the materials are not hard, Werner Braunbeck's extension shows that materials with relative magnetic permeability greater than one (paramagnetism) are further destabilising, but materials with a permeability less than one (diamagnetic materials) permit stable configurations.

## Explanation
### In electrostatics

Informally, the case of a point charge in an arbitrary static electric field is a simple consequence of Gauss's law. For a particle to be in a stable equilibrium, small perturbations ("pushes") on the particle in any direction should not break the equilibrium; the particle should "fall back" to its previous position. This means that the force field lines around the particle's equilibrium position should all point inward, toward that position. If all of the surrounding field lines point toward the equilibrium point, then the divergence of the field at that point must be negative (i.e. that point acts as a sink). However, Gauss's law says that the divergence of any possible electric force field is zero in free space. In mathematical notation, an electrical force F(r) deriving from a potential U(r) will always be divergenceless (satisfy Laplace's equation):
$\nabla \cdot \mathbf {F} =\nabla \cdot (-\nabla U)=-\nabla ^{2}U=0.$
Therefore, there are no local minima or maxima of the field potential in free space, only saddle points. A stable equilibrium of the particle cannot exist and there must be an instability in some direction. This argument may not be sufficient if all the second derivatives of U are null.
To be completely rigorous, strictly speaking, the existence of a stable point does not require that all neighbouring force vectors point exactly toward the stable point; the force vectors could spiral in toward the stable point, for example. One method for dealing with this invokes the fact that, in addition to the divergence, the curl of any electric field in free space is also zero (in the absence of any magnetic currents).

### In magnetostatics

It is also possible to prove this theorem directly from the force/energy equations for static magnetic dipoles (below). Intuitively, though, it is plausible that if the theorem holds for a single point charge then it would also hold for two opposite point charges connected together. In particular, it would hold in the limit where the distance between the charges is decreased to zero while maintaining the dipole moment – that is, it would hold for an electric dipole. But if the theorem holds for an electric dipole, then it will also hold for a magnetic dipole, since the (static) force/energy equations take the same form for both electric and magnetic dipoles.
As a practical consequence, this theorem also states that there is no possible static configuration of ferromagnets that can stably levitate an object against gravity, even when the magnetic forces are stronger than the gravitational forces.
Earnshaw's theorem has even been proven for the general case of extended bodies, and this is so even if they are flexible and conducting, provided they are not diamagnetic, as diamagnetism constitutes a (small) repulsive force, but no attraction.
There are, however, several exceptions to the rule's assumptions, which allow magnetic levitation.

### In gravitostatics

Earnshaw's theorem applies to static gravitational fields.
Earnshaw's theorem applies in an inertial reference frame. But it is sometimes more natural to work in a rotating reference frame that contains a fictitious centrifugal force that violates the assumptions of Earnshaw's theorem. Points that are stationary in a rotating reference frame (but moving in an inertial frame) can be absolutely stable or absolutely unstable. For example, in the restricted three-body problem, the effective potential from the fictitious centrifugal force allows the Lagrange points L4 and L5 to lie at local maxima of the effective potential field even if there is only negligible mass at those locations. (Even though these Lagrange points lie at local maxima of the potential field rather than local minima, they are still absolutely stable in a certain parameter regime due to the fictitious velocity-dependent Coriolis force, which is not captured by the scalar potential field.)

## Effect on physics

For quite some time, Earnshaw's theorem posed a startling question of why matter is stable and holds together, since much evidence was found that matter was held together electromagnetically despite the proven instability of static charge configurations. Since Earnshaw's theorem only applies to stationary charges, there were attempts to explain stability of atoms using planetary models, such as Nagaoka's Saturnian model (1904) and Rutherford's planetary model (1911), where the point electrons are circling a positive point charge in the center. Yet, the stability of such planetary models was immediately questioned: electrons have nonzero acceleration when moving along a circle, and hence they would radiate the energy via a non-stationary electromagnetic field. Bohr's model of 1913 formally prohibited this radiation without giving an explanation for its absence.
On the other hand, Earnshaw's theorem only applies to point charges, but not to distributed charges. This led J. J. Thomson in 1904 to his plum pudding model, where the negative point charges (electrons, or "plums") are embedded into a distributed positive charge "pudding", where they could be either stationary or moving along circles; this is a configuration which is non-point positive charges (and also non-stationary negative charges), not covered by Earnshaw's theorem. Eventually this led the way to Schrödinger's model of 1926, where the existence of non-radiative states in which the electron is not a point but rather a distributed charge density resolves the above conundrum at a fundamental level: not only there was no contradiction to Earnshaw's theorem, but also the resulting charge density and the current density are stationary, and so is the corresponding electromagnetic field, no longer radiating the energy to infinity. This gave a quantum mechanical explanation of the stability of the atom.
At a more practical level, it can be said that the Pauli exclusion principle and the existence of discrete electron orbitals are responsible for making bulk matter rigid.

## Proofs for magnetic dipoles
### Introduction

While a more general proof may be possible, three specific cases are considered here. The first case is a magnetic dipole of constant magnitude that has a fast (fixed) orientation. The second and third cases are magnetic dipoles where the orientation changes to remain aligned either parallel or antiparallel to the field lines of the external magnetic field. In paramagnetic and diamagnetic materials the dipoles are aligned parallel and antiparallel to the field lines, respectively.

### Background

The proofs considered here are based on the following principles.
The energy U of a magnetic dipole with a magnetic dipole moment M in an external magnetic field B is given by $U=-\mathbf {M} \cdot \mathbf {B} =-(M_{x}B_{x}+M_{y}B_{y}+M_{z}B_{z}).$
The dipole will only be stably levitated at points where the energy has a minimum. The energy can only have a minimum at points where the Laplacian of the energy is greater than zero. That is, where $\nabla ^{2}U={\frac {\partial ^{2}U}{\partial x^{2}}}+{\frac {\partial ^{2}U}{\partial y^{2}}}+{\frac {\partial ^{2}U}{\partial z^{2}}}>0.$
Finally, because both the divergence and the curl of a magnetic field are zero (in the absence of current or a changing electric field), the Laplacians of the individual components of a magnetic field are zero. That is, $\nabla ^{2}B_{x}=\nabla ^{2}B_{y}=\nabla ^{2}B_{z}=0.$
This is proven at the very end of this article as it is central to understanding the overall proof.

### Summary of proofs

For a magnetic dipole of fixed orientation (and constant magnitude) the energy will be given by $U=-\mathbf {M} \cdot \mathbf {B} =-(M_{x}B_{x}+M_{y}B_{y}+M_{z}B_{z}),$ where M$_x$, M$_y$ and M$_z$ are constant. In this case the Laplacian of the energy is always zero, $\nabla ^{2}U=0,$ so the dipole can have neither an energy minimum nor an energy maximum. That is, there is no point in free space where the dipole is either stable in all directions or unstable in all directions.
Magnetic dipoles aligned parallel or antiparallel to an external field with the magnitude of the dipole proportional to the external field will correspond to paramagnetic and diamagnetic materials respectively. In these cases the energy will be given by $U=-\mathbf {M} \cdot \mathbf {B} =-k\mathbf {B} \cdot \mathbf {B} =-k\left(B_{x}^{2}+B_{y}^{2}+B_{z}^{2}\right),$ where k is a constant greater than zero for paramagnetic materials and less than zero for diamagnetic materials.
In this case, it will be shown that $\nabla ^{2}\left(B_{x}^{2}+B_{y}^{2}+B_{z}^{2}\right)\geq 0,$ which, combined with the constant k, shows that paramagnetic materials can have energy maxima but not energy minima and diamagnetic materials can have energy minima but not energy maxima. That is, paramagnetic materials can be unstable in all directions but not stable in all directions and diamagnetic materials can be stable in all directions but not unstable in all directions. Of course, both materials can have saddle points.
Finally, the magnetic dipole of a ferromagnetic material (a permanent magnet) that is aligned parallel or antiparallel to a magnetic field will be given by $\mathbf {M} =k{\mathbf {B} \over |\mathbf {B} |},$
so the energy will be given by $U=-\mathbf {M} \cdot \mathbf {B} =-k{\frac {\mathbf {B} \cdot \mathbf {B} }{|\mathbf {B} |}}=-k{\frac {|\mathbf {B} |^{2}}{|\mathbf {B} |}}=-k\left(B_{x}^{2}+B_{y}^{2}+B_{z}^{2}\right)^{\frac {1}{2}};$
but this is just the square root of the energy for the paramagnetic and diamagnetic case discussed above and, since the square root function is monotonically increasing, any minimum or maximum in the paramagnetic and diamagnetic case will be a minimum or maximum here as well. There are, however, no known configurations of permanent magnets that stably levitate so there may be other reasons not discussed here why it is not possible to maintain permanent magnets in orientations antiparallel to magnetic fields (at least not without rotation—see spin-stabilized magnetic levitation.

### Detailed proofs

Earnshaw's theorem was originally formulated for electrostatics (point charges) to show that there is no stable configuration of a collection of point charges. The proofs presented here for individual dipoles should be generalizable to collections of magnetic dipoles because they are formulated in terms of energy, which is additive. A rigorous treatment of this topic is, however, currently beyond the scope of this article.

### Fixed-orientation magnetic dipole

It will be proven that at all points in free space $\nabla \cdot (\nabla U)=\nabla ^{2}U={\partial ^{2}U \over {\partial x}^{2}}+{\partial ^{2}U \over {\partial y}^{2}}+{\partial ^{2}U \over {\partial z}^{2}}=0.$
The energy U of the magnetic dipole M in the external magnetic field B is given by $U=-\mathbf {M} \cdot \mathbf {B} =-M_{x}B_{x}-M_{y}B_{y}-M_{z}B_{z}.$
The Laplacian will be $\nabla ^{2}U=-{\frac {\partial ^{2}}{{\partial x}^{2}}}\left(M_{x}B_{x}+M_{y}B_{y}+M_{z}B_{z}\right)-{\frac {\partial ^{2}}{{\partial y}^{2}}}\left(M_{x}B_{x}+M_{y}B_{y}+M_{z}B_{z}\right)-{\frac {\partial ^{2}}{{\partial z}^{2}}}\left(M_{x}B_{x}+M_{y}B_{y}+M_{z}B_{z}\right)$
Expanding and rearranging the terms (and noting that the dipole M is constant) we have ${\begin{aligned}\nabla ^{2}U&=-M_{x}\left({\partial ^{2}B_{x} \over {\partial x}^{2}}+{\partial ^{2}B_{x} \over {\partial y}^{2}}+{\partial ^{2}B_{x} \over {\partial z}^{2}}\right)-M_{y}\left({\partial ^{2}B_{y} \over {\partial x}^{2}}+{\partial ^{2}B_{y} \over {\partial y}^{2}}+{\partial ^{2}B_{y} \over {\partial z}^{2}}\right)-M_{z}\left({\partial ^{2}B_{z} \over {\partial x}^{2}}+{\partial ^{2}B_{z} \over {\partial y}^{2}}+{\partial ^{2}B_{z} \over {\partial z}^{2}}\right)\\[3pt]&=-M_{x}\nabla ^{2}B_{x}-M_{y}\nabla ^{2}B_{y}-M_{z}\nabla ^{2}B_{z}\end{aligned}}$
but the Laplacians of the individual components of a magnetic field are zero in free space (not counting electromagnetic radiation) so $\nabla ^{2}U=-M_{x}0-M_{y}0-M_{z}0=0,$
which completes the proof.

### Magnetic dipole aligned with external field lines

The case of a paramagnetic or diamagnetic dipole is considered first. The energy is given by $U=-k|\mathbf {B} |^{2}=-k\left(B_{x}^{2}+B_{y}^{2}+B_{z}^{2}\right).$
Expanding and rearranging terms, ${\begin{aligned}\nabla ^{2}|\mathbf {B} |^{2}&=\nabla ^{2}\left(B_{x}^{2}+B_{y}^{2}+B_{z}^{2}\right)\\&=2\left(|\nabla B_{x}|^{2}+|\nabla B_{y}|^{2}+|\nabla B_{z}|^{2}+B_{x}\nabla ^{2}B_{x}+B_{y}\nabla ^{2}B_{y}+B_{z}\nabla ^{2}B_{z}\right)\end{aligned}}$
but since the Laplacian of each individual component of the magnetic field is zero, $\nabla ^{2}|\mathbf {B} |^{2}=2\left(|\nabla B_{x}|^{2}+|\nabla B_{y}|^{2}+|\nabla B_{z}|^{2}\right);$
and since the square of a magnitude is always positive, $\nabla ^{2}|\mathbf {B} |^{2}\geq 0.$
As discussed above, this means that the Laplacian of the energy of a paramagnetic material can never be positive (no stable levitation) and the Laplacian of the energy of a diamagnetic material can never be negative (no instability in all directions).
Further, because the energy for a dipole of fixed magnitude aligned with the external field will be the square root of the energy above, the same analysis applies.

### Laplacian of individual components of a magnetic field

It is proven here that the Laplacian of each individual component of a magnetic field is zero. This shows the need to invoke the properties of magnetic fields that the divergence of a magnetic field is always zero and the curl of a magnetic field is zero in free space. (That is, in the absence of current or a changing electric field.) See Maxwell's equations for a more detailed discussion of these properties of magnetic fields.
Consider the Laplacian of the x component of the magnetic field ${\begin{aligned}\nabla ^{2}B_{x}&={\frac {\partial ^{2}B_{x}}{\partial x^{2}}}+{\frac {\partial ^{2}B_{x}}{\partial y^{2}}}+{\frac {\partial ^{2}B_{x}}{\partial z^{2}}}\\&={\frac {\partial }{\partial x}}{\frac {\partial B_{x}}{\partial x}}+{\frac {\partial }{\partial y}}{\frac {\partial B_{x}}{\partial y}}+{\frac {\partial }{\partial z}}{\frac {\partial B_{x}}{\partial z}}\end{aligned}}$
Because the curl of B is zero, ${\frac {\partial B_{x}}{\partial y}}={\frac {\partial B_{y}}{\partial x}},$ and ${\frac {\partial B_{x}}{\partial z}}={\frac {\partial B_{z}}{\partial x}},$ so we have $\nabla ^{2}B_{x}={\frac {\partial }{\partial x}}{\frac {\partial B_{x}}{\partial x}}+{\frac {\partial }{\partial y}}{\frac {\partial B_{y}}{\partial x}}+{\frac {\partial }{\partial z}}{\frac {\partial B_{z}}{\partial x}}.$
But since B$_x$ is continuous, the order of differentiation doesn't matter giving $\nabla ^{2}B_{x}={\partial \over \partial x}\left({\partial B_{x} \over \partial x}+{\partial B_{y} \over \partial y}+{\partial B_{z} \over \partial z}\right)={\partial \over \partial x}(\nabla \cdot \mathbf {B} ).$
The divergence of B is zero, $\nabla \cdot \mathbf {B} =0,$ so $\nabla ^{2}B_{x}={\partial \over \partial x}(\nabla \cdot \mathbf {B} )=0.$
The Laplacian of the y component of the magnetic field B$_y$ field and the Laplacian of the z component of the magnetic field B$_z$ can be calculated analogously. Alternatively, one can use the identity $\nabla ^{2}\mathbf {B} =\nabla \left(\nabla \cdot \mathbf {B} \right)-\nabla \times \left(\nabla \times \mathbf {B} \right),$ where both terms in the parentheses vanish.

### Loopholes

Earnshaw's theorem has no exceptions for non-moving permanent ferromagnets. However, Earnshaw's theorem does not necessarily apply to moving ferromagnets, certain electromagnetic systems, pseudo-levitation and diamagnetic materials. These can thus seem to be exceptions, though in fact they exploit the constraints of the theorem.
Spin-stabilized magnetic levitation: Spinning ferromagnets (such as the Levitron) can, while spinning, magnetically levitate using only permanent ferromagnets, the system adding gyroscopic forces. (The spinning ferromagnet is not a "non-moving ferromagnet").
Switching the polarity of an electromagnet or system of electromagnets can levitate a system by continuous expenditure of energy. Maglev trains are one application.
Pseudo-levitation constrains the movement of the magnets usually using some form of a tether or wall. This works because the theorem shows only that there is some direction in which there will be an instability. Limiting movement in that direction allows levitation with fewer than the full 3 dimensions available for movement (note that the theorem is proven for 3 dimensions, not 1D or 2D).
Diamagnetic materials are excepted because they exhibit only repulsion against the magnetic field, whereas the theorem requires materials that have both repulsion and attraction. An example of this is the famous levitating frog (see Diamagnetism).