Trying hard to understand a basic textbook model meant to illustrate that entropy (of the universe) increases for irreversible processes. Help me out please? I get this part: A gas is compressed isothermally (constant T) and reversibly, getting worked on and expelling heat. To calculate ΔS for the system, you can use the formula ΔS=q/T since it is a reversible process. The same formula can be used for the entropy change in the surroundings, and of course, the entropy changes are equal and opposite since qsys=-qsurr. Total entropy change of the universe is zero. Now for the irreversible compression, with same initial and final system states. Since entropy is a state function, ΔS for the system is exactly the same value as above. However when you calculate the heat transfer q, that has a higher value now (more work was required for the irreversible compression, so more heat was expelled). To get entropy change of the surroundings, textbooks use ΔSsurr=qsurr/T=-qsys/T, which is higher than ΔSsys. But isn't it illegal to use that formula for this irreversible process? I'm totally confused. All of the textbooks brush right over this point, but it seems like an obvious objection. Thank you for your help!