For a relativistic equilibrium species with temperature , the entropy density is . In units , bosons have , while fermions have times this expression. Relative to a reference bath temperature , define the effective number of relativistic degrees of freedom for entropy by
The sums here concern relativistic species, or their effective entropy contributions. Since a physical comoving patch has volume proportional to , cosmological entropy conservation gives
for an isolated adiabatic bath. After thermal decoupling in cosmology, one must apply this law separately to sectors that no longer exchange entropy.
Before electron-positron annihilation in cosmology, the electromagnetic bath contains two photon polarizations and four electron/positron spin states. After neutrino decoupling, its entropy degrees of freedom are initially
and after annihilation only the two photon polarizations remain. Electromagnetic entropy conservation therefore gives
The decoupled Cosmic neutrino background receives none of this entropy; its distribution temperature obeys , and before annihilation. Thus
This is the temperature of a decoupled relativistic relic in the instantaneous-decoupling approximation. The ratio remains the same afterwards in the absence of additional photon heating. At late times denotes the redshifted relic distribution temperature even when neutrino masses become relevant; it need not be a kinetic-equilibrium temperature.
After the real scalar decouples at , its temperature redshifts as . The other particles continue sharing entropy. Just before standard-neutrino decoupling their entropy degrees of freedom are
The temperature of a decoupled relativistic relic therefore obeys
A real scalar has one bosonic degree of freedom, whereas one effective neutrino species has energy weight . Hence the contribution of a decoupled real scalar to Neff is
Here counts the other particles still coupled to the thermal bath, as specified in the question.
After thermal decoupling in cosmology, the collisionless relativistic species has . The still-coupled plasma separately conserves entropy, so remains constant. At decoupling , while at late times the coupled plasma contains only the two photon polarizations. Therefore the temperature of a decoupled relativistic relic is
Here is understood as the effective entropy degrees of freedom in the plasma that remains coupled after decouples.