According to http://young.physics.ucsc.edu/112/magnetic.pdf, the free energy $F$ in the presence of a magnetic field is given by \begin{equation} dF = -SdT -MdB, \end{equation} where $M$ is the total magnetic dipole moment of the system and $B$ is the "external magnetic field". Consequently, the magnetic moment can be calculated as \begin{equation} M = \left( \frac{\partial F}{\partial B} \right)_T. \end{equation} I am slightly confused since the author afterwards states that there is a difference between $B$, $B_\text{ext}$ and $\mu_0 H$ and that "from now on" he will just use the symbol $B$. But he used that symbol already from the beginning and only called the field "external", which I find confusing.
So my question: To be 100% rigorous, should these two equations contain $B_\text{ext}$ (by which I understand the flux density of the field measured in vacuum, i.e. with the sample removed)? Are the equations still valid if there are any free currents (in contrast to bound magnetic moments) in the material?
In other words when the susceptibility is small in the context of the reference it does not matter which one, but I note that according HEINE, BYV. "THE THERMODYNAMICS OF BODIES IN STATIC ELECTROMAGNETIC FIELDS" it is possible to transform the equations $$F=\int_{all space} dv\int_0^{\textbf{B}} \textbf{H} \cdot d\textbf{B}$$ $$S=\int_{allspace}dv \int_{0,T=const}^{\textbf{B}} \left(\frac{\partial\textbf{M}}{\partial T}\right)_{\textbf{B}} \cdot d\textbf{B}$$ to $$S=\int_{V}dv \int_{0,T=const}^{\textbf{B}_{ext}} \left(\frac{\partial\textbf{M}}{\partial T}\right)_{\textbf{B}_{ext}} \cdot d\textbf{B}_{ext}$$and $$F=-\frac{1}{2}\int_{V'} dv\int_0^{\textbf{B}_{ext}} \textbf{M}_{ext} \cdot d\textbf{B}_{ext}-\int_{V} dv\int_0^{\textbf{B}_{ext}} \textbf{M} \cdot d\textbf{B}_{ext}$$ and without permanent magnets we have the simpler $$F=-\int_{V} dv\int_0^{\textbf{B}_{ext}} \textbf{M} \cdot d\textbf{B}_{ext}$$ where $V$ is the region of the body.