We have: dU=q+w. dS=qrevT. The fundamental thermodynamic equation for internal energy follows immediately from the first law and the Clausius principle: dU=q+w. dS=qrevT.