It is appropriate to illustrate the relationship between ΔS and *q* with a consideration of the relationship between entropy and volume. Our consideration will be the simple case of isothermal expansion of a perfect gas, but it is possible to apply the equations to more complicated situations.

Our starting point is the following equation, the definition of entropy change:

Given that the expansion is isothermal, the temperature is a constant that may be taken outside the integral, allowing us to write

In this situation, ΔU = 0 (as there is no temperature change, and the particles of a perfect gas do not interact at all so are unaffected by being more widely separated) , allowing us to use the First Law of Thermodynamics to write

so;

The work of reversible expansion is given by w_{rev} = ^{–} ∫ pdV . For a perfect gas, we may use the equation of state pV = nRT to substitute for p and obtain

which integrates to

when V_{f} > V_{i} (i.e. when expansion occurs) the ratio of volumes > 1 so the logarithmic term and hence the overall entropy change are both positive, as we expect. Conversely, if V_{f} < V_{i} (i.e. contraction) the ratio of volumes < 1 so the logarithmic term and overall entropy change are both negative.