Integral with delta functions I have an integral:
$$ I_N=\int_{-\infty}^\infty   \frac{ \sum_{i=1}^N \alpha_i x_i^2 }{ \sum_{i=1}^N x_i^2}   \prod_{j=1}^N \delta(x_j) dx_j, $$
where $\delta$ is the Dirac delta function.
I'm not quite sure how to get the correct result for this integral. 
I suspect the result should be something like $I_N = \frac{1}{N} \sum_i^N a_i$,
but I can't seem to get the 1/N factor right.
As simple examples we have 
$$
I_1 = \alpha_1 \int_{-\infty}^\infty \delta(x) dx = \alpha_1, \\
I_2 = \int_{-\infty}^\infty \frac{\alpha_1 x_1^2 + \alpha_2 x_2^2}{x_1^2 + x_2^2} \delta(x_1) \delta(x_2) dx_1dx_2 = a_1+ a_2 ~~ ( ? ), 
$$
but I'm already stuck on $I_2$ case. Seems that splitting the 
integrand or not would give me different results. How do I proceed??? 
 A: Taking a geometric approach is a bit tedious, but it seems to give the desired result. I'll frequently use the volumes and surfaces of N-spheres and N-balls throughout this computation.
The object you are integrating is a ratio of two quadratic forms, so we can write it compactly using slightly different notation.
$$\int_{\mathbb R^N}\frac{\vec x^TA\vec x}{\vec x^T\vec x}\delta(\vec x)d\vec x$$
Where $A$ is a diagonal matrix whose diagonal entries are $\alpha_i$, and $\delta$ is a multivariate Dirac delta function. Ordinarily, we could evaluate the integral using the properties of the Dirac delta (often, the equality below is used as a definition):
$$\vec 0\in D\implies\int_Df(\vec x)\delta(\vec x)d\vec x=f(\vec 0)$$
However, in this case $f(0)$ is undefined. This means that we can't generally consider this integral to be well-defined. Luckily, since the rational function of integration is bounded and continuous almost everywhere, we can still integrate it over regions containing the origin, but we'll have to treat the delta a bit more carefully (and perhaps a bit less rigorously).
To begin with, consider the surface of an $N$-sphere or radius $R$ centered at the origin, which I'll denote $\Sigma(R)$, with an associated $N-1$ dimensional volume differential $d\sigma$. We know the volume of this region is the surface volume of an $N$-sphere.
$$\int_{\Sigma(R)}d\sigma=S_{N-1}R^{N-1}$$
Where $S_{N-1}=\frac{2\pi^{N/2}}{\Gamma(N/2)}$ is the sphere surface constant. Since $\vec x\cdot\vec x= R^2$ everywhere in $\Sigma(R)$, we can write the following integral.
$$\int_{\Sigma(R)}\vec x\cdot\vec x\ d\sigma=S_{N-1}R^{N+1}$$
Using Euclidean coordinates:
$$\int_{\Sigma(R)}(x_1^2+x_2^2+...+x_N^2)d\sigma=S_{N-1}R^{N+1}$$
$$\int_{\Sigma(R)}x_1^2\ d\sigma+\int_{\Sigma(R)}x_2^2\ d\sigma+...+\int_{\Sigma(R)}x_N^2\ d\sigma=S_{N-1}R^{N+1}$$
Due to symmetry, we know each of the integrals must have the same value.
$$\int_{\Sigma(R)}x_i^2\ d\sigma=\frac{S_{N-1}}{N}R^{N+1}\tag{1}$$
With this identity, we can integrate our function on $\Sigma(R)$.
$$\int_{\Sigma(R)}\frac{\vec x^TA\vec x}{\vec x^T\vec x}d\sigma$$
The denominator is is the constant $R^2$ everywhere in $\Sigma(R)$.
$$=\frac{1}{R^2}\int_{\Sigma(R)}\vec x^TA\vec x\ d\sigma$$
$$=\frac{1}{R^2}\int_{\Sigma(R)}(\alpha_1x_1^2+\alpha_2x_2^2+...+\alpha_Nx_N^2)d\sigma$$
Now we just have a linear combination of the integrals from $(1)$.
$$\int_{\Sigma(R)}\frac{\vec x^TA\vec x}{\vec x^T\vec x}d\sigma=\frac{\sum_{i=1}^N\alpha_i}{N}S_{N-1}R^{N-1}\tag{2}$$
This essentially tells us that the average value of the rational function on $\Sigma(R)$ is the constant $\frac{\sum_{i=1}^N\alpha_i}{N}$ for any $R>0$. Now if we let $B(R)$ be a ball of radius $R$ centered at the origin, we can integrate the rational function on $B(R)$ by switching to polar coordinates.
$$\int_{B(R)}\frac{\vec x^TA\vec x}{\vec x^T\vec x}d\vec x=\int_0^R\int_{\Sigma(r)}\frac{\vec x^TA\vec x}{\vec x^T\vec x}d\sigma\ dr$$
Using $(2)$:
$$=\frac{\sum_{i=1}^N\alpha_i}{N}\int_0^RS_{N-1}r^{N-1}dr$$
The integral is simply the volume of an $N$-sphere, which we can write using the volume constant $V_N=\frac{\pi^{N/2}}{\Gamma(N/2+1)}$.
$$\int_{B(R)}\frac{\vec x^TA\vec x}{\vec x^T\vec x}d\vec x=\frac{\sum_{i=1}^N\alpha_i}{N}V_Nr^N\tag{3}$$
We can think of the Dirac delta as the limit of a sequence of symmetric distributions centered about the origin that integrate to $1$. In particular, consider the following set of distributions:
$$\Delta_R(\vec x)=\begin{cases}
\frac{1}{V_NR^N} & \vec x\in B(R) \\
0                & \vec x\notin B(R)
\end{cases}$$
Each of these has the properties mentioned above, and additionally they become increasingly localized around the origin as $R\to 0^+$. Because of this, I'll claim that the following definition is equivalent to the other definitions of the multivariate Dirac delta. (this can be justified more thoroughly, but I'll just note that both will converge to $f(\vec 0)$, provided $f$ is continuous there.)
$$\int_Df(\vec x)\delta(\vec x)d\vec x\equiv\lim_{R\to 0^+}\int_Df(\vec x)\Delta_R(\vec x)d\vec x$$
Importantly, this definition no longer requires that $f$ be continuous at $\vec 0$. We can therefore use it to evaluate the integral of interest.
$$\int_{\mathbb R^N}\frac{\vec x^TA\vec x}{\vec x^T\vec x}\delta(\vec x)d\vec x=\lim_{R\to 0^+}\int_{\mathbb R^N}\frac{\vec x^TA\vec x}{\vec x^T\vec x}\Delta_R(\vec x)d\vec x$$
$$=\lim_{R\to 0^+}\frac{1}{V_NR^N}\int_{B(R)}\frac{\vec x^TA\vec x}{\vec x^T\vec x}d\vec x$$
Noticing that the integral above appears in $(3)$:
$$=\lim_{R\to 0^+}\frac{\sum_{i=1}^N\alpha_i}{N}$$
$$\int_{\mathbb R^N}\frac{\vec x^TA\vec x}{\vec x^T\vec x}\delta(\vec x)d\vec x=\frac{\sum_{i=1}^N\alpha_i}{N}$$
The reason this result is "not rigorous" is because treating the Dirac delta as a limit of distributions is very problematic here. If $f$ is continuous at the origin then the equality
$$\int_Df(\vec x)\delta(\vec x)d\vec x=\lim_{R\to 0^+}\int_Df(\vec x)\Delta_R(\vec x)d\vec x$$
holds or a wide class of well-behaved distributions. However, when we allow $f$ to be discontinuous at the origin, different distributions will give different results. In general, I believe the following can be derived.
$$\liminf_{\epsilon\to 0^+}\{f(\vec x):|\vec x|<\epsilon\}\le\lim_{R\to 0^+}\int_Df(\vec x)\Delta_R(\vec x)d\vec x\le\limsup_{\epsilon\to 0^+}\{f(\vec x):|\vec x|<\epsilon\}$$
Thus a different choice of distributions could have resulted in a result of $\min\{\alpha_i\}$ or $\max\{\alpha_i\}$. If we arbitrarily limit ourselves to spherically symmetric distributions, the definition is no longer inconsistent, but we now aren't talking about the standard delta function, but an entirely new function that no longer "sees" $f(0)$, but instead the spherically symmetric average of $f$ in the vicinity of $0$. This function is equivalent to the delta for continuous functions and defined for all locally bounded almost everywhere continuous function. By using it, we aren't computing the integral you posed (which is ill-defined), but rather a very similar looking, but arbitrarily chosen integral. Whether this result is useful at all depends on where the integral comes from.
A: I am afraid any quantity such as $$ I_N=\int_{-\infty}^\infty   \frac{ \sum\limits_{i=1}^N \alpha_i x_i^2 }{ \|x\|^2}   \prod_{j=1}^N \delta(x_j) dx_j $$ where $$\|x\|^2=\sum\limits_{i=1}^N x_i^2$$ can only be given a meaning by awfully nonrigorous methods since the function to be integrated, namely, $$\frac{ \sum\limits_{i=1}^N \alpha_i x_i^2 }{\|x\|^2}$$ is not even defined at the unique point which is "seen" by the Dirac measure, being given at this point by a typical undeterminate ratio $$\frac00$$
However... let us agree that this undefined quantity satisfies the following three properties, which seem rather minimal requisites for any meaningful interpretation of $I_N$:


