# Integrate: $\int_0^1 \mathrm{d}x_1 \int_0^1 \mathrm{d}x_2 \ldots \int_0^1 \mathrm{d}x_n \delta\left( \sum_{i=1}^n k_i x_i \right)$

Is there a closed form formula for this integral:

$$\int_0^1 \mathrm{d}x_1 \int_0^1 \mathrm{d}x_2 \ldots \int_0^1 \mathrm{d}x_n \delta\left( \sum_{i=1}^n k_i x_i \right)$$

where $\delta(x)$ is the Dirac delta function, and the $k_i$ are real numbers.

Here's how far I've got. Doing the integral on $k_n$ gives:

$$\frac{1}{|k_n|}\int_0^1 \mathrm{d}x_1 \int_0^1 \mathrm{d}x_2 \ldots \int_0^1 \mathrm{d}x_{n-1} \left[0\leq -\frac{1}{k_n}\sum_{i=1}^{n-1} k_i x_i \leq 1 \right]$$

where the brackets are Iverson brackets:

$$\left[P\right]= \begin{cases} 1 & \text{if }P\text{ is true }\\ 0 & \text{otherwise} \end{cases}$$

From here, I could calculate the appropriate limits of integration of $x_{n-1}$. But that seems like too much work, and I am not sure that I will get a closed form formula eventually as I keep going to $x_{n-2}$ and so on. I wonder if there is a simpler approach...

• Similar integrals (Dirichlt integrals) are dealt with in Jeffreys, Harold, and Bertha Jeffreys. Methods of mathematical physics. Cambridge university press, 1999., Sec. 15.08. – becko Jan 5 '18 at 16:48

## 4 Answers

$\delta(x)$ is not really a function in classical sense. For the purpose of deriving an expression without involving the concept of distribution, we will treat it as some sort of derivative of a step function. Assume all $k_i \ne 0$, let

$$\lambda_i = |k_i|,\quad y_i = \begin{cases}x_i,& k_i > 0\\1-x_i,& k_i < 0\end{cases}, \quad K = \left|\prod_{i=1}^n k_i \right| \quad\text{ and }\quad L = \sum_{k_i < 0} |k_i|$$

We have $$\delta\left( \sum_{i=1}^n k_i x_i \right) = \delta\left(\sum_{i=1}^n\lambda_i y_i - L\right) = \frac{d}{dL} \theta\left(L - \sum_{i=1}^n\lambda_i y_i\right)$$ where $\quad \displaystyle \theta(x) = \begin{cases} 1, &x > 0\\0, & x \le 0\end{cases}\quad$ is the step function. We can evaluate the integral as

\begin{align}\mathcal{I} =& \frac{d}{dL} \left[ \int_0^1 dy_1 \cdots \int_0^1 dy_n \theta\left( L - \sum_{i=1}^n \lambda_i y_i\right) \right]\\ =& \frac{d}{dL} \left[ \left( \int_0^\infty - \int_1^\infty \right) dy_1 \cdots \left( \int_0^\infty - \int_1^\infty \right) dy_n \theta\left( L - \sum_{i=1}^n \lambda_i y_i\right) \right]\\ =& \frac{d}{dL} \left[ \int_0^\infty dy_1 \cdots \int_0^\infty dy_n \sum_{0\le \epsilon_1, \ldots, \epsilon_n \le 1 } (-1)^{\sum_{i=1}^n \epsilon_i} \theta\left( \left(L - \sum_{i=1}^n\lambda_i\epsilon_i\right) - \sum_{i=1}^n \lambda_i y_i\right) \right] \end{align}

Notice the integral

$$\int_0^\infty dy_1\cdots\int_0^\infty dy_n \theta\left( X - \sum_{i=1}^n \lambda_i y_i\right)$$ is the volume of a simplex and equal to $\begin{cases}\frac{X^n}{n!K},& X > 0\\ \\0, &\text{otherwise}\end{cases}$, we have

