Apparent contradictions in stability conditions for diamagnetic materials I was looking at Herbert B Callen's book on thermodynamics, specially Chapter 8 on the Stability of Thermodynamic systems. In it, he states that for a system to be in a stable thermodynamical equilibrium, the concavity of the entropy function must be concave up (with respect to the extensive variables). After some calculations with the Legendre Transform he reaches the following conclusion:
"In summary, for constant $N$ the thermodynamic potentials (the energy and its Legendre transforms) are convex functions of their extensive variables and concave functions of their intensive variables. [...]"
So far, so good. Then I decided to use this information for the case of a very simple magnetic solid, with isotropic response, and with magnetic field only in one direction, say $z$. Using the SI system, this solid satisfies:
$$
dU=TdS+HdM+ \mu dN
$$
where $U$ is the internal energy, $T$ is the temperature, $S$ is the entropy, $H$ is the magnetic field in the $z$ direction, and $M$ is the total intensity of magnetization in the $z$ direction (which is just the total magnetization multiplied by $\mu_0$). Notice how $H$ and $M$ can take positive and negative values. $\mu$ is the chemical potential and $N$ is the total number of moles.
We can make a Legendre transform similar to the Gibbs free energy to obtain:
$$
dG=-S dT - M dH + \mu dN
$$
Applying the conditions of thermodynamic stability we obtain:
$$
\left(\frac{\partial^2 G}{\partial T^2}\right)_{H,N}= -\left(\frac{\partial S}{\partial T}\right)_{H,N} < 0 
$$
$$
\left(\frac{\partial^2 G}{\partial H^2}\right)_{T,N}= -\left(\frac{\partial M}{\partial H}\right)_{T,N} < 0 
$$
This is because $G$ is a Legendre transform of the energy and $T$ and $H$ are intensive variables.
Now the isothermal susceptibility is defined by:
$$
 \chi_T = \left(\frac{\partial M}{\partial H}\right)_{T,N}
$$
Therefore the stability condition for $H$ implies $\chi_T >0$ which is true for paramagnetic and ferromagnetic materials, but it is not true for diamagnetic materials, which are defined by a negative susceptibility.
So this analysis shows that diamagnetic materials are themodynamicaly unstable, which is an odd result, taking into considerations that a lot of diamagnetic materials look really stable to me.
I tried making sense of it by thinking that the adiabatic susceptibility is the one that can be negative, but using the following relationships:
$$
\frac{C_M}{C_H}= \frac{\chi_S}{\chi_T}
$$
$$
\left(\frac{\partial^2 G}{\partial T^2}\right)_{H,N}< 0  \implies C_H >0
$$
$$
\left(\frac{\partial^2 S}{\partial U^2}\right)_{M,N}< 0 \implies C_M >0
$$
You would still obtain a positive value of the adiabatic susceptibility if the isothermal susceptibility is positive.
A solution that gives the right result is to change the work done to the magnetic system from $HdM$ to $-\hat{H} d\hat{M}$, on the basis that $H$ and $M$ go in different directions; but this step is unnecessary if we already allowed $H$ and $M$ to take positive and negative values. Besides if we define the work by this equation, a negative susceptibility would still imply that a positive change in $\hat{H}$ correspond to a decrease in $\hat{M}$, which in this new convention, is going in the opposite direction; while in a diamagnetic material a positive increase in $\hat{H}$ would generate a positive increase in $\hat{M}$.
My question is: Where is the mistake? Is there something in my deduction that is wrong? Are diamagnetic materials really unstable thermodynamicly speaking? Maybe the conditions of concavity are not generally valid and Callen's deduction is wrong, in that case: What is his extra assumption?
Thank you for reading and your time :)  
 A: Your starting equation $dU=TdS+HdM+\mu dN$ is correct only for para- and ferro-magnetic materials. Instead in general you also have to take into account the vector nature of the magnetic field, that is $$dU=TdS+\textbf{H} \cdot d\textbf{M}+\mu dN.$$
