The law of "matter" conservation (in the sense of conservation of particles) may be considered as an approximate physical law that holds only in the classical sense before the advent of special relativity and quantum mechanics. Mass is also not generally conserved in open systems, when various forms of energy are allowed into, or out of, the system. However, the law of mass conservation for closed systems, as viewed from their center of momentum inertial frames, continues to hold in modern physics.
An early yet incomplete theory of the conservation of mass was stated by Nasīr al-Dīn al-Tūsī (1201-1274) in the 13th century. He wrote that a body of matter is able to change, but is not able to disappear.
The law of conservation of mass was first clearly formulated by Lavoisier (1743-1794) in 1789, who is often for this reason (see below) referred to as a father of modern chemistry. However, Mikhail Lomonosov (1711-1765) had previously expressed similar ideas in 1748 and proved them in experiments. Others who anticipated the work of Lavoisier include Joseph Black (1728-1799), Henry Cavendish (1731-1810), and Jean Rey (1583-1645).
Historically, the conservation of mass and weight was kept obscure for millennia by the buoyant effect of the Earth's atmosphere on the weight of gases. For example, since a piece of wood weighs less after burning, this seemed to suggest that some of its mass disappears, or is transformed or lost. These effects were not understood until careful experiments in which chemical reactions such as rusting were performed in sealed glass ampules, wherein it was found that the chemical reaction did not change the weight of the sealed container. The vacuum pump also helped to allow the effective weighing of gases using scales.
Once understood, the conservation of mass was of key importance in changing alchemy to modern chemistry. When chemists realized that substances never disappeared from measurement with the scales (once buoyancy had been accounted for), they could for the first time embark on quantitative studies of the transformations of substances. This in turn led to ideas of chemical elements, as well as the idea that all chemical processes and transformations (including both fire and metabolism) are simple reactions between invariant amounts or weights of these elements.
In special relativity, the conservation of mass does not apply if the system is open and energy escapes. However, it does continue to apply to closed systems. In relatitivy the conservation of all types of mass-energy implies the viewpoint of a single observer (or in the view from a single inertial frame) since changing inertial frames may result in a change of the total energy (relativistic energy) for systems.
However, for the special type of mass called invariant mass, changing the inertial frame of observation for the whole system has no effect on the measure of invariant mass, which remains conservered even for different observers who view the entire system. The conservation of mass may be cast in terms of the conservation of a system combination of energy and momentum, which is conserved, and which gives the same invariant mass of any system (such as the two-photon system) for any observer. In another example, the conservation of mass also applies to particles created by pair production, where energy for new particles may come from kinetic energy of other particles, or from a photon as part of a system. Again, the invariant mass of closed systems does not change when new particles are created.
However, the principle that the mass of a system of particles is equal to the sum of their rest masses, even though true in classical physics, is false in special relativity. The reason that rest masses cannot be simply added is that this does not take into account other forms of energy, such as kinetic and potential energy, and massless particles such as photons, all of which affect the mass of systems.
The mass-energy equivalence formula implies that bound systems have a mass less than the sum of their parts, if the binding energy has been allowed to escape the system after the system has been found by converting potential energy into some other kind of active energy, such as kinetic energy of photons. The difference, called a mass defect, is a measure of the binding energy in bound systems — in other words, the energy needed to break the system apart. The greater the mass defect, the larger the binding energy. The binding energy (which itself has mass) must be released (as light or heat) when the parts combine to form the bound system, and this is the reason the mass of the bound system decreases when the energy leaves the system. . The total mass is conserved when the mass of the binding energy that has escaped is taken into account.