# Density of states (treating states in continuum)

If we have a particle in a 3D infinite square well box, with length $L$, e.g. an electron in a conduction metal.

By solving the Time independent Schrodinger equation, we can get the formula of $$k^2=(n_x^2+n_y^2+n_z^2)\pi^2 / L ^2$$

Now each state occupies a volume of $(\pi/L)^3$

I don't get why we need to use the density of states, considering that at the bottom of the infinite square well, the energy levels are discrete, and in higher energy levels, there are more states than the bottom. Does that mean we shouldn't use density of states for the lower energy levels region?

My professor split the the whole system into ($e^j$) levels, where each level ($e^j$) was individual energy level was smeared by ($g^j$) states i.e. there are $g^j$ number of them, where $j$ is the superscript denoting the number of level it is in.

E.g. 10 energy levels At $j=1$ there are $g^1=10$ levels where $g^1 = 10$ I still couldn't get why they can treat it using a continuum?

$$U = \sum_{s \in \text{states}} \varepsilon(s) f(\varepsilon(S), T)$$ where $f(s,T)$ is the probability that state $s$ is occupied when the system has temperature $T$.
Now this sum is often very inconvenient to compute. BUT if you know the density of states, $\rho(\varepsilon)$ you can write this as $$U = \int_{-\infty}^\infty d\varepsilon \rho(\varepsilon) \varepsilon f(\varepsilon, T)$$
Sure, the energy levels are discrete, but in your example, their "distance" in $k$-space is given by $\pi/L$, so for large systems, the distance becomes negligible. This is exactly what you'd do in calculus to go from a sum to an integral.