Derivation of Maxwell distribution

Short and basic/stupid question for today. I was having a second look at the derivation of the Maxwell distribution at temperature T from the definition of entropy in statistical physics. I understand what I think is the "classic" derivation, with a system of energy Ei in thermal equilibrium with a heat bath of energy $$E\gg E_i$$. However, I tried to see if I could take a shortcut, and end up with a dramatically wrong answer. Shamefully enough, I don't really see what's wrong with my stuff. Could you please point the error out? Thanks a bunch :)

Let's assume we have a system at temperature $$T$$ (could be the heat bath itself, or whatever system in thermal equilibrium at $$T$$) The statistical entropy is defined as: $$S=k_B\ln(\Omega),$$ where $$\Omega$$ is the number of microstates of the system at energy $$E$$. I am interested in the probability of having such an energy E. From the thermodynamic definition of temperature: $$\frac{\partial E}{\partial S}=T \Rightarrow \frac{\partial S}{\partial E}=1/T$$ therefore, for our system at temperature $$T$$: $$\frac{1}{T}=k_B\frac{\partial }{\partial E}(\ln(\Omega))$$

$$\frac{1}{T}=k_b\frac{\partial \Omega }{\partial E}\frac{1}{\Omega}$$

$$\frac{\partial \Omega }{\partial E}=\frac{\Omega }{k_BT}$$

$$\Omega=e^{E/(k_bT)}+\text{cst}$$

The constant is zero. This is the number of microstates that have energy E. The probability of having energy E is therefore the ratio of this number of microstates to all possible microstates over all energy levels. This leads to a probability of having energy E of: $$P_E=\frac{e^{E/(k_bT)}}{\sum_i{e^{E_i/(k_bT)}}}$$

When of course we should have $$P_E=\frac{e^{-E/(k_bT)}}{\sum{e^{-E_i/(k_bT)}}}$$. Where the sum is over all quantum energy levels What is wrong with this naive approach?

$$\Omega$$ is the number of microstates of the system at energy $$E$$. Thus, the probability of being in one of these microstates is proportional to $$\frac{1}{\Omega}\sim e^{-E/k_BT}$$. This leads to the probability of being in the microstate $$i$$: $$$$P_i=\frac{e^{-E_i/k_B T}}{\sum_j e^{-E_j/k_BT}}.$$$$ If we want to calculate the probability of having energy $$E$$, instead of the probability of being in the microstate $$i$$, the appropriate multiplicity has to be multiplied to the above equation.
• For instance, if there are four distinct states with energy E, the probability of having energy $E$ is given by $P_E=4e^{-E/k_BT}/Z$ where $Z$ is the partition function. Here, $Z$ would include four terms of $e^{-E/k_BT}$. Jun 16 '21 at 13:06
• If all states available have the energy $E$, then the probability of having energy $E$ must equal to 1, and there's no contradiction here. Otherwise, multiplying the multiplicity of the state will give $P_E$ as described above. Note that $\Omega e^{-E/k_BT}$ isn't exactly one due to constant factors. Generally, the partition function is calculated by summing over all states: $Z=\sum_i e^{-E_i/k_BT}$. If we want to write the partition function as a sum over energy, we have to apply the multiplicity in each term: $Z=\sum_E n_E e^{-E/k_BT}$ where $n_E$ is the number of states with energy $E$. Jun 16 '21 at 13:51