What is the first law of thermodynamics and how does it relate to the second