# Calculation 8 - Gaussian integral?

This is a problem by @Ali Taghavi, a user of Math StackExangle, in his posting.

Let $\mathfrak{M}_2 (\Bbb{R})$ be the set of $2\times 2$ matrices with real entries. Using the identification $\mathfrak{M}_2 (\Bbb{R}) \simeq \Bbb{R}^{4}$ given by $$A = \begin{pmatrix} a & b \\ c & d \end{pmatrix} \quad \longleftrightarrow \quad (a, b, c, d),$$ we can equip this space with the Lebesgue measure $\mu$. Let $\mathcal{D}_r \subset \Bbb{R}^{4}$ be the $r$-ball in Euclidean norm. Then we can compute the following integral:

Proposition. For any $r > 0$ we have $$\label{calc8_iden_1} \int_{\mathcal{D}_r} e^{-A^2} \, \mu(dA) = \frac{\pi^2}{2}\left( e^{-r^2} - 1 + r^2 + \frac{r^4}{2} \right) I_2,$$ where $I_2$ is the identity matrix.
Our strategy is to expand the matrix exponentiation in power series and compute the integral of each resulting term. It turns out that certain combinatorial interpretation of matrix multiplication allows us an explicit formula for this term, which leads to \eqref{calc8_iden_1}.

Combinatorics of matrix multiplication. We focus on the $(i,j)$-entry of the power $A^m$. Obviously we have $$\label{calc8_iden_2} [A^m]_{ij} = \sum_{k_1, \cdots, k_{m-1}} a_{ik_1} a_{k_1 k_2} \cdots a_{k_{m-1} j}.$$ We can relate each term in this summation to the path of transitions $$\gamma = [i \to k_1 \to k_2 \to \cdots \to j]$$ on the state space $\{1, 2\}$. Denoting the corresponding term in \eqref{calc8_iden_2} by $a_{\gamma}$, the integral of \eqref{calc8_iden_2} over $\mathcal{D}_r$ can be written as $$\int_{\mathcal{D}_r} [A^m]_{ij} \, \mu(dA) = \sum_{\substack{ \gamma \, : \, i \to j \\ \mathrm{len}(\gamma) = m }} \int_{\mathcal{D}_r} a_{\gamma} \, \mu(dA).$$ Now we make a crucial observation. Notice that each $a_{\gamma}$ is a monomial of degree $m$. For the integral of $a_{\gamma}$ over $\mathcal{D}_r$ to be non-zero, we must have that the exponent of of $a, b, c$ and $d$ must be even. This happens exactly when $\gamma$ is a closed loop which uses every transition in even numbers. This forces that $m$ is even, that $i = j$, and that the exponent of $a_{12}$ and $a_{21}$ are equal. So it suffices to consider only diagonal entries of $A^{2m}$. Then we easily check that \begin{align} &\int_{\mathcal{D}_r} [A^{2m}]_{11} \, \mu(dA) \nonumber \\ &\hspace{3em} = \int_{\mathcal{D}_r} [A^{2m}]_{22} \, \mu(dA) \nonumber \\ &\hspace{3em} = \sum_{i+j+2k = m} \binom{2i+2k}{2i}\binom{2j+2k-1}{2j} \int_{\mathcal{D}_r} a^{2i}d^{2j}(bc)^{2k} \, \mu(dA). \label{calc8_iden_3} \end{align} Here the convention $\binom{-1}{0} = 1$ is used.

