The simple equation E = mc² is not usually applicable to all these types of mass and energy, except in the special case that the total additive momentum is zero for the system under consideration. In such a case, which is always guaranteed when observing the system from either its center of mass frame or its center of momentum frame, E = mc² is always true for any type of mass and energy that are chosen. Therefore, for example, in the center of mass frame, the total energy of an object or system is equal to its rest mass times c², a useful equality. This is the relationship used for the container of gas in the last example. It is not true in other reference frames where the center of mass is in motion. In these systems or for such an object, its total energy will depend on both its rest (or invariant) mass, and also its (total) momentum.
In inertial reference frames other than the rest frame or center of mass frame, the equation E = mc² remains true if the energy is the relativistic energy and the mass the relativistic mass. It is also correct if the energy is the rest or invariant energy (also the minimum energy), and the mass is the rest mass, or the invariant mass. Though, connection of the total or relativistic energy (Er) with the rest or invariant mass (m0) needs consideration of the system total momentum, in systems and reference frames where the total momentum has a non-zero value. The formula then needed to connect the two different parts of mass and energy, is the extended version of Einstein''s equation, called the relativistic energy-momentum relation.