Following the same procedure used in deriving the Maxwell–Boltzmann statistics, we wish to find the set of n i for which W is maximised, subject to the constraint that there be a fixed total number of particles, and a fixed total energy. The maxima of W and ln ⁡ ⁡ ( W ) occur at the same value of n i and, since it is easier to accomplish mathematically, we will maximise the latter function instead. We constrain our solution using Lagrange multipliers forming the function: f ( n i ) = ln ⁡ ⁡ ( W ) + α α ( N − − ∑ ∑ n i ) + β β ( E − − ∑ ∑ n i ε ε i )