LAW of thermodynamics:\({\rm{\Delta }}U = {\rm{\Delta }}Q - {\rm{\Delta }}W\)So the difference between heat ADDED to the system and work DONE by the system is equal to the CHANGE in internal energy.