  We examine the cosmic evolution of a stellar initial mass function (IMF) in
galaxies that varies with the Jeans mass in the interstellar medium, paying
particular attention to the K-band stellar mass to light ratio (M/L_K) of
present-epoch massive galaxies. We calculate the typical Jeans mass using
high-resolution hydrodynamic simulations coupled with a fully radiative model
for the ISM, which yields a parameterisation of the IMF characteristic mass as
a function of galaxy star formation rate (SFR). We then calculate the star
formation histories of galaxies utilising an equilibrium galaxy growth model
coupled with constraints on the star formation histories set by abundance
matching models. We find that at early times, energetic coupling between dust
and gas drive warm conditions in the ISM, yielding bottom-light/top- heavy IMFs
associated with large ISM Jeans masses for massive star-forming galaxies. Owing
to the remnants of massive stars that formed during the top-heavy phases at
early times, the resultant M/L_K(sigma) in massive galaxies at the present
epoch is increased relative to the non- varying IMF case. At late times, lower
cosmic ray fluxes allow for cooler ISM temperatures in massive galaxies, and
hence newly formed clusters will exhibit bottom-heavy IMFs, further increasing
M/L_K(sigma). Our central result is hence that a given massive galaxy may go
through both top-heavy and bottom-heavy IMF phases during its lifetime, though
the bulk of the stars form during a top-heavy phase. Qualitatively, the
variations in M/L_K(sigma) with galaxy mass are in agreement with observations,
however, our model may not be able to account for bottom-heavy mass functions
as indicated by stellar absorption features.
