ste the first law of thermodynamics
First law of thermodynamics
Heat given to a system is equal to the sum of change in internal energy of the system and work done by the system.
The first law of thermodynamics states that the energy of an isolated system is constant.
ΔQ = ΔU + ΔW, is the mathematical statement of the first law of thermodynamics.
where ΔQ = heat given to the system
ΔU = the change in the internal energy of the system,
ΔW = the work done by system.
It basically means that energy can neither be created nor be destroyed, although it can be converted from one form to another.