Take a look at some notes for Days 1 and 2 in Thermodynamics here.