Consider gas here as idea gas. The gas expands from state 1: P1, V1 and T1 to state 2: P2, V2, and T1 using two different paths: Path A: reversible expansion at constant T Path B: irreversible expansion by releasing the gas to a vacuum to achieve V2 at adiabatic condition. Thing I confuse: consider that enthalpy as a state function: H1 to H2 from state 1 to state 2. for reversible path A: dU = q + w. dU = 0. so q=-w. The system needs some q from surrounding to perform w. and dH = q. H2 = H1 + dH = H1 + q. but for Path B: w=0, q=0, dU=0. dH=0. So, H2 = H1. Why? my question is enthalpy can't be same for path B, because enthalpy is a state function which is independent from its path.