Conservation of energy can be rigorously proven by Noether's theorem as a consequence of continuous time translation symmetry; that is, from the fact that the laws of physics do not change over time.
A consequence of the law of conservation of energy is that a perpetual motion machine of the first kind cannot exist, that is to say, no system without an external energy supply can deliver an unlimited amount of energy to its surroundings. For systems which do not have time translation symmetry, it may not be possible to define conservation of energy. Examples include curved spacetimes in general relativity or time crystals in condensed matter physics.
A consequence of the law of conservation of energy is that a perpetual motion machine of the first kind cannot exist, that is to say, no system without an external energy supply can deliver an unlimited amount of energy to its surroundings. For systems which do not have time translation symmetry, it may not be possible to define conservation of energy. Examples include curved spacetimes in general relativity or time crystals in condensed matter physics.
History
Ancient philosophers as far back as Thales of Miletus c. 550
 BCE had inklings of the conservation of some underlying substance of 
which everything is made. However, there is no particular reason to 
identify this with what we know today as "mass-energy" (for example, 
Thales thought it was water). Empedocles (490–430 BCE) wrote that in this universal system, composed of four roots (earth, air, water, fire), "nothing comes to be or perishes"; instead, these elements suffer continual rearrangement.
In 1605, Simon Stevinus was able to solve a number of problems in statics based on the principle that perpetual motion was impossible.
In 1639, Galileo
 published his analysis of several situations—including the celebrated 
"interrupted pendulum"—which can be described (in modern language) as 
conservatively converting potential energy to kinetic energy and back 
again. Essentially, he pointed out that the height a moving body rises 
is equal to the height from which it falls, and used this observation to
 infer the idea of inertia. The remarkable aspect of this observation is
 that the height to which a moving body ascends on a frictionless 
surface does not depend on the shape of the surface. 
In 1669, Christiaan Huygens
 published his laws of collision. Among the quantities he listed as 
being invariant before and after the collision of bodies were both the 
sum of their linear momentums as well as the sum of their kinetic 
energies. However, the difference between elastic and inelastic 
collision was not understood at the time. This led to the dispute among 
later researchers as to which of these conserved quantities was the more
 fundamental. In his Horologium Oscillatorium,
 he gave a much clearer statement regarding the height of ascent of a 
moving body, and connected this idea with the impossibility of a 
perpetual motion. Huygens' study of the dynamics of pendulum motion was 
based on a single principle: that the center of gravity of a heavy 
object cannot lift itself.
The fact that kinetic energy is scalar, unlike linear momentum 
which is a vector, and hence easier to work with did not escape the 
attention of Gottfried Wilhelm Leibniz. It was Leibniz during 1676–1689 who first attempted a mathematical formulation of the kind of energy which is connected with motion (kinetic energy). Using Huygens' work on collision, Leibniz noticed that in many mechanical systems (of several masses, mi each with velocity vi),
was conserved so long as the masses did not interact. He called this quantity the vis viva or living force of the system. The principle represents an accurate statement of the approximate conservation of kinetic energy in situations where there is no friction. Many physicists at that time, such as Newton,  held that the conservation of momentum, which holds even in systems with friction, as defined by the momentum:
was the conserved vis viva. It was later shown that both quantities are conserved simultaneously, given the proper conditions such as an elastic collision. 
In 1687, Isaac Newton published his Principia,
 which was organized around the concept of force and momentum. However, 
the researchers were quick to recognize that the principles set out in 
the book, while fine for point masses, were not sufficient to tackle the
 motions of rigid and fluid bodies. Some other principles were also 
required. 
The law of conservation of vis viva was championed by the father and son duo, Johann and Daniel Bernoulli. The former enunciated the principle of virtual work as used in statics in its full generality in 1715, while the latter based his Hydrodynamica,
 published in 1738, on this single conservation principle. Daniel's 
study of loss of vis viva of flowing water led him to formulate the Bernoulli's principle,
 which relates the loss to be proportional to the change in hydrodynamic
 pressure. Daniel also formulated the notion of work and efficiency for 
hydraulic machines; and he gave a kinetic theory of gases, and linked 
the kinetic energy of gas molecules with the temperature of the gas.
This focus on the vis viva by the continental physicists 
eventually led to the discovery of stationarity principles governing 
mechanics, such as the D'Alembert's principle, Lagrangian,
and Hamiltonian formulations of mechanics. 
Émilie du Châtelet
 (1706  – 1749) proposed and tested the hypothesis of the conservation 
of total energy, as distinct from momentum. Inspired by the theories of 
Gottfried Leibniz, she repeated and publicized an experiment originally 
devised by Willem 's Gravesande
 in 1722 in which balls were dropped from different heights into a sheet
 of soft clay. Each ball's kinetic energy - as indicated by the quantity
 of material displaced - was shown to be proportional to the square of 
the velocity. The deformation of the clay was found to be directly 
proportional to the height the balls were dropped from, equal to the 
initial potential energy. Earlier workers, including Newton and 
Voltaire, had all believed that "energy" (so far as they understood the 
concept at all) was not distinct from momentum and therefore 
proportional to velocity. According to this understanding, the 
deformation of the clay should have been proportional to the square root
 of the height from which the balls were dropped from. In classical 
physics the correct formula is , where  is the kinetic energy of an object,  its mass and 
 its speed. On this basis, Châtelet proposed that energy must always 
have the same dimensions in any form, which is necessary to be able to 
relate it in different forms (kinetic, potential, heat…).
Engineers such as John Smeaton, Peter Ewart, Carl Holtzmann, Gustave-Adolphe Hirn and Marc Seguin
 recognized that conservation of momentum alone was not adequate for 
practical calculation and made use of Leibniz's principle. The principle
 was also championed by some chemists such as William Hyde Wollaston. Academics such as John Playfair were quick to point out that kinetic energy is clearly not conserved. This is obvious to a modern analysis based on the second law of thermodynamics, but in the 18th and 19th centuries the fate of the lost energy was still unknown. 
Gradually it came to be suspected that the heat inevitably generated by motion under friction was another form of vis viva. In 1783, Antoine Lavoisier and Pierre-Simon Laplace reviewed the two competing theories of vis viva and caloric theory. Count Rumford's 1798 observations of heat generation during the boring of cannons
 added more weight to the view that mechanical motion could be converted
 into heat, and (as importantly) that the conversion was quantitative 
and could be predicted (allowing for a universal conversion constant 
between kinetic energy and heat). Vis viva then started to be known as energy, after the term was first used in that sense by Thomas Young in 1807. 
The recalibration of vis viva to
which can be understood as converting kinetic energy to work, was largely the result of Gaspard-Gustave Coriolis and Jean-Victor Poncelet over the period 1819–1839. The former called the quantity quantité de travail (quantity of work) and the latter, travail mécanique (mechanical work), and both championed its use in engineering calculation. 
In a paper Über die Natur der Wärme(German "On the Nature of Heat/Warmth"), published in the Zeitschrift für Physik in 1837, Karl Friedrich Mohr
 gave one of the earliest general statements of the doctrine of the 
conservation of energy in the words: "besides the 54 known chemical 
elements there is in the physical world one agent only, and this is 
called Kraft [energy or work]. It may appear, according to 
circumstances, as motion, chemical affinity, cohesion, electricity, 
light and magnetism; and from any one of these forms it can be 
transformed into any of the others."
Mechanical equivalent of heat
A key stage in the development of the modern conservation principle was the demonstration of the mechanical equivalent of heat. The caloric theory
 maintained that heat could neither be created nor destroyed, whereas 
conservation of energy entails the contrary principle that heat and 
mechanical work are interchangeable. 
In the middle of the eighteenth century, Mikhail Lomonosov,
 a Russian scientist, postulated his corpusculo-kinetic theory of heat, 
which rejected the idea of a caloric. Through the results of empirical 
studies, Lomonosov came to the conclusion that heat was not transferred 
through the particles of the caloric fluid. 
In 1798, Count Rumford (Benjamin Thompson)
 performed measurements of the frictional heat generated in boring 
cannons, and developed the idea that heat is a form of kinetic energy; 
his measurements refuted caloric theory, but were imprecise enough to 
leave room for doubt. 
The mechanical equivalence principle was first stated in its modern form by the German surgeon Julius Robert von Mayer in 1842. Mayer reached his conclusion on a voyage to the Dutch East Indies, where he found that his patients' blood was a deeper red because they were consuming less oxygen, and therefore less energy, to maintain their body temperature in the hotter climate.  He discovered that heat and mechanical work
 were both forms of energy and in 1845, after improving his knowledge of
 physics, he published a monograph that stated a quantitative 
relationship between them.
Joule's
 apparatus for measuring the mechanical equivalent of heat. A descending
 weight attached to a string causes a paddle immersed in water to 
rotate.
Meanwhile, in 1843, James Prescott Joule
 independently discovered the mechanical equivalent in a series of 
