# Is my attempt at an alternative derivation of electron degeneracy pressure correct?

I am aware that one can derive the electron degeneracy pressure from the total energy of a gas of electrons, given by

$$E_{tot} = \frac{\hbar^2(3\pi^2N)^{5/3}}{10\pi^2m}V^{-2/3}.$$

Where $N$ is the number of particles in the gas and $V$ is its volume. I can then calculate the degeneracy pressure using $P = -\frac{\partial E_{tot}}{\partial V}$, but I would like to go via the partition function.

The partition function in the canonical ensemble is given by $Z = \sum_i g_ie^{-\beta E_i}$ where $g_i$ is the density of states. For a free electron gas this is given by

$$g(E)dE = \frac{V}{2\pi^2}\bigg(\frac{2m}{\hbar^2}\bigg)E^{1/2},$$

so my partition function should be given by an integral instead of a sum:

$$Z = \int g(E)e^{-\beta E}dE = \frac{V}{2\pi^2}\bigg(\frac{2m}{\hbar^2}\bigg)\int E^{1/2} e^{-\beta E}dE.$$

I then hoped I could use the identities $F = -kT\ln Z$ and $P=-\frac{\partial F}{\partial V}$ to then get the pressure but I don't know how to evaluate the logarithm of $Z$.

Your current approach is just going to give you the ideal gas law as $$\ln Z = \ln V + \ln f(T)$$ where $f$ is some function that depends only on the temperature. In particular $f$ does not depend on $V$, so \begin{align*} P & = -\frac{\partial F}{\partial V}\\ & = k_BT\frac{\partial }{\partial V}\left(\ln V + \ln f(T)\right)\\ & = \frac{k_BT}{V} \end{align*} for a single particle.
In the canonical ensemble this is not a simple problem. Say I have only one electron. If I know that a particular state is occupied, then I immediately know that every other state is unoccupied. This means that the occupation numbers of the single particle states are entangled and I can't talk about the occupation of one state without dealing with all other states. If I add more electrons I get the same effect, only now you must make the total of your occupation numbers add up to $N$ rather than 1 and the combinatorics get much much worse.