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?