Call E=ℏω.
By introducing the energy-density of oscillators
g(E)= E²V/(π² ℏ3 c3),
one can replace the four summations with one integration:
U =
V ∫0∞ u(E,T) dE ,
where
the
energy density per unit volume and per spectral energy interval
u(E,T)
= π-2 ℏ-3 c-3
E3/[exp(E/kBT) -1] .
This integration can be performed analytically, to get the total thermal
equilibrium energy density of the electromagnetic fields
U/V =
π2(kBT)4/(15ℏ3c3).