# Black body radiation energy density

In the derivation of energy density of a black body, we calculate the number of modes by solving the EM wave equation. In this case we get that $$n=\sqrt{n_x^2+n_y^2+n_z^2}$$ Here we divide $n$ in three coordination in $n$-space, $n_x$,$n_y$,and $n_z$. These are all integers as we took those constants in solving the EM wave equation using the boundary condition that at $x=a$, $E=0$.

So as we know that at the wall of the cavity the electric field is zero, so there will be a node if I consider the EM wave as standing wave. From wall to wall an EM wave must have two nodes at the two ends of an EM standing wave, so the length of the EM wave will be an integer multiple of half the wavelength, or $$L=n\lambda/2$$ Where $n$ is an integer.

So we can conclude that $n$, $n_x$, $n_y$, $n_z$ are all integers, but how can this be possible? If I say, for example, that $n_x=n_y=n_z=1$, then I have $n=\sqrt{3}$, which is not an integer.

So what is incorrect in the statement that all four constants $n$, $n_x$, $n_y$, and $n_z$ can't be integers simultaneously every time?

• $n$ does not have to be an integer, only $n_x, n_y, n_z$ have to be. – Raziman T V Dec 29 '16 at 17:48
• What?? Then how can there be nodes on wall? On the wall electric field is zero so we should get node there – user101134 Dec 29 '16 at 17:59
• Field would go like $\sin(2 \pi n_x x/L_x) \sin(2 \pi n_y y/L_y)\sin(2 \pi n_z z/L_z)$. You get nodes on all walls without $n$ itself being integral. – Raziman T V Dec 29 '16 at 18:05
• But L=nλ/2 so keeping two nodal point at two ends n must be integer there is no other option left – user101134 Dec 29 '16 at 18:12
• But what is $L$ if your box is rectangular, say? The only condition is that the component of the wave vector along a direction multiplied by the length along that direction be an integer. This gives you the integer constraints on $n_x, n_y, n_z$. Beyond these, there is no global constraint on $n$. – Raziman T V Dec 29 '16 at 18:16

You are generally solving (where $w = ct$ for some wave speed $c$), the equation $\partial_w^2 \phi = \nabla^2 \phi$ for a rectangular box with side-lengths $L_x, L_y, L_z.$ This is a linear partial differential equation, so we use our favorite trick, separation of variables. We assume that there are families of solutions $\phi_{ijk\ell} = W_i(w)~X_j(x)~Y_k(y)~Z_\ell(z)$ such that the general solution is given by a superposition, $$\phi(t, x, y, z) = \sum_{ijk\ell} c_{ijk\ell} ~\phi_{ijk\ell}(ct, x, y, z).$$Because the equation is linear it applies for each of the solutions individually and the equation becomes a set of ordinary one-variable derivatives:$$W''~X~Y~Z = W~X''~Y~Z + W~X~Y''~Z + W~X~Y~Z''.$$Dividing through by $WXYZ$ gives:$$W''/W = X''/X + Y''/Y + Z''/Z,$$and the argument is that since the rest of the expression is independent of $x$ therefore $X''/X = -k_x^2$ must be a constant independent of $x$ too.
We therefore solve each of these and find that $X_j(x)= \sin(\pi~j~x/L_x)$ etc. to be 0 on the walls at $x=0, x=L_x.$
By construction the resulting solution looks like $$\phi_{ijk\ell} = \sin(\omega_{jk\ell} t + \theta_i)~\sin(\pi~j~x/L_x) \sin(\pi~k~y/L_y) \sin(\pi~\ell~z/L_z)$$ which is zero on all of the boundaries. The frequency given for $\omega_{jk\ell}$ by the $W''/W = -k_x^2 - k_y^2 - k_z^2$ term, does not need to be similarly quantized because there is no time boundary condition that we're solving this over.