  In the standard model of cosmology, the background evolution of the Universe
can in general be adequately described by general relativity and a uniform and
isotropic metric minimally coupled with a collection of perfect fluids. These
fluids are usually described by their energy-momentum tensor, which can be
derived from the fluid's Lagrangian density. Under general relativity, the
Lagrangian density is only relevant to the extent that it results in the
correct energy-momentum tensor for a specific perfect fluid. This is not the
case in theories that feature a nonminimal coupling (NMC) between the matter
fields and gravity. In such cases, the on-shell Lagrangian density of the
matter fields appears explicitly in the equations of motion, in addition to
their energy-momentum tensor. The determination of the correct on-shell
Lagrangian density for a particular fluid is therefore of paramount importance
in order to provide an accurate description of the corresponding cosmological
implications. In essence, this is the problem tackled in this thesis.
  We have aimed at addressing three key points. We covered some of the results
in the literature regarding the Lagrangian density of cosmic fluids, and
cleared up some misunderstandings regarding the freedom of choice (or lack
thereof) of its on-shell form, both in general relativity and in theories
featuring an NMC. In addition, we derived the correct Lagrangian density for
fluids composed of solitonic particles with fixed rest mass and structure.
Secondly, we studied the thermodynamic behaviour of perfect fluids of this type
in the context of theories featuring an NMC between gravity and the matter
fields. Finally, we used these results to derive novel cosmological constraints
on specific NMC gravity models, using data from cosmic microwave background,
big-bang nucleosynthesis, type Ia supernovae and baryon acoustic oscillations
observations.
