# Entropy change in mixing two gases

The entropy change of an ideal gas is calculated as $$\Delta S = C_V n\ln(\frac{T}{T_0}) + nR\ln{\frac{V}{V_0}}$$ derived by integrating $dU = TdS - pdV$. It is only true for reversible processes, since we have assumed that the change in heat is $DQ = TdS$. This equation (according to the solution of an exercise) is applied when you have a container with two different gases separated by a wall, and then you suddenly remove the wall and let the two gases mix. The way I see it, this is an irreversible process, yet we apply an equation which we have derived from an assumption only true for reversible processes. This is a rather frequent problem of mine, I see $DQ = TdS$ applied in a lot of exercises where I would have assumed that the process is irreversible. What am I missing here?

Entropy is a state variable. That means for every state you have a single value for entropy of that state. So the entropy difference of two states does not depend on the process that takes you from one state to the other. Therefore you can use this formula if the initial state is $(T_0,V_0)$ and final state is $(T,V)$. However the change in the Entropy of universe (system+surrounding) does depend on the process: $\Delta S_{universe}=0$ for reversible process and $\Delta S_{universe}>0$ for irreversible process.