The cosmic star formation rate (CSFR), namely the SFR in a unitary comoving volume of the Universe, is an important clue to investigate the history of the assembly and evolution of galaxies. Here, we develop a method to study the CSFR from a purely theoretical point of view. Starting from detailed models of chemical evolution, which best fit the properties of local galaxies, we obtain the histories of star formation of galaxies of different morphological types (ellipticals, spirals, irregulars). These histories are then used to determine the luminosity functions of the same galaxies by means of a spectrophotometric code. We obtain the CSFR under different hypothesis about galaxy formation scenarios. First, we study the hypothesis of a pure luminosity evolution scenario, in which all galaxies are supposed to form at the same redshift and then evolve only in luminosity without any merging or interaction. Then we consider scenarios in which the number density or the slope of the luminosity functions is assumed to vary with redshift. After comparison of our results with the data available in the literature, we conclude that a pure luminosity evolution does not provide a good fit to the data, especially at very high redshift, although many uncertainties are still present in the data because of the unknown dust corrections and assumed initial mass function. On the other hand, a variation in the number density of ellipticals and spirals as a function of redshift can provide a better fit to the observed CSFR. We critically discuss the possible scenarios for galaxy formation derived from this finding. We also explore cases of variable slope of the luminosity functions with redshift as well as variations of number density and slope at the same time. We cannot find any of those cases which can fit the data as well as solely the number density variation. Finally, we compute the evolution of the average cosmic metallicity in galaxies with redshift and show that in the pure luminosity evolution case the ellipticals dominate the metal production in the Universe, whereas in the case of number density evolution are the spirals the main producers of metals.