Entropy change between two systems

Example 14.2 of Concepts in Thermal Phyiscs, 2nd ed:

"Consider two systems, with pressures $p_1$ and $p_2$ and tempreatures $T_1$ and $T_2$. If internal energy $\Delta U$ is trasferred from system 1 to system 2, and volume $\Delta V$ is transferred from system 1 to system 2, find the change of entropy. Show that equilibrium results when $T_1 = T_2$ and $p_1 = p_2$."

The given solution is to use the first law of thermodynamics, $dU = TdS - pdV$, and rewrite it as $dS = (1/T)dU + (p/T)dV$. Then the change in total entropy $\Delta S = \Delta S_1 + \Delta S_2$, is "straightforwardly":

$\Delta S = (1/T_1 - 1/T_2) \Delta U + (p_1/T_1 - p_2/T_2) \Delta V$.

So if $dz = (1/y)dx$ then $z_2 - z_1 = \int dz = \int (1/y)dx = (1/y_2 - 1/y_1)(x_2 - x_1)$. Why? The last step is not at all straightforward to me. Certainly it's not true in general. Nevermind, I confused the meaning of indexes 1 and 2; they denote systems 1 and 2, not "before and after".

$$dS = (1/T)dU + (p/T)dV$$

for system 1, $$\triangle S_1 = \int 1/T_1d U + \int p_1/T_1dV= 1/T_1 \triangle U + p_1/T_1 \triangle V$$

for system 2, $$\triangle S_2 = -1/T_2 \triangle U - p_2/T_2 \triangle V$$

Thus, the change of the total entropy $$\triangle S = \triangle S_1 + \triangle S_2= (1/T_1 - 1/T_2) \Delta U + (p_1/T_1 - p_2/T_2) \Delta V$$

No entropy change when they are in equilibrium.

• Your answer is correct except that it applies for infinitesimal changes, i.e. integral is not required ($\Delta$ ought to be interpreted as an infinitesimal change). For finite changes (which is given by the integral) you cannot pull out $1/T_1$ and $p_1/T_1$ out of the integral because they are not constant over a finite process. – Deep Apr 5 '18 at 4:14
• I see; I appear to have confused the meanings of index 1 and 2 as "before and after" rather than "systems 1 and 2". However, $dU$ in the first law denotes the energy change of the system, and $\int dU$ should be positive for a positive change, so why are the minus signs on $\Delta S_2$ rather than on $\Delta S_1$? (Also, you appear to have accidentally put some wrong indexes in the $\Delta S_2$ formula.) – Blrp Apr 6 '18 at 22:22
• By the way, as @Deep said, isn't this an invalid method for finding $\Delta S$, considering $\Delta U$ and $\Delta V$ are not said to be infinitesimal? – Blrp Apr 6 '18 at 22:23
• @Deep , if you can keep $T_1$, $p_1$, $T_2$, $p_2$ constant, the process is not necessary to be infinitesimal. – user115350 Apr 7 '18 at 4:12
• @Blrp $\triangle U$ can be positive or negative. We don't have to use sign to indicate that. As the problem said it is taken out from system 1. So its value is negative. – user115350 Apr 7 '18 at 4:23