We wish to find the N i for which the function W is maximized, while considering the constraint that there is a fixed number of particles ( N = ∑ ∑ N i ) and a fixed energy ( E = ∑ ∑ N i ε ε i ) in the container. The maxima of W and ln ⁡ ⁡ ( W ) are achieved by the same values of N i and, since it is easier to accomplish mathematically, we will maximize the latter function instead. We constrain our solution using Lagrange multipliers forming the function: