# ensembles and lagrange multipliers

In the derivation of maxwell-boltzmann distributions, the method of Lagrange multiplier is

$\sum n_i = N$

$\sum n_i E_i = E$

where $N$ is the total number of particles, and $E$ is the total energy. And we try to find the macrostate with the most microstates, I think the derivation is familiar to most.

http://en.wikipedia.org/wiki/Maxwell%E2%80%93Boltzmann_statistics#Derivation_from_microcanonical_ensemble

My question is : By fixing the energy $E$, it's actually describing an isolated system without any exchange in energy with the surroundings, i.e. a micro-canonical ensemble. If you fix the energy of a system, it's trajectory should be on a constant-energy surface in phase space. What does this have to do with the canonical ensemble?

If you want to derive the results for the canonical ensemble, shouldn't you be letting the energy to vary?

• Yeah, in the canonical ensemble you have fixed total energy but it can flow between your system and the bath. The associated Lagrange multiplier is the temperature. Similarly, when you have a grand canonical ensemble where the particle number can flow to and from a bath, you get chemical potential as the associated Lagrange multiplier. Is this what you're asking? Commented Sep 26, 2014 at 21:33
• You're essentially fixing the average energy, see e.g. pa.msu.edu/~pratts/phy831/lectures/lectures.pdf Commented Sep 26, 2014 at 21:36
• @DanielSank But in that derivation, no heat bath is ever mentioned. There is just one system, containing $N$ particles, with many energy levels $E_i$ for them to reside on, and it goes on to derive the distribution formula. Not a single word about heat bath. Commented Sep 26, 2014 at 21:40
• Normally I think of it like this: First work through the microcanonical ensemble for a closed system. Then, pick any subsystem of your closed system and regard that as an open system with the rest of the system as the bath. See what I mean? Commented Sep 26, 2014 at 21:44
• So actually it's treating the other n-1 systems as the reservoir? Commented Sep 27, 2014 at 6:33