I'm not even sure if it makes sense to view it as a Legendre transform. Or well, it is one, I'm just not sure if it's a good definition.
You get the free energy for 'free' if you use a Lagrange multiplier to maximize entropy while keeping the energy fixed (temperature is the inverse of that Lagrange parameter). In one fell swoop this shows why temperature is a thing and why minimizing the free energy is important.
The Legendre transform just returns the value of the constraint from the minimized function, but at that point why bother?
I do agree that it makes more sense to see the fee energy as a Legendre transform of the entropy, that's kind of what you end up doing if you minimize entropy in this way.
I’ve taken an excellent graduate class in thermodynamics, and I’ve never seen a definition of enthalpy that is both coherent and involves Legendre transforms.
Here’s my definition: the internal energy of the stuff in a box is a useful quantity, and one can call it E. But E is the energy needed to assemble the stuff in the box if you start with an empty box of the appropriate volume. This makes physical sense, and it’s perfectly fine for calculating things related to, say, anything that happens in a vacuum. Or anything that happens in a rigid box.
But we live in a very large atmosphere, we mostly do experiments at constant pressure. If you take a flexible baggy and assemble its contents, you need the energy to make the contents (that’s E) and also some extra energy to displace air to make room for the contents, and the latter part requires extra energy equal to P (the constant atmospheric pressure) times V (the volume of the bag).
So we give E + PV the fancy name “enthalpy”, and it turns out to be useful. Maybe there’s a Legendre transform somewhere, but I’ve never seen any use for it other than to try, poorly, to convince someone of its existence. And it’s genuinely awkward — energy and enthalpy are fairly general physical quantities that one could, in principle, measure, and one already needs to start constraining the system to think of them as functions of anything sensible.
And then the HVAC industry seems to have borrowed the term “enthalpy” to mean, roughly, “temperature and humidity”. And “energy” means “temperature” or maybe “heat” but probably actually means “enthalpy, but only the thermal part and not the chemical part”. You’ll be lucky to find any math at all, let alone a Legendre transformation. Don’t get me started on “pressure”.
My ranting is how most of thermo starts with U(S, V, N) whereas I would prefer with S(U, V, N). Either way the differential reads:
dU = T dS - p dV + mu dN
which, if we follow the standard way, is just saying that
T = (dU/dS)_{V, N}
- p = (dU/dV)_{S, N}
mu = (dU/dN)_{S, V}
where the derivatives are really just partial derivatives so I really should have written them with a curly d. Mathematically enthalpy is the Legendre transform where we eliminate V in favor of p:
H(S, p, N) = (U(S, V, N) + p V)_{V = V*(p)}
where V* extremizes the term in parentheses, i.e.
(dU/dV) (S, V*(p), N) + p = 0
Of course this equation is just the above definition of the pressure at constant V, but now we are meant to solve this equation to find V* as a function of p (and S and N), and then plug that back in to get H as a function of p.
The Legendre transform property ensures that:
(dH/dp)_{S,N} = V*(p)
You should note that taking the derivative of H wrt p would in principle also induce a term proportional to dV* / dp since in the definition of H there is V* which depends on p. But that term cancels out because V* is an extremum! So that is why dH/dp gives just V*(p) which is the inverse function of p(V) that you get from (minus) dU/dV. This is the "inverse of derivatives" property of the Legendre transform mentioned in the original post.
Clearly the enthalpy is the nicer gadget to have if you work at constant pressure since then one of its arguments is simply held constant.
You get the free energy for 'free' if you use a Lagrange multiplier to maximize entropy while keeping the energy fixed (temperature is the inverse of that Lagrange parameter). In one fell swoop this shows why temperature is a thing and why minimizing the free energy is important.
The Legendre transform just returns the value of the constraint from the minimized function, but at that point why bother?
I do agree that it makes more sense to see the fee energy as a Legendre transform of the entropy, that's kind of what you end up doing if you minimize entropy in this way.