Page 4 of the textbook Quantum Field Theory and the Standard Model by Schwartz says the following:
The incompatibility of observations with the classical prediction led Planck to postulate that the energy of each electromagnetic mode in the cavity is quantised in units of frequency:
$$E_n = \hbar \omega_n = \dfrac{2\pi}{L} \hbar |\vec{n}| = |\vec{p}_n|,$$
where $h$ is the Planck constant and $\hbar \equiv \dfrac{h}{2\pi}$.
On page 5, the author then goes on to say the following:
Now let us take the continuum limit, $L \to \infty$. In this limit, the sums turn into integrals and the average total energy up to frequency $\omega$ in the blackbody is
$$\begin{align} E(\omega) &= \int^\omega d^3 \vec{n} \dfrac{\hbar \omega_n}{e^{\hbar \omega_n \beta} - 1} \\ &= \int_{-1}^{1} d \cos(\theta) \int^{2\pi}_0 d \phi \int_0^\omega d |\vec{n}| \dfrac{|\vec{n}|^2 \hbar \omega_n}{e^{\hbar \omega_n \beta} - 1} \\ &= 4 \pi \hbar \dfrac{L^3}{8\pi^3} \int_0^\omega d\omega' \dfrac{\omega'^3}{e^{\hbar \omega' \beta} - 1} \end{align}$$
I have a couple of questions about this:
How did the author get from $\int^\omega d^3 \vec{n} \dfrac{\hbar \omega_n}{e^{\hbar \omega_n \beta} - 1}$ to $\int_{-1}^{1} d \cos(\theta) \int^{2\pi}_0 d \phi \int_0^\omega d |\vec{n}| \dfrac{|\vec{n}|^2 \hbar \omega_n}{e^{\hbar \omega_n \beta} - 1}$?
How did the author get from $\int_{-1}^{1} d \cos(\theta) \int^{2\pi}_0 d \phi \int_0^\omega d |\vec{n}| \dfrac{|\vec{n}|^2 \hbar \omega_n}{e^{\hbar \omega_n \beta} - 1}$ to $4 \pi \hbar \dfrac{L^3}{8\pi^3} \int_0^\omega d\omega' \dfrac{\omega'^3}{e^{\hbar \omega' \beta} - 1}$?
I would greatly appreciate it if people could please take the time to clarify this.
1.My understanding is that one assumption you do is isotropy, that is you don't care in what orientation the radiation goes ($\omega(r,\theta,\varphi)=\omega(r)$), so it is more more natural to use a sphere as your blackbody instead of a cube or other surface and accordingly use spherical coordinates instead of other coordinates, making use of its radial symmetry as has been pointed in the comments ($\omega(\sqrt{x^2+y^2+z^2})=\omega(r)$).
Usually integrating over $d^3 x$ doesn't make much sense but you integrate three times when going over the infinitesimal of volume $dV=dx\cdot dy \cdot dz$ so $d^3 \vec{n}$ should be understand I believe also as a shorthand notation for volume in this case for spherical coordinates so $$d^3 \vec{n}=dV=r^2 \sin(\theta)d\theta d \phi d r\ (=d(-r\cos(\theta)) \cdot d(r\phi) \cdot d r), $$ so integrating one could see what the notation $\int^\omega d^3 \vec{n}$ means $$\int^\omega d^3 \vec{n}=\int_V dV=\int\limits_{\theta=0}^{\pi}\int\limits_{\varphi=0}^{2 \pi}\ \int\limits_{w'=0}^{w} r^2 \sin(\theta)d\theta d \phi d r=\int\limits_{\theta=0}^{\pi}d(-\cos(\theta))\int\limits_{\varphi=0}^{2 \pi}d\phi\ \int\limits_{w'=0}^{w} r^2 d r. $$ (From what I can see from amazon the book does a mistakes when writing $\int_{-1}^{1} d \cos(\theta)$instead of $\int_{0}^{\pi} d (-\cos(\theta))$).
2.As you wrote $\hbar \omega_n = \dfrac{2\pi}{L} \hbar |\vec{n}|$ or simply $|\vec{n}|=\dfrac{L}{2\pi}\omega_n$ and from this you have two things, that $d|\vec{n}|= \dfrac{L}{2\pi}d\omega_n$ and also that $|\vec{n}|^2=\dfrac{L^2}{4\pi^2}\omega_n^2$ and multiplying this last two you get $d |\vec{n}| |\vec{n}|^2=\dfrac{L^3}{8\pi^3}\omega_n^2 d\omega_n$, and so you can verify the result, $$E(\omega)= \int^\omega d^3 \vec{n} \dfrac{\hbar \omega_n}{e^{\hbar \omega_n \beta} - 1} = \int_{0}^{\pi} d(-\cos(\theta)) \int^{2\pi}_0 d \phi \int_0^\omega d |\vec{n}| \dfrac{|\vec{n}|^2 \hbar \omega_n}{e^{\hbar \omega_n \beta} - 1}=4\pi\hbar \int_0^\omega d |\vec{n}| \dfrac{|\vec{n}|^2 \omega_n}{e^{\hbar \omega_n \beta} - 1}= 4 \pi \hbar \dfrac{L^3}{8\pi^3} \int_0^\omega d\omega_n \dfrac{\omega_n^3}{e^{\hbar \omega_n \beta} - 1}= 4 \pi \hbar \dfrac{L^3}{8\pi^3} \int_0^\omega d\omega' \dfrac{\omega'^3}{e^{\hbar \omega' \beta} - 1}$$ (From what I can see from amazon you did a mistake when writing $\int_0^\omega d\omega' \dfrac{\omega'}{e^{\hbar \omega' \beta} - 1}$instead of $\int_0^\omega d\omega' \dfrac{\omega'^3}{e^{\hbar \omega' \beta} - 1}$).