Consider a species in thermal equilibrium, with energy density and pressure depending on temperature and with vanishing chemical potential, as in the supplied thermodynamic relation. Put . The first law of thermodynamics gives
Since ,
The differential is therefore exact:
After fixing the irrelevant additive entropy zero, the entropy density at zero chemical potential is
More precisely the first law leaves an additive constant in ; extensivity fixes that constant for the usual entropy-density normalization. A nonzero chemical potential would instead require , so the stated formula is not a universal identity for a decoupled massive species with conserved particle number.
For a reversible thermodynamic process that is an adiabatic process in a comoving volume, and the cosmological perfect-fluid continuity equation gives . Differentiating the extensive expression explicitly, or using the exact differential above, gives
This is cosmological entropy conservation for the closed equilibrium gas with no entropy-producing energy injection.
For radiation in cosmology, , so . Comparing and yields the coefficient ratio
When all relativistic species share the same temperature and count, the familiar normalizations are and . More generally the energy and entropy effective counts can differ; the common here uses the assumptions stated in the question.