I'm walking out of a graduate quantum midterm kicking myself because I was asked to compute density of states as a function of energy for a spin $1/2$ particle of mass $m$ in a hard wall box of length $L$, subjected to a magnetic field of strength $h^z>0$, and I just had no idea where to begin. I was given the eigenergies:
$$E(n,\sigma^z)=K_n-h^z\sigma^z$$
where $K_n=\frac{\pi^2\hbar^2n^2}{2mL^2}$. I was supposed to set $\sigma^z=1$ initially, then combine $\sigma^z=\pm 1$ results to get the full picture. I know that a state $n$ should have wave number:
$$k=\frac{n\pi }{L}=\sqrt{\frac{2m (K_n-h^z)}{\hbar}}$$
And that I can put each $k$ in a $1$-D box of size $L/\pi$, but I don't where to go from there and worse I don't actually know what I'm doing. I know this important for figuring out transition rates, but I just don't understand the reasoning presented by either my professor or Sakurai.
Ideally, if someone could explain what density of states is mathematically (every source I see just say its the number of states in the energy interval $(E,E+dE)$, which is a statement I understand from a physical perspective but means nothing to me mathematically since I'm fairly positive $dE$ is not a differential form in the sense that I'm used to), and how one generally finds it given that we know the energies as function of $n$, that would be amazing.
I apologize for my ignorance, or if anything I've said is incorrect, quantum mechanics seems especially difficult for me for some reason.