# Source of magnetic dipole potential energy

One of the basic expression that goes without much thinking is the potential energy expression of a magnetic dipole in a magnetic field, $$U = -\mu\cdot B$$

In the case of electric and gravitational field, sources of potential energy, in general, can be realized by the conservative nature of the fields, meaning that these fields are curl free - you do work to change the position of the charge/mass inside the respective fields which are interpreted as a change of potential energy of that charge/mass.

But since magnetic field has non-zero curl, how can such magnetic potential energy be interpreted? And what is the source of that energy since magnetic field does no work? Though magnetic vector potential can be defined for divergence-less field, but it is not related to energy analogous to the general electric potential, is it?

As an example, suppose there is an uniform $$B$$ field along the length of an infinitely long solenoid. Keeping the solenoid's current fixed, I bring a magnetic dipole from infinity inside this field. As a heuristic approach, I have several possible answer withouts explicit mechanism how they can arise the source of magnetic potential energy. I will just state them,

1. The agent does work.

2. The internal e.m.f. produced in the dipole does work (modelling the dipole as an amperian current loop) as the dipole goes through different flux region from zero $$B$$ at infinity to the uniform $$B$$ inside the solenoid. This form of explanation was given in section 8.3 of Griffiths as a source of energy when a dipole is attracted inside a non-uniform $$B$$ field. Is this explanation still valid for this particular case? But what if we extend the width of the solenoid to infinity to make $$B$$ as well as the flux in the amperial loop uniform in all space?

3. The current source who keeps the current fixed in the solenoid does the work.

4. Dipole steals energy from the $$B$$ field around it. As $$B$$ field contains an energy density of $$\frac{B^2}{2\mu_0}$$ in all space, the combined field energy inside the solenoid is less than the case when the dipole wasn't there.

So, what is the exact source of magnetic potential energy of a dipole in a $$B$$ field?

• Only a static magnetic field does no work. A time dependent magnetic field cannot be distinguished from an electric field. Dec 21, 2023 at 11:13

The potential energy associated with the rotation of a dipole in a magetic field is provided by the external torque which is needed to rotate the dipole out of alignment with the field. The formula you cite chooses the reference angle of zero energy at θ = 90 degrees.

• If the dipole exists in a certain orientation prior to turning on the solenoid, then no one is actually causing it to be out of line with field. Then what supplies the energy to align the dipole? Sep 7, 2020 at 4:53
• Potential energy is the ability to do work. In this case the torque produced by the magnetic field will do the work. It takes energy to generate (or bring in) a magnetic field. Sep 7, 2020 at 13:10
• If there is a higher potential energy for disaligned state,does it take more energy to build the current for the disaligned state? What is the physical reason? The induced emf opposing the current is the same both both cases, so where is the extra energy coming from? Mar 30, 2022 at 23:36
• I have revised my answer (above). Apr 2, 2022 at 16:03

But since magnetic field has non-zero curl, how can such magnetic potential energy be interpreted? And what is the source of that energy since magnetic field does no work?

Magnetic field is not, in general, a conservative field (just as electric field isn't), so one cannot always use it to define potential energy of point charge or point magnetic pole of the kind e.g. electrostatic energy of point charge is, as line integral of the field:

$$E_p(\mathbf r) = \int_{\mathbf r_0}^{\mathbf r} \mathbf F_{field}(\mathbf x') \cdot d\mathbf x'.$$

This kind of expression, besides being possibly path-dependent, is obviously inadequate for magnetic moment in magnetic field; it does not take into account the fact that magnetic moment, as opposed to electric particle, has a direction, and energy transfers are associated with change of this direction, even if position of the body in space does not change. For such rotation, the above integral is always zero, but energy transfer in general is not.

But this does not mean one cannot define any kind of potential energy whatsoever for a body with magnetic moment in that field. Potential energy is a more general concept than the one for point charge in electrostatics or point mass in Newtonian gravity.

In general, potential energy is any function $$U$$ of body's configuration parameters (coordinates of its center, orientation angles, or even deformation field) whose change of value due to change of body's configuration correctly accounts for associated energy transfer.

Thus expression $$U = -\boldsymbol{\mu}\cdot \mathbf B_{ext}$$ is potential energy in the sense that when magnetic moment of constant magnitude is rotated or moved in space while under action of static external magnetic field $$\mathbf B_{ext}$$, changes of orientation or position of the body are associated with changes of magnetic energy of the system that are correctly given by changes of $$U$$. "Magnetic energy" here is usually the magnetic part of the standard Poynting energy of EM field in the whole space, and most of it is in and near the body with magnetic moment. But the Poynting energy formula is complicated in the sense it integrates total magnetic field over the whole space, which is affected by the magnetic moment. So the formula asked about is just a much more simple way to express the added energy to magnetic part of the Poynting energy of the field in the whole space, since it explicitly involves only value of external magnetic field at the center of the magnetic moment, not all of its values in the whole space.

There need not be any force doing the work to increase this magnetic energy, it is sufficient that the body with magnetic moment has enough kinetic energy and moves/rotates in such a way that this kinetic energy is transferred into magnetic energy, and thus kinetic energy decreases in time. For example, when magnetic moment points along external field but moves away from the source of it to regions where the field is weaker, kinetic energy is dumped into magnetic energy of the system. Or when the magnetic moment rotates in such a way that it points more and more against the external field, kinetic energy is dumped into the magnetic energy of the system. There is a force doing work here, slowing down translation/rotation of the body, but it is never any individual Lorentz force (as it can't do work).

In case of a current loop moving in external field (and losing kinetic energy), it is the forces of electric charges inside the wire and on the wire surface acting back on the wire lattice (the static non-conducting charges) that do (negative) work on the wire body. The Lorentz magnetic force is an important part of this process, as it enables separation of charges and their mutual interaction, but it is not itself doing any work. However, net macroscopic result of these internal forces is called macroscopic magnetic force, and often expressed by formula $$F=BIL$$. This force does work, but it is not the Lorentz force; it is sometimes called the motor-effect force (since it moves the rotor in electric engines), or the Amperian force, or the Laplace force, and historically it is rather due to Biot-Savart, Laplace and Weber, not Ampere or Lorentz. This force does not act on the microscopic charged particles, but on the macroscopic element of the wire body.