Someone asked me recently about Legendre transforms and I realized there is something I didn't understand.
The basic idea of a Legendre transform is to treat a function instead of a mapping from its original ensemble as a mapping from the ensemble of its derivatives.
To do so the function is to be convex (or concave) on the original domain. Why? There is an easy formal demonstration but intuitively it is because if the function is convex (concave) its derivative is strictly increasing (decreasing) hence the (Legendre) transformed function will never give two different mappings for the same value of the derivative. i.e. $f(x) \neq f(y) \,\,\text{for } x = y$ (not a function).
Anyways, Legendre transforms are often used in thermodynamics and mechanics. For example instead of describing the energy as a function of the entropy, for obvious experimentalist reasons one would rather describe it as a function of the temperature. This can be attempted because the temperature is the derivative of the energy wrt. entropy
$$ T = \frac{\partial U}{\partial S}. $$
Now according to what is said above how can one be sure that the energy is a convex (concave) function of the entropy (or the volume)?
I had an idea when talking of Hamiltonian mechanics. As most systems behave close to their equilibrium point the energy can be Taylored expended to the second-order
$$ E(x) = E (x_0) + \underbrace{\nabla E\left(x_0\right)}_{=0} \cdot \left(x - x_0\right) + \frac{1}{2} \left(x - x_0\right)^\top H_f (x_0) \left(x - x_0\right)$$
where $x := (\textbf{x}, \textbf{v})$.
Because the gradient cancels at equilibrium. This function being convex (or concave) if the Hessian is positive (negative) definite.
Can someone generalize the idea behind the fact that in physics one is dealing with convex (concave) functions? One can enter in statistical physics if needed, it's fine for me.