Average value of energy in statistical mechanics I haven't taken any classes in Statistical Mechanics, but in studying Structure of Matter I found some ideas I'm not very familiar with, related with the average value of energy ($E$). Given a $p(E)$ probability density, the average energy is:
\begin{equation}
\langle E\rangle=\frac{\int\limits_0^\infty Ep(E)dE}{\int\limits_0^\infty p(E)dE}
\tag{1}
\end{equation}
Now, in two different cases the average energy is calculated using either the Boltzmann distribution (the average energy per normal mode, when deriving Rayleigh Jeans)
\begin{equation}
p(E)\propto e^{-\frac{E}{kT}}
\end{equation}
or the Maxwell-Boltzmann(*) distribution (when deriving $\beta=\frac{1}{kT}$.).
\begin{equation}
p(E)\propto\sqrt{E}e^{-\frac{E}{kT}}
\end{equation}
The first case yields:
\begin{equation}
E=kT \tag{2}
\end{equation}
While the second case yields:
\begin{equation}
E=\frac{3}{2}kT \tag{3}
\end{equation}
That is familiar from kinetic
theory.
I suppose I am calculating average energy in two different situations.
Can you provide some physical (mathematically is quite clear, the distributions being different) insight on why this results are different in $(2)$ and $(3)$?
(*)
Actually it is not directly stated. It "builds" average energy starting from
\begin{equation}
\langle E\rangle=\frac{\int\limits_0^\infty Edn}{\int\limits_0^\infty dn}
\end{equation}
and then $dn$ is expressed in term of $dE$ and there is this $\sqrt{E}$ factor, so I assumed the book was implicitly using Maxwell Boltzmann.
(Brehm, Introdution to the structure of matter. Chapter 2, section 3, example 2)

 A: For the first case the probability of a certain energy starts high and reduces quickly (red curve), so there is a higher probability of low energy than high energy, for this case.
For the second case (blue), the probability of low energy is low, but for higher energies the probability is greater than for the red curve.

This causes the average energy to be higher for the second case.
A: 
Can you provide some physical (mathematically is quite clear, the distributions being different) insight on why this results are different in (2) and (3)?

In the $kT$ case there are two degrees of freedom (e.g., single point particle in two dimensions, e.g., a simple harmonic oscillators in one dimension, etc.). In the $3kT/2$ case there are three degrees of freedom (e.g., single particle in three dimensions, etc.).
Each "degree of freedom" contributes $kT/2$ to the average energy.
For example, in the free particle case: $E(p)=\frac{p^2}{2m}$. And $dE \propto pdp$
So, in two dimensions:
$$
E \propto \int dp p e^{-E(p)/kT} \propto  \int dE e^{-E/kT}\;.
$$
And, in three dimensions:
$$
E \propto \int dp p^2 e^{-E(p)/kT} \propto  \int dE\sqrt{E} e^{-E/kT}\;.
$$
A: Briefly, neither expression is correct in general. There are two basic issues:

*

*Boltzmann factors are not probabilities but are ratios between probabilities.

*Boltzmann factors are proportional to the probability that a particular state with energy $E$ is occupied.

Because of this, both integrals need to be taken over the set of all states (or density of states or phase space) rather than over $E$ itself. There is no universal relationship between $E$ and $T$ because of the importance of the density of states.
There are some technicalities depending on which ensemble you’re talking about, but they aren’t worth going into here.
As an aside, entropy is a more fundamental quantity than temperature, and it is also very closely tied to the set of available states. This explains why statistical mechanics is so rich; most of it has to do with the relationship between energy and entropy, which are both closely related to the states available to the system.
A: TL;DR: Density-of-states
Boltzmann distribution gives a probability of a microstate $n$ in terms of its energy $E_n$:
$$p_n=Z^{-1}e^{-\frac{ E_n}{k_BT}}.$$
In case of Maxwell-Boltzmann distribution the states are continuous and labeled by their velocities, so that we have
$$
p(v_x,v_y,v_z)=Z^{-1} e^{-\frac{ E(v_x,v_y,v_z)}{k_BT}}
$$
The average of any function of energy, $f(E)$, is the given by
$$
\langle f(E)\rangle = Z^{-1}\int_{-\infty}^{+\infty} dv_x\int_{-\infty}^{+\infty}dv_y\int_{-\infty}^{+\infty} dv_z f[E(v_x,v_y,v_z)] e^{-\frac{ E(v_x,v_y,v_z)}{k_BT}}=Z^{-1}\int_0^{+\infty}d\epsilon\rho(\epsilon)f(\epsilon)e^{-\frac{\epsilon}{k_BT}},
$$
where the density-of-states is
$$
\rho(\epsilon)=\int_{-\infty}^{+\infty} dv_x\int_{-\infty}^{+\infty}dv_y\int_{-\infty}^{+\infty} dv_z\delta[\epsilon-E(v_x,v_y,v_z)].
$$
In case of
$E=\frac{m(v_x^2+v_y^2+v_z^2)}{2}$ we obtain
$$
\rho(\epsilon)=4\pi\sqrt{\frac{m}{2\epsilon}}.
$$
If we now want to calculate the average energy, we set $f(\epsilon)=\epsilon$ in the equations above and obtain
$$
\langle E\rangle \propto \int_0^{+\infty}d\epsilon\sqrt{\epsilon}e^{-\frac{\epsilon}{k_BT}}.
$$
Remark
Depending on the textbook the density-of-states may be introduced differently (i.e., without using delta-function) and coefficients may differ. The idea however remains the same: replacing the summation over states by integration over energy.
