From multiple textbooks I gather
- The first law of thermodynamics: $$dU = \delta Q + \delta W = TdS + \delta W$$
- The definition of the free energy: $$F = U - TS \Rightarrow dF = -SdT + \delta W$$
- The connection between the magnetization and the magnetic fields: $$\vec{B} = \vec{H} + 4\pi\vec{M}$$
- The way authors like to "find" the magnetization of a thermodynamic system: $$\vec{M}(\vec{H}) = -\frac{1}{V}\frac{\partial U}{\partial\vec{H}} = -\frac{1}{V}\frac{\partial F}{\partial\vec{H}}$$
Can (4) be considered as the definition of the magnetization $\vec{M}$, and in turn (3) as the definition of the effective field $\vec{H}$ ? Or is (3) the definition of $\vec{H}$, and (4) can be derived from some electrostatic energy argument? In any case, what is the explicit form of $U(\vec{M})$ ? Is $U$ also a function of $\vec{B}$ or $\vec{H}$ ?