Mathematically, the first law states that the change in internal energy of a system is equal to the sum of the heat given to it from outside ( the surroundings ) and the work done on it by external forces ( forces not originating in the system ).
U = q + wwhere,
"U" is the internal energy of the system,
"q" is the heat absorbed by the system from the surroundings
"w" is the work done on the system by extrenal forces.