Another combinatorics. In order to compute \eqref{calc8_iden_3}, we first notice that $$\label{calc8_iden_4} \int_{\mathcal{D}_r} a^{2i}d^{2j}(bc)^{2k} \, \mu(dA) = \frac{(i-\frac{1}{2})!(j-\frac{1}{2})!(k-\frac{1}{2})!^2}{(m+2)!} r^{2m+4}.$$ There are many ways to compute this, but one may think of this as a generalization of beta function identity. Now use the relation $$( i - \tfrac{1}{2})! = \sqrt{\pi} \frac{(2i-1)!!}{2^i}$$ to rewrite \eqref{calc8_iden_3} as \begin{align*} \text{\eqref{calc8_iden_3}} &= \frac{\pi^2}{2^m (m+2)!} \sum_{i+j+2k = m} \binom{2i+2k}{2i}\binom{2j+2k-1}{2j} (2i-1)!! (2j-1)!! (2k-1)!!^2 \\ &= \frac{\pi^2}{2^m (m+2)!} \sum_{i+j+2k = m} \frac{(2i+2k)!}{2^{i+k}i!k!} \left( \frac{(2j+2k-1)!}{2^{j+k-1}j!(k-1)!} \mathbf{1}_{\{j+k>0\}} + \mathbf{1}_{\{j=k=0\}} \right) \\ &= \frac{\pi^2}{2^{2m} (m+2)!} \sum_{i+j+2k = m} \frac{(2i+2k)!}{i!k!} \left( 2 \frac{(2j+2k-1)!}{j!(k-1)!} \mathbf{1}_{\{j+k>0\}} + \mathbf{1}_{\{j=k=0\}} \right). \end{align*} Now substituting $a = i+k$ and $b = j+k$, we have \begin{align*} \text{\eqref{calc8_iden_3}} &= \frac{\pi^2}{2^{2m} (m+2)!} \sum_{a+b = m} \sum_k \frac{(2a)!}{(a-k)!k!} \left( 2 \frac{(2b-1)!}{(b-k)!(k-1)!} \mathbf{1}_{\{b>0\}} + \mathbf{1}_{\{b=k=0\}} \right) \\ &= \frac{\pi^2}{2^{2m} (m+2)!} \sum_{a+b = m} \sum_k \frac{(2a)!}{a!} \binom{a}{k} \left( \frac{(2b)!}{b!} \binom{b-1}{k-1} \mathbf{1}_{\{b>0\}} + \mathbf{1}_{\{b=k=0\}} \right). \end{align*} Notice that we have the following identity $$\sum_{k=0}^{\infty} \binom{a}{k} \binom{b-1}{k-1} = \binom{a+b-1}{a-1}$$ when $b > 0$. Indeed, both sides are the coefficient of $x^a$ in the polynomial $(x+1)^a \cdot x(x+1)^{b-1}$. Plugging this back, we have \begin{align*} \text{\eqref{calc8_iden_3}} &= \frac{\pi^2}{2^{2m} (m+2)!} \sum_{a+b = m} \frac{(2a)!}{a!} \left( \frac{(2b)!}{b!} \frac{(a+b-1)!}{(a-1)!b!} \mathbf{1}_{\{b>0\}} + \mathbf{1}_{\{b=0\}} \right) \\ &= \frac{\pi^2}{2^{2m} (m+2)!} \left( (m-1)! \mathbf{1}_{\{m>0\}} \sum_{a+b = m} a \binom{2a}{a}\binom{2b}{b} \mathbf{1}_{\{b>0\}} + \frac{(2m)!}{m!} \right). \end{align*} This quantity can be computed using generating function method, as in this posting. And it turns out that $$\text{\eqref{calc8_iden_3}} = \begin{cases} \pi^2 / 2, & m = 0 \\ \pi^2/2(m+1)(m+2), & m > 0 \end{cases}.$$ Plugging this to the power series expansion $$\int_{\mathcal{D}_r} e^{-A^2} \, \mu(dA) = I_2 \sum_{m=0}^{\infty} \frac{(-1)^m}{m!} \int_{\mathcal{D}_r} [A^{2m}]_{11} \, \mu(dA)$$ yields the desired formula \eqref{calc8_iden_1} as desired.

## Remark.

1. Since this computation gives a complete result for $\int_{\mathcal{D}_r} A^n \, \mu(dA)$, we may as well compute the integral of other analytic functions of $A$.
2. It may be possible to extend this methodology to higher dimensions, though the combinatorics becomes highly complicated even for $3\times3$ matrices.

# Calculation 7 - A triple gaussian integral

Here we calculate a triple integral involving Gaussian kernels. The integral presented here admits an elementary solution. However, we introduce a slightly exotic technique that may possibly be useful for other classes of integrals.

Proposition For $\alpha, \beta, \gamma > 0$ we have $$\label{iden_1} \int_{-\infty}^{\infty} dx \int_{-\infty}^{x} dy \int_{-\infty}^{y} dz \, e^{-\alpha x^2} e^{-\beta y^2} e^{-\gamma z^2} = \sqrt{ \frac{\vphantom{b} \pi}{4\alpha\beta\gamma} } \operatorname{arccos}\sqrt{\frac{\vphantom{b} \alpha\gamma}{(\beta+\alpha)(\beta+\gamma)}}.$$
Our strategy is as follows.
1. We first transform our integral into a simpler form. The result is that the integral is written in terms of a two-variable function $F(x, y)$ which we will define.
2. Secondly, we will check that the value of $F$ remains constant along a 1-parameter family of algebraic curves $\{ Z_c \}$. In other words, we will identify the equation of level sets $Z_c$ of $F$.
3. The previous step means that $F$ is in fact a function of level sets $Z_c$, or equivalently, of the parameter $c$. We finish the proof by representing $F$ as a single-variable function of $c$. Then \eqref{iden_1} will follow from this representation.

