Suppose we have a system $S$ connected to a bath $B$. The combined system forms a microcanonical ensemble.
Suppose the energy of the combined system is $E_T$.
So, $E_S+E_B=E_T$.
The probability of finding the system $S$ in energy $E$ (or probability of finding a microstate of system corresponding to energy E) is
$\rho(E)=$ Probability of finding the bath in energy $(E_T-E)\;\alpha\;\Omega_B(E_T-E)$
$\displaystyle\implies \rho(E)\;\alpha\;\Omega_B(E_T-E)\tag{1}$
We consider bath to be huge and the system $S$ forms a tiny part of the combined system. So, $E<<E_B$. This means $E_T\approx E_B$
So, $(1)$ becomes
$\displaystyle\rho(E)\;\alpha\;\Omega_B(E_B-E)\tag{2}$
As $E$ is small, so we can do the Taylor expansion of the above expression around $E_B$ and retain only the first order terms.
Finally we get, $\displaystyle\rho(E)=Ce^{-\frac{E}{k_BT}}\tag{3}$
Here $C$ is the normalization constant.
We can find $C$ as follows
$\displaystyle\sum_E\rho(E)=1=\sum_{\text{(All possible microstates)}}e^{-\frac{E}{k_BT}}=C\sum_E\Big(\sum_{\text{(All possible microstates with energy E)}}e^{-\frac{E}{k_BT}}\Big)=C\sum_E\Omega(E)e^{-\frac{E}{k_BT}}\tag{4}$
We can define the partition function as
$\displaystyle Z=\frac{1}{\sum_E\Omega(E)e^{-\frac{E}{k_BT}}}\tag{5}$
So, $\displaystyle\rho(E)=\frac{e^{-\frac{E}{k_BT}}}{Z}\tag{6}$
Doubt
- $\rho(E)$ by definition is $\frac{\Omega(E)}{\sum_E\Omega(E)}$
This is the probability of finding the sytem in macrostate $E$ or in other words, we can say that it is the probability of finding the system in a microstate corresponding to energy $E$ out of all the possible microstates that corresponds to different energies.
In $(4)$, on the $RHS$ why we are summing over all the possible microstates. I think that by the definition it should be just summing over all the energies E (macrostates).
Then $\displaystyle Z=\frac{1}{\sum_{E}e^{-\frac{E}{k_BT}}}$
I don't know what am I missing. Because in all the books, in partition function there is summing over all the possible microstates.