# Correct form of magnetic energy: $H dB$ vs $-B dM$

I found two different expressions for the magnetostatic energy density stored in magnetic materials. Avoiding vectorial notation, these read as:

1. $$dU=H dB$$
2. $$dU=-B dM$$

It appears that the two are incompatible. If I use $$dB=\mu_0 (dH+dM)$$ and substitute into (1), I get

$$dU=\mu_0 H dH + \mu_0 H dM .$$

The first term can be associated to the vacuum energy, but what about the second one? $$\mu_0 H dM$$ is not the same as $$-B dM$$. What am I missing? Which one of the two are correct and under what conditions?

• Almost the answer: physics.stackexchange.com/questions/787202/… Dec 12, 2023 at 21:54
• These are differential expressions, that is, changes of some energy density, not energy density itself. Which is right depends on what your definition of $U$ is. Does $U$ cover all Poynting EM energy, including the contribution that does not depend on the material medium? Or does it cover only that part of it we associate with magnetized material medium, excluding "vacuum energy" that would be present even without the medium? You have to decide which energy you want the $U$ to denote, then proceed to derive what $dU$ looks like. Dec 13, 2023 at 3:40
• The choice of what particular expression to use for the magnetic energy in thermodynamics is still being fought over. Whether to use H or B and/or M is up to the choice of any author. You will be able to find people using any possible combination of these. It is a tremendous mess, and you have to be rather careful when comparing results. Dec 13, 2023 at 4:01

The first expression calculates the total work done on the free current. The free currents are what you usually control experimentally (electromagnet etc.), so intuitively it's the work you'll need to supply to your electromagnet to vary the fields. Recall that Maxwell's equations in matter give: $$\nabla\times H = j_f \\$$ The work on the free currents are: $$\delta W = \int j_f\cdot \delta E d^3x$$ with $$\delta E$$ the electric field (times small increment of time) induced by the variation of the free current: $$\nabla\times \delta E = -\delta B$$ Using integration by parts: $$\delta W = -\int H\cdot \delta B d^3x$$ this is why the corresponding energy density increment is: $$dU = H\cdot dB$$
For the second expression, you can view it as the Legendre transform of: $$dF = MdB$$ The latter expression is work done on the bound currents by the same argument as before using: $$\nabla\times M = j_b$$ It's typically useful in statistical mechanics since you can apply the variational principle on this potential to get the equilibrium magnetisation.
• is the work done on bound currents $MdB$ or $M dH$? Dec 15, 2023 at 11:44
• By the same reasoning, the work done on bound currents is $dF = MdB$. Your work $-BdM$ is the Legendre transform of the former.