Applications of Legendre transform to thermodynamics

A system of many particles is modelled by:

Different versions of energy: