The German physicist Julius Mayer first stated the law of conservation of energy in 1842. He discovered that a chemical reaction created heat and work, which then made more heat. The law of conservation of energy states that the amount of energy is constant, meaning it is not destroyed or created.
However, Mayer's discovery was not highly regarded, and it was not until James Joule's work that it gained attention. While studying electric motors, Joule found that the heat traveling across a wire was directly proportional to the amount of work done by a dynamo. He called it the caloric theory. Both Mayer's and Joule's work concluded that work transforms into a numerically equivalent amount of heat. The law of conservation of energy is the first law of thermodynamics, which is the study of work and energy.