  The present paper extends our previous theory of the stellar initial mass
function (IMF) by including the time-dependence, and by including the impact of
magnetic field. The predicted mass spectra are similar to the time independent
ones with slightly shallower slopes at large masses and peak locations shifted
toward smaller masses by a factor of a few. Assuming that star-forming clumps
follow Larson type relations, we obtain core mass functions in good agreement
with the observationally derived IMF, in particular when taking into account
the thermodynamics of the gas. The time-dependent theory directly yields an
analytical expression for the star formation rate (SFR) at cloud scales. The
SFR values agree well with the observational determinations of various Galactic
molecular clouds. Furthermore, we show that the SFR does not simply depend
linearly on density, as sometimes claimed in the literature, but depends also
strongly on the clump mass/size, which yields the observed scatter. We stress,
however, that {\it any} SFR theory depends, explicitly or implicitly, on very
uncertain assumptions like clump boundaries or the mass of the most massive
stars that can form in a given clump, making the final determinations uncertain
by a factor of a few. Finally, we derive a fully time-dependent model for the
IMF by considering a clump, or a distribution of clumps accreting at a constant
rate and thus whose physical properties evolve with time. In spite of its
simplicity, this model reproduces reasonably well various features observed in
numerical simulations of converging flows. Based on this general theory, we
present a paradigm for star formation and the IMF.
