From the first law of thermodynamics to Einstein