Reduction of integral. Introduce functions $E(x)$, $E^*(x)$ and $F(x)$ by $$E(x) := \int_{-\infty}^{x} dt \, e^{-t^2}, \qquad E^*(x) := \int_{x}^{\infty} dt \, e^{-t^2}$$ and $$F(x, y) := \int_{-\infty}^{\infty} dt \, e^{-t^2} E^*(\sqrt{x}t) E(\sqrt{y}t).$$ Using the Fubini's theorem to interchange the order of the first two integrals, we have \begin{align*} &\int_{-\infty}^{\infty} dx \int_{-\infty}^{x} dy \int_{-\infty}^{y} dz \, e^{-\alpha x^2} e^{-\beta y^2} e^{-\gamma z^2} \\ &\hspace{4em} = \iint_{y < x} dxdy \left( e^{-\alpha x^2} e^{-\beta y^2} \int_{-\infty}^{y} dz \, e^{-\gamma z^2} \right) \\ &\hspace{4em} = \int_{-\infty}^{\infty} dy \, e^{-\beta y^2} \left( \int_{y}^{\infty} dx \, e^{-\alpha x^2} \right) \left( \int_{-\infty}^{y} dz \, e^{-\gamma z^2} \right). \end{align*} Applying the substitution $\sqrt{\alpha} x \mapsto x$, $\sqrt{\beta} y \mapsto y$ and $\sqrt{\gamma} z \mapsto z$, the last integral reduces to $$\label{iden_2} \int_{-\infty}^{\infty} dx \int_{-\infty}^{x} dy \int_{-\infty}^{y} dz \, e^{-\alpha x^2} e^{-\beta y^2} e^{-\gamma z^2} = \frac{1}{\sqrt{\alpha\beta\gamma}} F(\alpha/\beta, \gamma/\beta).$$

Level sets of $F(x, y)$. The last step tells us that it suffices to evaluate $F(x, y)$. To this end, we investigate the level set of the function $F$. On this level set, we have $$0 = dF(x, y) = \frac{\partial F}{\partial x} \, dx + \frac{\partial F}{\partial y} \, dy.$$ And by a simple calculation, we find that $$\frac{\partial F}{\partial x} = - \int_{-\infty}^{\infty} dt\, \frac{t}{2\sqrt{x}} e^{-(x+1)t^2} E(\sqrt{y}t) = -\frac{\sqrt{\pi xy}}{4\sqrt{x+y+1}} \frac{1}{x(x+1)}$$ and likewise $$\frac{\partial F}{\partial y} = \int_{-\infty}^{\infty} dt\, \frac{t}{2\sqrt{y}} e^{-(y+1)t^2} E^*(\sqrt{x}t) = -\frac{\sqrt{\pi xy}}{4\sqrt{x+y+1}} \frac{1}{y(y+1)}.$$ Thus cancelling out the common factor, the equation $0 = dF$ reduces to $$0 = \frac{dx}{x(x+1)} + \frac{dy}{y(y+1)}.$$ Integrating both sides, we find that the level set is of the form $$\label{iden_3} Z_c \ : \ \frac{xy}{(x+1)(y+1)} = c$$ for some constant $0 < c < 1$.

Calculation of $F(x, y)$. The previous step implies that $F$ can be written as a function of $c$, and we do so in the sequel. Let $0 < c < 1$ and consider points $(x, y) \in Z_c$. Taking $y \to \infty$ along the curve $Z_c$, we find that

• $E(\sqrt{y}t)$ converges to $\sqrt{\pi}\mathbf{1}_{(0, \infty)}(t)$ a.e. and
• $x$ converges to $c/(1-c)$.
Since both $E(t)$ and $E^*(t)$ are uniformly bounded by $\sqrt{\pi}$, we can apply the dominated convergence theorem. Consequently, for $(x, y) \in Z_c$, the function $F(x, y) = F(c)$ reduces to $$F(x, y) = F(c) = \sqrt{\pi} \int_{0}^{\infty} dt \, e^{-t^2} E^*\left(\sqrt{\frac{c}{1-c}} t \right).$$ The last integral can be calculated by polar coordinates. Indeed, let us write $c = \cos^2 \theta_0$. Then we have \begin{align*} F(c) &= \sqrt{\pi} \int_{0}^{\infty} dt \, e^{-t^2} E^*(t \cot \theta_0 ) \\ &= \sqrt{\pi} \iint_{0 \leq t < s \tan \theta_0} dtds \, e^{-(t^2+s^2)} \\ &= \sqrt{\pi} \int_{0}^{\theta_0} d\theta \int_{0}^{\infty} dr \, r e^{-r^2} \\ &= \frac{\sqrt{\pi}}{2} \operatorname{arccos}\sqrt{c}. \end{align*} Plugging this back to \eqref{iden_2} completes the proof.

# 잡스러운 계산 하나

이런저런 장난질을 하다가 증명한 식인데, 잊어먹긴 아깝고 어디 갖다쓰기도 좀 그렇고 해서 그냥 포스팅으로 남깁니다.

Proposition. For all $x \in \Bbb{C}$ and $|z| < 1$, we have $$\sum_{n=0}^{\infty} (-1)^n \frac{(x-n)\cdots(x+n)}{(2n+1)!} (2z)^{2n} = \frac{\sin(2x\arcsin z)}{\sin(2\arcsin z)}.$$ Here, the product $(x-n)\cdots(x+n)$ denotes $\prod_{k=-n}^{n} (x-k)$.

증명은 좌변에 적당히 감마함수의 적분 표현을 때려박고 잘 정리한 다음 residue 계산을 하면 됩니다. 어쨋거나 우변이 대충 Dirichlet kernel 처럼 생겼으니, 운이 좋으면 나중에 어딘가 써먹을 수 있겠다는 막연한 생각이 듭니다.

뉴턴 시대에 이미 증명된 등식이었군요. [참고]