On-shell Lagrangian of an ideal gas
  In the context of general relativity, both energy and linear momentum
constraints lead to the same equation for the evolution of the speed of free
localized particles with fixed proper mass and structure in a homogeneous and
isotropic Friedmann-Lema\^itre-Robertson-Walker universe. In this paper we
extend this result by considering the dynamics of particles and fluids in the
context of theories of gravity nonminimally coupled to matter. We show that the
equation for the evolution of the linear momentum of the particles may be
obtained irrespective of any prior assumptions regarding the form of the
on-shell Lagrangian of the matter fields. We also find that consistency between
the evolution of the energy and linear momentum of the particles requires that
their volume-averaged on-shell Lagrangian and energy-momentum tensor trace
coincide ($\mathcal L_{\rm on-shell}=T$). We further demonstrate that the same
applies to an ideal gas composed of many such particles. This result implies
that the two most common assumptions in the literature for the on-shell
Lagrangian of a perfect fluid ($\mathcal L_{\rm on-shell}=\mathcal{P}$ and
$\mathcal L_{\rm on-shell}=-\rho$, where $\rho$ and $\mathcal{P}$ are the
proper density and pressure of the fluid, respectively) do not apply to an
ideal gas, except in the case of dust (in which case $T=-\rho$).