For para- and ferro-magnets (thin and long specimen) $\textbf{H}$ and $\textbf{M}$ are parallel,  $\textbf{H} \uparrow \uparrow \textbf{M}$, but for dia-magnets those fields are anti-parallel $\textbf{H} \uparrow \downarrow \textbf{M}$, therefore for dia-magnetic material (long and thin specimen along with the bias field) we have
$$dU=TdS-HdM+\mu dN$$ where $|\textbf{H}|=H,|\textbf{M}|=M .$ 
Thus thermodynamic stability of the diamagnet follows from the constitutive equation $M=\chi H$ with $\chi <0$ so that $$dU=TdS + \frac{-\chi}{2}d(H^2)+\mu dN$$
A: Thermodynamics involving E & M fields are very complicated. I thought about similar questions when I was working on some homework before, and the more I thought about it, the more confused I got.
This may not be a full explanation but I just want to share my thoughts and hope to find a better answer.
So first of all, how does that "instability" appear intuitively?
Suppose we have some particles in a box, and imagine we see 2 parts of it: the left half and the right half. Intensive quantities like $p$, $T$ should be the same anywhere in the box no matter how small a piece we consider, and extensive quantities like $V$, $S$ of all the particles is the sum of the parts of it.
Now let's see what happens if the stability conditions are violated: 
If $\partial V/\partial p>0$, suppose there's a small fluctuation, the left half has a higher pressure and the right half has a lower one: what happens next is that the left half will continue to expand with increasing $p$ and $V$ and the right half will do the opposite. Apparently this is not a stable system.
And if $\partial S/\partial T<0$, suppose there's a small fluctuation, the left half has a higher T and the right half has a lower one: what happens next is that the left half will transfer heat to the right half since its $T$ is higher, so it's giving $TdS$ so its $S$ will decrease, which means its $T$ will continue to increase and $S$ will continue to decrease, while the other half doing the opposite.
Everything we worked with in the above are properties of the system we can define without any environment, we can take a small part of particles from the big box and tell the $p, V, T, S$ of it while forgetting about the rest of the world. If we introduce fluctuations in the system, we can see how the physical quantities evolve in different parts of the system. But an external field is not a property of the system itself.
Now let's try to do it with $H$ and $M$ like shown in the equation. Suppose there's a small fluctuation... and here comes the problem. With the same analogue we expect it to behave as "one half will continue with increasing $H$ and decreasing $M$ while the other half doing the opposite, and energy continues to transfer from this half to that half, and this shows the instability", which makes perfect sense if we just follow the equation but actually it's totally unphysical. I think the reason is that the external field is not an intensive variable of the system.
If there's no external field, and we cut the box into layers perpendicular to $z$ direction, and we take 2 layers and take $H$ of the other layer as the "external" field for each other and suppose $H$ of both layers are positive, we see that if one layer has $H$ slightly increasing and the other one decreasing, if it's paramagnetic the first layer should have a decrease in $M$ because of the decrease in $H$ of the other layer, and this lowers its own $H$, while the opposite happens in the other layer, resulting in balance; otherwise if it's diamagnetic the first layer should decrease in $|M|$ which again lowers its own $H$, so balance is reached. Things may get weird if one layer has positive $H$ and the other has negative $H$, $|H|$ and $|M|$ of both layers may continue to increase or continue to decrease, but that would be a violation of conservation of energy so it can't happen.
These are my thoughts so far.
A: I agree that Thermodynamics involving E & M fields is complicated. A signal is that no previous answer identifies the real issue.
The crucial point is that in expressions like
$$
dU = T dS +H dM + \mu dN
$$
or
$$
dG = -S dT -M dH + \mu dN,
$$
$U$ and $G$ are not the total internal energy and Gibbs free energy, but only the part depending on the magnetization density of the thermodynamic potentials (see, for instance, Landau&Lifshitz, Electrodynamics of continuous media. In both expressions, a missing term is required to provide the physical variation of energy. It is the differential of the energy of the applied magnetic field in the absence of the sample ( $H dH$ in $dU$ or $-HdH$ in $dG$ ).
The addition of such a term shows that the proper convexity condition requires
$$
1 + \chi_T \geq 0.
$$
Thus accommodating para/ferro-magnets ($\chi_T >0$) and diamagnets
($-1<\chi_T <0$).
