  In this work, we study the entropies of photons, dust (baryonic matter), dark
matter, and dark energy in the context of cosmology. When these components
expand freely with the universe, we calculate the entropy and specific entropy
of each component from the perspective of statistics. Under specific
assumptions and conditions, the entropies of these components can satisfy the
second law of thermodynamics independently. Our calculations show that the
specific entropy of matter cannot be a constant during the expansion of the
universe except for photons. When these components interact with the space-time
background, there could exist the phenomenon of particle production
(annihilation). We study the influence of the interaction on the entropies of
these components, and obtain the conditions guaranteeing that the entropy of
each component satisfies the second law of thermodynamics.
