The first law of thermodynamics is the law of