According to the first law of thermodynamics, the total energy of a system remains constant, that is, energy can be transformed from one form to another but cannot be gained or lost.
The first complete statement of the first law was made by Rudolf Clausius in 1850.