The results of recent quantum mechanical calculations of cross-sections for
rotational transitions within the vibrational ground state of HD are used
to evaluate the rate of radiative energy loss from gas containing HD, in ad
dition to H, He and H-2. The cooling function for HD (i.e. the rate of cool
ing per HD molecule) is evaluated in steady state on a grid of values of th
e relevant parameters of the gas, namely the gas density and temperature, t
he atomic to molecular hydrogen abundance ratio and the ortho:para-H-2 dens
ity ratio. The corresponding cooling function for H-2, previously computed
by Le Bourlot et al., is slightly revised to take account of transitions in
duced by collisions with ground-state ortho-H-2 (J = 1). The cooling functi
ons and the data required for their calculation are available from http://c
cp7.dur.ac.uk/. We then make a study of the rate of cooling of the primordi
al gas through collisions with H-2 and HD molecules. In this case, radiativ
e transitions induced by the cosmic background radiation field and, in the
case of H-2, collisional transitions induced by H+ ions should additionally
be included.