# Show that equal pressure is the maximum entropy state

Some introduction and background

Consider a thermally insulated reservoir filled with some gas. The reservoir is divided in two by a fixed, thermally conducting wall. Initially, the first compartment has an internal energy $$U_1$$, volume $$V_1$$ and particle number $$N_1$$, while the second compartment has $$U_2, V_2, N_2$$. The system is then allowed to reach equilibrium by exchanging heat through the thermally conducting wall. Here's a cartoon of the system:

The equilibrium distribution of energies is then obtained by maximizing the entropy with respect to either $$U_1$$ or $$U_2=U-U_1$$. In particular, we can write the total entropy as $$S(U, V, N; U_1)=S_1(U_1, V_1, N_1)+S_2(U_2, V_2, N_2)$$ and set $$\partial S/\partial U_1=0$$. From there it is easy to see that the condition for equilibrium is

$$\frac{\partial S_1}{\partial U_1} = \frac{\partial S_2}{\partial U_2}$$

We know, however, that $${\partial S_1}/{\partial U_1}=1/T_1$$ and $${\partial S_2}/{\partial U_2}=1/T_2$$ so we can conclude that, when only energy exchange is allowed, the condition for equilibrium is that the temperatures are equal: $$T_1=T_2$$.

Now, assume that, in addition to energy exchange, the wall is also allowed to move, so volume exchange is also allowed:

Then, for equilibrium, we additionally have

$$\frac{\partial S_1}{\partial V_1} = \frac{\partial S_2}{\partial V_2}$$

With the thermodynamic relations $$\frac{\partial S_1}{\partial V_1}=p_1/T_1$$ and $$\frac{\partial S_2}{\partial V_2}=p_2/T_2$$ and the previous condition that $$T_1=T_2$$ we have $$p_1=p_2$$. When both energy and volume exchange are allowed, thus, the temperatures and the pressures are equal at equilibrium.

The current question

Now, my question is what happens when the wall is allowed to move, but it's thermally insulating? In this case we have volume exchange as before, but the energy exchange is very particular as it is due to mechanical work only:

Intuitively, I would expect that the two pressures will be equal, but the two temperatures won't. How would I show this with similar arguments as before, by maximizing the entropy?

• After further research it turns out that the problem is called the adiabatic piston problem and has several answers: physics.stackexchange.com/questions/258583/… physics.stackexchange.com/questions/257815/… physics.stackexchange.com/questions/105344/… Commented Oct 26, 2023 at 10:07
• For the case of a thermaly insulated wall with the volumes varying, even finding the final state by requiring the pressures to be equal is a daunting problem that can not be solved exclusively by use of thermodynamics and mechanics. Determination of the final state is a problem involving viscous fluid dynamics and spatial differential energy balances. Commented Oct 26, 2023 at 11:56