*

*By symmetry, for every $1\leqslant i\ne k\leqslant N$, $$\int_{-\infty}^\infty   \frac{ x_i^2 }{\|x\|^2}   \prod_{j=1}^N \delta(x_j) dx_j=\int_{-\infty}^\infty   \frac{ x_k^2 }{\|x\|^2}   \prod_{j=1}^N \delta(x_j) dx_j$$

*By linearity, $$\int_{-\infty}^\infty   \frac{ \sum\limits_{i=1}^N \alpha_i x_i^2 }{\|x\|^2}   \prod_{j=1}^N \delta(x_j) dx_j=\sum_{i=1}^N\alpha_i\int_{-\infty}^\infty   \frac{x_i^2 }{\|x\|^2}   \prod_{j=1}^N \delta(x_j) dx_j$$

*By pure logic, $$\int_{-\infty}^\infty   \frac{ \sum\limits_{i=1}^N x_i^2 }{\|x\|^2}   \prod_{j=1}^N \delta(x_j) dx_j=\int_{-\infty}^\infty   \frac{\|x\|^2} {\|x\|^2}  \prod_{j=1}^N \delta(x_j) dx_j=1$$


Then, using only 1.-2.-3., one can easily "prove" that $$I_N=\frac1N\sum_{i=1}^N\alpha_i$$
