The change in the internal energy of a system (U) is equal to heat in or out of a system (q) plus the work done on or by the system (w): .
The first law of thermodynamics states that energy cannot be created or destroyed, only transformed from one type of energy to another type of energy. Heat is a transfer of thermal energy, which is the kinetic energy of the particles of a system. It is the part of internal energy that is due to the motion of the particles. Heat entering or exiting a system directly affects its internal energy. Work is energy that is transferred when a force is acted on an object over a distance, which can be a mechanical change caused by the system or a mechanical change that changes the system. If a system does work, it will lose energy. If work is done on a system, the system will gain energy.
The first rule of thermodynamics brings these terms together. It relates the change in internal energy () with heat (q) and work (w):
First Law of Thermodynamics
This equation states that the change in internal energy of a system is equal to energy into or out of the system plus the work done by or on the system. If there is no heat transfer into or out of the system, then the q term becomes 0. In this case, is equal to only the work term, w. Similarly, if there is no work done by or on the system, the w term becomes 0. In this case, is equal to only the heat term, q. Keep in mind that this relation is true for a thermodynamic system. If the surroundings are considered, the signs are always reversed.
This means internal energy is also conserved in the universe.