Before defining entropy we focus on the disorder or randomness of natural processes in the Universe. One example can be if you throw a handful of small pieces of stone or something, they are not ordered in a particular place after thrown, and this represents a kind of disorder or randomness of the pieces of the stone after thrown. We define the quantitative measure of randomness or disorder of a natural process as entropy. In order to understand entropy mathematically we go ahead and consider an isothermal process

What is quantitative definition of entropy?

We consider a reversible isothermal process with an ideal gas and we already know that the isothermal process is a constant temperature process. Remember again that the internal energy of an ideal gas depends only on the temperature of the system and the change in internal energy in an isothermal process containing ideal gas is zero, that is, \(\Delta U = 0\). Then according to the first law of thermodynamics, we have,

\[Q = W = pdV = \frac{{nRTdV}}{V} \tag{1} \label{1}\]

Note that you know \(pV = nRT\) from ideal gas law. Rearranging the above equation, we have,

\[\frac{Q}{T} = nR\frac{{dV}}{V} \tag{2} \label{2}\]

On the right hand side of the above equation, the ratio \(dV/V\) represents the ratio of the change in volume to the original volume which is proportional to the ratio \(Q/T\). The ratio \(dV/V\) quantitatively measures the randomness or disorder of the gas molecules in the system and therefore the entropy \(\Delta S\) is defined by

\[\Delta S = \frac{Q}{T} \tag{3} \label{3}\]

Here \(Q\) is the amount of heat added at constant temperature and \(\Delta S\) is the change in entropy due to the added heat. The above equation Eq. \eqref{3} works only for an isothermal process at constant temperature \(T\). If a reversible process is not isothermal or the temperature of the process changes, Eq. \eqref{3} is not valid. In that case we can break the path of the reversible process into infinitesimal steps and add the ratios \(dQ/dT\) for every step or it means we integrate \(dQ/dT\) between the two states of the process. Therefore, if a process takes place between states 1 and 2 (2 is the final state), the change in entropy for the reversible process is

\[\Delta S = \int_1^2 {\frac{{dQ}}{{dT}}} \tag{4} \label{4}\]

Note that similar to internal energy entropy does not depend on the path of any process but only depends on the current state of the system.

What is entropy in irreversible process?

Entropy you may obviously know changes in irreversible processes (or natural processes because natural processes are all irreversible). In that case, since the entropy is a state function (or depends only on the current state of the system) we can simply generate or create an arbitrary path between any two states of an irreversible process and use Eq. \eqref{4} to find the entropy change.

Figure 1 Free expansion of gas.

For example, we consider an irreversible process such as the free expansion of an ideal gas in a container insulated from surroundings so that no heat can flow inside the container or leave the container as shown in Figure 1. The partition blocker separates the inside of the container into equal halves (equal volumes) that is, both partitions have the same volume but the gas is initially in the bottom partition. When the partition blocker is broken, the gas starts to fill in the other half as well. If \(V\) is the volume of one partition, the gas is filled in the volume equal to \(2V\) after the partition is broken. As the volume for gas particles to move increases, the particles become more random and entropy increases but if you remind Eq. \eqref{3} it seems that the entropy should be zero (because \(Q = 0\)). You have already noted that entropy depends only on the current state not on the path that lead to that state. So we can consider a reversible expansion of the gas from the state of volume \(V\) to the state of volume \(2V\) in order to find the entropy change. You may think that it is a kind of an adiabatic expansion but remember that the gas does not do work on its surroundings; the container of the gas doesn't expand! But what increases the randomness of the gas molecules? The question can be answered by the work done \(W\). The work done by the gas molecules during free expansion is equal to the heat \(Q\) added in the system (but no heat is added from the external source) but remember the temperature remains the same (heat and temperature are not the same things). Thus we know \(Q = W = pdV\) and using Eq. \eqref{4} within limits \(V_1 = V\) and \(V_2 = 2V\),

\[\Delta S = \int_V^{2V} {\frac{{pdV}}{T}} = \int_V^{2V} {\frac{{nRdV}}{V}} = nR\ln 2\]

Note that we applied ideal gas law \(pV = nRT\) to replace \(p\) in the above equation. And we found that the entropy in the free expansion we considered is not zero (but it seemed to be zero!).

What is relationship of entropy and the second Law of thermodynamics?

Here is the connection between the entropy and the second law of thermodynamics. As already discussed, entropy is the quantitative measure of disorder or randomness and the second law is the statement of impossibility. Do you find any connection? Yes, you do and that is, the disorder or randomness of a system generates the impossibility. Therefore, we can also state the second law of thermodynamics in terms of entropy as, in any natural or real process there is always an increase in entropy. Or it means there is no any real process in which there is a decrease in entropy or zero entropy change. Note that reversible process can have zero entropy change such as reversible adiabatic process and such process is called isentropic process and remind yourself that a reversible process is an idealization.