Question regarding expectation value of energy and gibbs factor In lecture we introduced the average energy for a single particle as $$E = \langle \varepsilon \rangle = \frac{\int d \varepsilon g(\varepsilon) e^{- \beta \varepsilon} \varepsilon}{Z_1}$$
where $Z_1 = \int d \varepsilon e^{- \beta \varepsilon}$. In the case of $g(\varepsilon) = 1$ the above calculation can be simplified and you would get $$E = k_B T$$ as the result of the integral. When you consider $N$ indistinguishable particles, I would have no problem assuming that $$E = N \langle \varepsilon \rangle = Nk_BT$$ since this still makes sense to me. However if I consider the above expression for the expectation value now integrated for $N$ particles meaning that if they are not interacting $Z = Z_1^N$ and $$E = \langle \varepsilon \rangle = \frac{\int d \varepsilon g(\varepsilon) e^{- \beta \varepsilon} \varepsilon}{Z_1^N}$$ where $\varepsilon = \sum_{i=1}^N \varepsilon_i$ and $d \varepsilon = \prod_{i=1}^{N} d \varepsilon_i$ then I get a strange result which is not $Nk_BT$, even though in my head it's still the expectation value for the energy for $N$ particles. So my first question would be: What did I do wrong in the second calculation? My second question overall is also: How does the definition of the expectation value here account for indistinguishable particles? Normally you would introduce a Gibbs factor in the way that $\tilde{Z} = \frac{Z}{N!}$ which would change the result for the second calculation while the first calculation isn't affected because we are only looking at single particle partition function/average energy. I would be grateful for someone telling me where my thinking went wrong.
 A: To start with your second question

How does the definition of the expectation value here account for indistinguishable particles?

It doesn't. What you have calculated here is not the expected energy of $N$ indistinguishable particles, it is the expectation of the energy for $N$ distinguishable particles, which happen to have the same available energies and degenerates. For truly indistinguishable particles you could not factor the degeneracy $g$, as if any two particles had the same energy you would get a reduced degeneracy to avoid over-counting configurations with the particles exchanged. This is what results in the factor of $\frac{1}{N!}$ when calculating the combined partition function.
For the frist part

What did I do wrong in the second calculation?

I don't know what happened in your calculation. You have not written down exactly what you did. For the $N$ identical-but-distinguishable particles discussed above, with $g(\varepsilon_1,\varepsilon_2,\dots\varepsilon_n) = 1$ (As a side note $g$ should have units of $[E]^{-N}$, but we will ignore this and assume we have somehow normalized our energy to get a dimensionless $\varepsilon$), we can optain $E = Nk_BT$ as follows
\begin{align}
E &= \frac{1}{Z_1^N} \int \left(\prod_i d\varepsilon_i\right) \sum_j \varepsilon_j e^{-\beta \sum_k \varepsilon_k}\\
&= \frac{1}{Z_1^N} \sum_j\int \left(\prod_{i} d\varepsilon_i\right)  \varepsilon_j e^{-\beta \sum_k \varepsilon_k}\\
&= \frac{1}{Z_1^N} \sum_j\int d\varepsilon_j \varepsilon_j e^{-\beta \varepsilon_j}\;\int\left(\prod_{i\ne j} d\varepsilon_i \right)e^{-\beta \sum_{k\ne j}\varepsilon_k}\\
&= \frac{1}{Z_1^{N-1}} \sum_j \langle \varepsilon_j \rangle Z_1^{N-1}\\
&= N k_B T
\end{align}
