# Why does the photon density decrease more than baryon density when the universe expands?

I read that most photons today are from the cosmic background radiation, so the number must have stayed roughly the same since CMB was released. Also, the baryon density has been roughly constant since the first fraction of a second. But why did photons dominate early in the universe, and now they are like 0.001%?

The rate at which energy density dilutes is different. Think of the energy of particles as $E^2=m^2c^4 + p^2c^2$.

We will consider how the energy density of those particles dilutes as the universe expands. Let's write $a$ as the characteristic size of the universe. You may think of a typical volume of universe as a cube of side length $a$ (e.g. the total volume of that characteristic amount of universe is $a^3$).

For a heavy, slow moving particle (e.g. a baryon, sometimes also referred to as dust or cold matter), almost all the energy of these particles can be written as $E\approx mc^2$. (There is a little bit of kinetic energy also, but $mc^2>>pc$, so we may ignore the contribution from kinetic energy for this discussion). As the universe expands, the number density of particles dilutes $\propto a^{-3}$ which means the energy density of these particles dilutes as $\rho =\frac{E}{V}\propto a^{-3}$.

Now let's consider what would happen to a fast-moving particle (like a photon, or some other particle where the $pc>>mc^2$ (which includes the case where $m=0$)). As the universe expands, the number density of photons dilutes as $n \propto a^{-3}$. However, the photon frequency decreases with the expansion $\nu\propto a^{-1}$. Because frequency is proportional to energy, the energy of each particle dilutes with the expansion as $E\propto a^{-1}$. Therefore, the energy density of photons in the universe decreases with time as $\rho = \frac{E}{V} \propto a^{-4}$.