In the previous sections we have considered the entropy changes in the system for the most typical processes. Now we will study the entropy variations that occur in the system and in the environment. We call universe the set of system plus environment that interacts with it. \begin{equation} \Delta S_{uni}=\Delta S_{sis}+\Delta S_{ent} \end{equation}

Let's calculate the change in entropy that the universe undergoes in a reversible process. Suppose there is an infinitesimal flow of heat dq from the system to the surroundings. For the process to be reversible, it is necessary that the temperature difference between the system and the surroundings be one dT, otherwise the process will be irreversible.

\begin{equation} dS_{uni}=dS_{sis}+dS_{in}=\frac{dq_{sis}}{T_{sis}}+\frac{dq_{in}}{T_{in}} \end{equation}

The heat received by the system is equal to the heat released by the surroundings, $q_{sis}=-q_{ent}$ and the temperatures only differ by an infinitesimal amount, $T_{sis}=T_{ent }$ , so we can consider them the same.

\begin{eqnarray} dS_{uni} & = & \frac{dq_{sis}}{T_{sis}}+\frac{-dq_{sis}}{T_{sis}}=0\\ \Delta S_{ uni} & = & 0 \end{eqnarray}

In any reversible process the entropy of the universe remains constant. You can change the entropy of the system and that of the environment, but the sum of both variations is zero. For an isolated system, the entropy change during a reversible process will be zero. It is easy to understand since in this case the system is equivalent to the universe since it has no environment.

In irreversible processes the entropy of the universe always increases. Thus, we can write the following inequality valid for all processes:

\begin{equation} \Delta S_{uni}\geq 0 \end{equation}

The equal is for reversible processes and the greater is for irreversible processes. For an isolated system it will be fulfilled: $\Delta S_{sis} \geq 0$