Direct definition of density of states I've been studying statistical mechanics and in the book there's something the author calls density of states which he introduced in a kind of indirect way. Basically, the author argues that if we have a certain function of the wave vector $f(\mathbf{k})$ and we are dealing with a particle inside a container of volume $V$, if we need to sum this function, on the thermodynamic limit we can replace it by the integral
$$\sum_\mathbf{k} f(\mathbf{k})=\dfrac{\gamma V}{(2\pi)^3} \int_M d^{3}\mathbf{k} f(\mathbf{k})$$
then if the function $f$ just depends on the magnitude $k$ of the wave vector this integral simplifies, upon using $d^3\mathbf{k} = k^2 \sin\theta dkd\phi d\theta$
$$\dfrac{\gamma V}{(2\pi)^3} \int_M d^{3}\mathbf{k} f(\mathbf{k})=\dfrac{\gamma V}{(2\pi)^3}\int_0^\pi \int_0^{2\pi}\int_0^\infty f(k)k^2\sin \theta dkd\phi d\theta =\dfrac{4\pi\gamma V}{(2\pi)^3}\int_0^\infty f(k)k^2 dk$$
Now if the particle is free, we have $\epsilon = \dfrac{\hbar^2k^2}{2m}$ and then we can change variables to integrate in $\epsilon$. This gives
$$\dfrac{\gamma V}{(2\pi)^3} \int_M d^{3}\mathbf{k} f(\mathbf{k})=\gamma V\int_0^\infty D(\epsilon)f(\epsilon)d\epsilon$$
with $D(\epsilon) = \dfrac{(2m)^{3/2}}{(2\pi)^2\hbar^3}\epsilon^{1/2}$. This density of states appeared in a certain indirect way: after changing variables we collect everything into a function $D$.
Now, I imagine if we had another relation $\epsilon = \epsilon(k)$ we could use the same procedure to find another $D(\epsilon)$. In the same way, I imagine in two dimensions only the volume element would change.
In that way, what is there a more direct and general definition of $D(\epsilon)$? If so, how can it be derived and how can it be understood?
 A: In general, the density of states can be computed as follows:


*

*Find eigenstates of the Hamiltonian, $\psi_{s}$, so that $H\psi_s=E_s\psi_s$ (except in special cases, this is usually the hardest part).

*Compute $N(\epsilon)$, defined as the number of states $\psi_s$ with energy $E_s<\epsilon$. 

*$D(\epsilon)=\frac{dN}{d\epsilon}$ is the density of states. This can be interpreted as a distributional derivative, but usually you can smooth out $N(\epsilon)$ before taking the derivative without changing the thermodynamic behavior drastically (a famous exception to this is the Bose-Einstein condensate). 


For example, eigenstates of a free particle in 2D are labeled by two wave numbers, $k_x$ and $k_y$.  In a basis of sine waves, $k_x$ and $k_y$ have values $\frac{\pi n_{x}}{L},\frac{\pi n_y}{L}$, with $n_y,n_x\in\mathbb{N}$. Hence, each point on a grid of side length $\pi/L$ in the upper right quadrant of the plane represents a state (or states, with spin degrees of freedom). To compute $N(\epsilon)$, we first use 
$$
\epsilon=\frac{\hbar^2 }{2m}|\vec k|^2=\frac{\hbar^2\pi^2}{2mL^2}n_{max}^2,
$$
which implies $n_{max}\propto \sqrt\epsilon$. The number of states with energy less than $\epsilon$ is $N(\epsilon)=g\frac{\pi}{4}n_{max}^2\times\frac{\pi^2}{L^2}$ ($g$ is the degeneracy from internal degrees of freedom, such as spin), so $N(\epsilon)\propto\epsilon$ and $D(\epsilon)=\frac{dN}{d\epsilon}$ is constant.
Often the density of states is used by integrating over degenerate states in the following way:
\begin{align}
\int dsf(s)&=\int_{E_0}^\infty d\epsilon\int dsf(s)\delta(\epsilon-E_s)\\
&=\int_{E_0}^\infty d\epsilon N(\epsilon)\bar f(\epsilon),
\end{align}
where $\bar f(\epsilon)$ is an average of $f(s)$ over states with energy $\epsilon$ (typically $f(s)$ is chosen to depend on $s$ through $E_s$, in which case $\bar f(\epsilon)=f(\epsilon)$.
A: @Couchyam gave a very nice, detailed explanation. I'll just add that the density of states is just the continuum limit of the degeneracy of energy states. For a discrete system $\Omega\left(E \right)$ gives the number of microstates with energy $E$. When calculating average values of bulk thermodynamic properties, this acts as a weighting function. To find the average of some quantity $A$ in the canonical ensemble you compute
$$\langle A \rangle = \sum_i A_i \Omega \left(E_i \right) e^{-\beta E_i}$$
For a continuous system $D(E)dE$ gives the number of microstates within $dE$ of $E$. So your average of $A$ in a system with continuous states is
$$\langle A \rangle = \int A \left( E \right) D \left(E \right) e^{-\beta E} dE$$
though often you'll switch to a more convenient integration variable. 
So in short, the DOS is just a distribution that describes the density of energy states (wow, that sounds circular) in a system with continuous energy states.
