Heat is a form of energy, and therefore thermodynamic processes are also governed under the law of conservation of energy—no heat may be created or destroyed, only transformed into other forms of energy. The first law of thermodynamics is simply a variant of the law of conservation of energy in terms of thermodynamics.

The law stipulates that change in internal energy of a system is equal to the change in work plus the change in heat.

The general rule for the sign of or is that when the system loses energy (energy leaves the system), the sign is negative; otherwise if the system gains energy (energy enters the system), then the sign is positive.

SignMeaning
+qSurrounding transfers heat to system
-qSystem transfers heat to surrounding
+wSurrounding does work on system
-wSystem does work on surrounding