experiments. In the most famous, now called the "Joule apparatus", a 
descending weight attached to a string caused a paddle immersed in water
 to rotate.  He showed that the gravitational potential energy lost by the weight in descending was equal to the internal energy gained by the water through friction with the paddle. 
Over the period 1840–1843, similar work was carried out by engineer Ludwig A. Colding, although it was little known outside his native Denmark. 
Both Joule's and Mayer's work suffered from resistance and 
neglect but it was Joule's that eventually drew the wider recognition. 
In 1844, William Robert Grove postulated a relationship between mechanics, heat, light, electricity and magnetism by treating them all as manifestations of a single "force" (energy in modern terms). In 1846, Grove published his theories in his book The Correlation of Physical Forces. In 1847, drawing on the earlier work of Joule, Sadi Carnot and Émile Clapeyron, Hermann von Helmholtz arrived at conclusions similar to Grove's and published his theories in his book Über die Erhaltung der Kraft (On the Conservation of Force, 1847). The general modern acceptance of the principle stems from this publication.
In 1850, William Rankine first used the phrase the law of the conservation of energy for the principle.
In 1877, Peter Guthrie Tait claimed that the principle originated with Sir Isaac Newton, based on a creative reading of propositions 40 and 41 of the Philosophiae Naturalis Principia Mathematica. This is now regarded as an example of Whig history.
Mass–energy equivalence
Matter is composed of such things as atoms, electrons, neutrons, and protons. It has intrinsic or rest mass.
 In the limited range of recognized experience of the nineteenth century
 it was found that such rest mass is conserved. Einstein's 1905 theory 
of special relativity showed that it corresponds to an equivalent amount of rest energy. This means that it can be converted to or from equivalent amounts of other
 (non-material) forms of energy, for example kinetic energy, potential 
energy, and electromagnetic radiant energy. When this happens, as 
recognized in twentieth century experience, rest mass is not conserved, 
unlike the total mass or total energy. All forms of energy contribute to the total mass and total energy. 
For example, an electron and a positron each have rest mass.  They can perish together, converting their combined rest energy into photons
 having electromagnetic radiant energy, but no rest mass.  If this 
occurs within an isolated system that does not release the photons or 
their energy into the external surroundings, then neither the total mass nor the total energy
 of the system will change.  The produced electromagnetic radiant energy
 contributes just as much to the inertia (and to any weight) of the 
system as did the rest mass of the electron and positron before their 
demise. Likewise, non-material forms of energy can perish into matter, 
which has rest mass. 
Thus, conservation of energy (total, including material or rest energy), and conservation of mass (total, not just rest), each still holds as an (equivalent) law.  In the 18th century these had appeared as two seemingly-distinct laws.
Conservation of energy in beta decay
The discovery in 1911 that electrons emitted in beta decay
 have a continuous rather than a discrete spectrum appeared to 
contradict conservation of energy, under the then-current assumption 
that beta decay is the simple emission of an electron from a nucleus. This problem was eventually resolved in 1933 by Enrico Fermi who proposed the correct description of beta-decay as the emission of both an electron and an antineutrino, which carries away the apparently missing energy.
First law of thermodynamics
For a closed thermodynamic system, the first law of thermodynamics may be stated as:
- , or equivalently,
where  is the quantity of energy added to the system by a heating process,  is the quantity of energy lost by the system due to work done by the system on its surroundings and  is the change in the internal energy of the system.
The δ's before the heat and work terms are used to indicate that 
they describe an increment of energy which is to be interpreted somewhat
 differently than the  increment of internal energy (see Inexact differential). Work and heat refer to kinds of process which add or subtract energy to or from a system, while the internal energy 
 is a property of a particular state of the system when it is in 
unchanging thermodynamic equilibrium. Thus the term "heat energy" for 
 means "that amount of energy added as the result of heating" rather 
than referring to a particular form of energy. Likewise, the term "work 
energy" for 
 means "that amount of energy lost as the result of work". Thus one can 
state the amount of internal energy possessed by a thermodynamic system 
that one knows is presently in a given state, but one cannot tell, just 
from knowledge of the given present state, how much energy has in the 
past flowed into or out of the system as a result of its being heated or
 cooled, nor as the result of work being performed on or by the system. 
Entropy is a function of the state of a system which tells of limitations of the possibility of conversion of heat into work. 
For a simple compressible system, the work performed by the system may be written:
where  is the pressure and  is a small change in the volume
 of the system, each of which are system variables. In the fictive case 
