text: Gibbs paradox arises when entropy is calculated using an  dimensional phase space, where  is also the number of particles in the gas.  These particles are spatially confined to the one-dimensional interval . The volume of the surface of fixed energy is
  The subscripts on  are used to define the state variables and will be discussed later, when it is argued that the number of particles,  lacks full status as a state variable in this calculation.  The integral over configuration space is .  As indicated by the underbrace, the integral over velocity space is restricted to the "surface area" of the  dimensional hypersphere of radius , and is therefore equal to the "area" of that hypersurface. Thus
  After approximating the factorial and dropping the small terms, we obtain
  In the second expression, the term  was subtracted and added, using the fact that . This was done to highlight exactly how the "entropy" defined here fails to be an extensive property of matter.  The first two terms are extensive: if the volume of the system doubles, but gets filled with the same density of particles with the same energy, then each of these terms doubles. But the third term is neither extensive nor intensive and is therefore wrong.
  The arbitrary constant has been added because entropy can usually be viewed as being defined up to an arbitrary additive constant.  This is especially necessary when entropy is defined as the logarithm of a phase space volume measured in units of momentum-position.  Any change in how these units are defined will add or subtract a constant from the value of the entropy.