# Free expansion, energy and entropy

Why when we have free expansion of a gas in a chamber, there is no energy increase? I understand why in phenomenological way but when I try to use thermodynamic equations I cannot understand the reason why energy doesn't change when entropy changes.

Now when a gas (who was in one half of the chamber) expands in the whole chamber, that means that we have an irreversible process, which is characterised by an entropy increase. Or we can say that now that the dimensions of the space in which the non-interacting gas particles can be found changed, then (since we know that the energy of a particle in a box is a function of quantum number's $$n_x,n_y, n_z$$ and the dimensions of the box) the energy of an individual particle will change (probably is reduced but I am not too sure) then the same happens for all the particles and subsequently for the whole gas. Because the particles have more "options" for the position in which they can be found, then doesn't that mean that we will have more micro states? And in equilibrium, the system goes the the macrostate with the higher multiplicity, which means with the higher amount of microstates, which have the same energy as the macrostate in equilibrium, and for the entropy that means :

$$S=kln\Omega$$ that it's value will increase. But if we move from one macrostate (when the particles are in one half of the box) to another one (where they are in the whole chamber and particles change energy but also entropy changes because we have a change in the multiplicity, otherwise entropy wouldn't change), isn't that the same as saying that the system goes from one state with an energy A to another one with energy B, how is it then that the energy for a free expansion is constant ?

The total number of microstates corresponding to the macrostate with the fixed energy $$E$$ does increase, which is why the entropy also does increase. The number of microstates has nothing to do with the energy -- only the entropy.