in which the process is idealized and infinitely slow, so as to be 
called quasi-static, and regarded as reversible, the heat being 
transferred from a source with temperature infinitesimally above the 
system temperature, then the heat energy may be written
where  is the temperature and  is a small change in the entropy of the system. Temperature and entropy are variables of state of a system. 
If an open system (in which mass may be exchanged with the 
environment) has several walls such that the mass transfer is through 
rigid walls separate from the heat and work transfers, then the first 
law may be written:
where  is the added mass and  is the internal energy per unit mass of the added mass, measured in the surroundings before the process.
Noether's theorem
Emmy Noether (1882-1935) was an influential mathematician known for her groundbreaking contributions to abstract algebra and theoretical physics.
The conservation of energy is a common feature in many physical 
theories. From a mathematical point of view it is understood as a 
consequence of Noether's theorem, developed by Emmy Noether
 in 1915 and first published in 1918. The theorem states every 
continuous symmetry of a physical theory has an associated conserved 
quantity; if the theory's symmetry is time invariance then the conserved
 quantity is called "energy". The energy conservation law is a 
consequence of the shift symmetry of time; energy conservation is implied by the empirical fact that the laws of physics do not change with time itself. Philosophically this can be stated as "nothing depends on time per se".
In other words, if the physical system is invariant under the continuous symmetry of time translation then its energy (which is canonical conjugate
 quantity to time) is conserved.  Conversely, systems which are not 
invariant under shifts in time (an example, systems with time dependent 
potential energy) do not exhibit conservation of energy – unless we 
consider them to exchange energy with another, external system so that 
the theory of the enlarged system becomes time invariant again.  
Conservation of energy for finite systems is valid in such physical 
theories as special relativity and quantum theory (including QED) in the flat space-time.
Relativity
With the discovery of special relativity by Henri Poincaré and Albert Einstein, energy was proposed to be one component of an energy-momentum 4-vector.
  Each of the four components (one of energy and three of momentum) of 
this vector is separately conserved across time, in any closed system, 
as seen from any given inertial reference frame.  Also conserved is the vector length (Minkowski norm), which is the rest mass for single particles, and the invariant mass for systems of particles (where momenta and energy are separately summed before the length is calculated—see the article on invariant mass). 
The relativistic energy of a single massive particle contains a term related to its rest mass in addition to its kinetic energy of motion.  In the limit of zero kinetic energy (or equivalently in the rest frame) of a massive particle, or else in the center of momentum frame for objects or systems which retain kinetic energy, the total energy of particle or object (including internal kinetic energy in systems) is related to its rest mass or its invariant mass via the famous equation . 
Thus, the rule of conservation of energy over time in special relativity continues to hold, so long as the reference frame
 of the observer is unchanged. This applies to the total energy of 
systems, although different observers disagree as to the energy value. 
Also conserved, and invariant to all observers, is the invariant mass, which is the minimal system mass and energy that can be seen by any observer, and which is defined by the energy–momentum relation. 
In general relativity,
 energy–momentum conservation is not well-defined except in certain 
special cases. Energy-momentum is typically expressed with the aid of a stress–energy–momentum pseudotensor.
 However, since pseudotensors are not tensors, they do not transform 
cleanly between reference frames. If the metric under consideration is 
static (that is, does not change with time) or asymptotically flat (that
 is, at an infinite distance away spacetime looks empty), then energy 
conservation holds without major pitfalls. In practice, some metrics 
such as the Friedmann–Lemaître–Robertson–Walker metric do not satisfy these constraints and energy conservation is not well defined. The theory of general relativity leaves open the question of whether there is a conservation of energy for the entire universe.
Quantum theory
In quantum mechanics, energy of a quantum system is described by a self-adjoint (or Hermitian) operator called the Hamiltonian, which acts on the Hilbert space (or a space of wave functions)
 of the system. If the Hamiltonian is a time-independent operator, 
emergence probability of the measurement result does not change in time 
over the  evolution of the system. Thus the expectation value of energy 
is also time independent. The local energy conservation in quantum field
 theory is ensured by the quantum Noether's theorem
 for energy-momentum tensor operator. Note that due to the lack of the 
(universal) time operator in quantum theory, the uncertainty relations 
for time and energy are not fundamental in contrast to the 
position-momentum uncertainty principle, and merely holds in specific 
cases.
 Energy at each fixed time can in principle be exactly measured without 
any trade-off in precision forced by the time-energy uncertainty 
relations. Thus the conservation of energy in time is a well defined 
concept even in quantum mechanics.