\begin{align}\mathcal{I} =& \frac{1}{n!K} \frac{d}{dL} \left[ \sum_{0\le \epsilon_1, \ldots, \epsilon_n \le 1 } (-1)^{\sum_{i=1}^n \epsilon_i} \left(L - \sum_{i=1}^n\lambda_i\epsilon_i\right)^n \right]\\ =& \frac{1}{(n-1)!K} \sum_{0\le \epsilon_1, \ldots, \epsilon_n \le 1 } (-1)^{\sum_{i=1}^n\epsilon_i} \left(L - \sum_{i=1}^n\lambda_i\epsilon_i\right)^{n-1}\\ =& \frac{1}{(n-1)!K} \sum_{\stackrel{0\le \epsilon_1,\ldots,\epsilon_n \le 1;}{L - \sum_{i=1}^n \lambda_i\epsilon_i > 0} } (-1)^{\sum_{i=1}^n\epsilon_i} \left(L - \sum_{i=1}^n\lambda_i\epsilon_i\right)^{n-1} \end{align} A the end, $\mathcal{I}$ is a sum of polynomials of the form $\left(L - \text{ ???}\right)^{n-1}$ and the sum only runs over those $???$ which is smaller than $L$.

• The $\epsilon$ variables only take the values 0 and 1? They are not allowed to take fractional values in between, right? – becko Dec 18 '13 at 0:07
• @becko, right, the $\epsilon$ variables only take the values 0 or 1. – achille hui Dec 18 '13 at 6:13


• +1 Very nice! This reduces an $n$ variable integration to a single integration. It's not a closed formula, but at least is now numerically tractable. – becko Dec 18 '13 at 13:16
• Every integral from the second line on is divergent. – Did Jan 20 '14 at 18:37
• Understood in the sense of an oscillatory integral, right? en.wikipedia.org/wiki/Oscillatory_integral – Calvin Khor Jan 5 '18 at 15:42
• @CalvinKhor They seem related. My expression is useful whenever you want to get an asymptotic expression as $n \to \infty$. – Felix Marin Jan 5 '18 at 17:31
• For large $n$ this can probably be simplified more by the method of steepest descents? – becko Dec 4 '18 at 17:07

The integral looks like it's related to box splines. The idea of box splines is to express b-spline basis functions as areas of planar slices of hypercubes. John's comment has a good explanation of the quadratic case. As he said, you get a piecewise quadratic function which is (I think) a b-spline basis function. Look up box splines. You'll find papers by Carl deBoor, among others. The Wikipedia page here looks like a good introduction, and it has a long list of references.

Perhaps it's best to just look at what the integral expresses: does the image of the unit cube under the map $(x_1, \ldots, x_n) \mapsto \sum_i k_i x_k$ miss the origin (the answer is zero), or hit the origin, in which case the answer is the measure of the preimage of the origin under this map, i.e., the size of a certain hyperplane slice of the unit cube.

Sizes of slices of cubes are closely related to B-splines, so you might find that the resulting value is something related to the value (at the origin?) of some uniform B-spline whose control values are the $k_i$s, but the expression for that value is typically given recursively (by something like the deBoor algorithm), which isn't a "closed form" formula.

• The integral expresses the "volume" of the intersection of the hypercube $[0,1]^n$ with the hyperplane $\mathbf{x}\cdot\mathbf{k} = 0$.... Where can I find more information about the relation of B-splines to the measure of slices of cubes? – becko Dec 17 '13 at 19:01
• I have no idea. I picked it up on the streets. The main idea is this: Slice a unit cube with a plane perpendicular to the (0,0,0) to (1,1,1) axis. As you move from the plane hitting the origin only, to hitting three verts, the area of the slices grows like $t^2$, where $t$ is distance along the diagonal axis. Then you move more, towards hitting the next 3 verts, and the area rises and then falls, sort of like the graph of $1 - t^2$ between $-1/2$ and $1/2$. Then as you move towards (1,1,1), it falls off quadratically. You've built a 3-part piecewise quadratic curve that's $C^1$. Generalize. :) – John Hughes Dec 17 '13 at 23:02