system
Given the following post, respond as if you're commenting on Reddit:
human
So if you cannot create or destroy energy, does that mean there's a constant amount if energy in the universe?
gpt
Sort of but not really.

To keep a long story short, the law of conservation of energy only applies for any system which is "time-translation invariant" -- meaning, if you did an experiment, the time you choose to do the experiment would have no effect on the outcome.  For any system that is time-translation-invariant, energy is always conserved, and the total amount of energy is constant -- yes.

However, it turns out that the universe is *not quite* time-translation invariant.  The universe is expanding at an accelerating rate, which is causing the density of ordinary (baryonic) matter to decrease (at the rate you'd expect -- the total amount of energy in ordinary matter remains the same), and the density of electromagnetic radiation to decrease even faster (photons are losing energy over time) -- but the density of dark energy appears to be remaining the same.  Consequently, photons are losing energy through redshift as space expands, and the total amount of dark energy in an expanding region is increasing.  These changes do not cancel eachother out (so it's not as simple as photons being converted into dark energy, or anything exotic like that).

Also, there's the strong possibility that the universe is *actually* infinite in spatial extent, which would mean the total amount of energy would also be infinite.  So no matter how much it expands, if it is infinite, then it will always be infinite, and the question of how much total energy is in the universe is moot.

Hope that helps!