We calculate the energy density and pressure of a scalar field after its
decoupling from a thermal bath in the spatially flat
Friedman-Lema\^itre-Robertson-Walker space-time, within the framework of
quantum statistical mechanics. By using the density operator determined by the
condition of local thermodynamic equilibrium, we calculate the mean value of
the stress-energy tensor of a real scalar field by subtracting the vacuum
expectation value at the time of the decoupling. The obtained expressions of
energy density and pressure involve corrections with respect to the classical
free-streaming solution of the relativistic Boltzmann equation, which may
become relevant even at long times.Comment: 18 pages, 1 figure; finally published versio