Double and triple sum into integral with density of states
I asked this on mathematical forum section.
I'm triying to expand the results of certain calculation, where the author has the following kind of sums: $$ \sum_{j} A(\omega_j) n(\omega_j), $$ where $A$ and $n$ are analytic functions of the discrete variable $\omega_j$, and all the sums run from $0$ to $\infty$. Now, the author argues that he can passes from the discrete form to a continuum one by defining a density of states $g(\omega)$, so that $$ \sum_{j} A(\omega_j) n(\omega_j)\to\int_0^\infty d\omega g(\omega)A(\omega)n(\omega), $$ which is usual in this kind of calculations.
Now, in my expressions, I have the following kind of sums:
(i) $$ \sum_{j} A(\omega_j) n(\omega_j)\sum_{r\neq j}\omega_r n(\omega_r), $$ and
(ii) $$ \sum_{j} A(\omega_j) n(\omega_j)\sum_{r\neq j}\omega_r n(\omega_r)\sum_{s\neq j,s\neq r}\omega_s n(\omega_s), $$ How can I convert them into a integral form?
I was wondering if it has relation with the Kronecker delta, for example, for (i): $$ \sum_{j} A(\omega_j) n(\omega_j)\sum_{r\neq j}\omega_r n(\omega_r)=\sum_{j} A(\omega_j) n(\omega_j)\sum_{r}\omega_r n(\omega_r)(1-\delta_{rj})\ ?\to\int d\omega g(\omega)A(\omega)n(\omega)\int d\omega'g(\omega')\omega'n(\omega')\left[1-\delta(\omega'-\omega)\right] $$ and for (ii) $$ \sum_{j} A(\omega_j) n(\omega_j)\sum_{r\neq j}\omega_r n(\omega_r)\sum_{s\neq j,s\neq r}\omega_s n(\omega_s)=\sum_{j} A(\omega_j) n(\omega_j)\sum_{r}\omega_r n(\omega_r)(1-\delta_{rj})\sum_{s}\omega_s n(\omega_s)(1-\delta_{sr})(1-\delta_{sj})\ ?\to\int d\omega g(\omega)A(\omega)n(\omega)\int d\omega'g(\omega')\omega'n(\omega')\left[1-\delta(\omega'-\omega)\right]\int d\omega''g(\omega'')\omega''n(\omega'')\left[1-\delta(\omega''-\omega')\right]\left[1-\delta(\omega''-\omega)\right] $$
The above looks wrong for me, because I will have expressions like $$ \int d\omega d\omega'd\omega'' F(\omega)G(\omega')H(\omega'')\delta(\omega'-\omega)\delta(\omega''-\omega')\delta(\omega''-\omega)\ =\delta(0)\int d\omega d\omega'F(\omega)G(\omega')H(\omega')\delta(\omega'-\omega)\ =\delta(0)\int d\omega F(\omega)G(\omega)H(\omega), $$ then, the presence of $\delta(0)$ implies a infinity. 65