# Can someone explain how magnetic potential energy can exist even though the field is non-conservative?

$$U=-B\cdot \mu$$ is defined to be the magnetic potential energy, I saw this in my lecture notes, but we had already talked about the fact that since the work done to move a charge there is path dependant, there can not be a unique potential at a point in a magnetic field. So there is no use in defining a magnetic potential energy.

The only thing I have in my notes is that it shows for a current loop, it has the most potential energy when the magnetic moment is perpendicular to the field, and has 0 potential energy when it is parallel. I can sort of justify this by saying it makes sense that the potential should be a maximum in an orientation where there is the most restoring torque on the loop and minimum where there is none

But what does a potential mean in a non conservative field?

The problem you're having is that your confusing a field's scalar "potential" with potential energy. The concepts are related, but in a particular way. Say I have a vector field $$\mathbf{V}(\mathbf{x})$$. There is a mathematical theorem that I can break this field down into two two parts $$\mathbf{V}(\mathbf{x}) = -\nabla \Phi + \nabla\times\mathbf{A},$$ $$\Phi$$ is something we call $$\mathbf{V}$$'s scalar potential and $$\mathbf{A}$$ is its vector potential.
The connection to potential energy comes in if we can write a force on some particle is of the form $$\mathbf{F} = a \mathbf{V}$$ and $$\mathbf{A} = 0$$, then the potential energy of that particle will be $$U = a\Phi$$.
So, in the case you're dealing with you don't have a force of needed form, so it's not a problem. Granted, we still have the statement, "The magnetic field can do no work," but showing how that works out in the case of a magnetic dipole like this is subtle. In fact, the force and torque on a magnetic dipole are \begin{align} \mathbf{F} & = \left(\mathbf{\mu}\cdot\nabla\right)\mathbf{B} \text{ and} \\ \mathbf{\tau} & = \mathbf{\mu}\times \mathbf{B}. \end{align} I'm less certain here, but I'm pretty sure you'll find that the combination of those two makes it impossible to harvest infinite energy from any static magnetic field.
• The magnetic vector potential is difficult to interpret. See, you recall how we can shift the scalar potential by a constant value and no physics changes? Well, it turns out that's a smaller part of something called a "gauge transform" that makes a large chunk of $\mathbf{A}$ arbitrary. Point being, that's a separate question, not a comment on an answer. May 24, 2019 at 8:49