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 :)