I have a problem in which I have to compute the following integral: $$\mathop{\idotsint\limits\_{\mathbb{R}^k}}\_{\sum\_{i=1}^k y\_i=x} e^{-N^2r(\sum\_{i=1}^k y\_i^2-\frac{1}{k}x^2)} dy\_1\dots dy\_k,$$
where this notation means that I want to integrate over $\mathbb{R}^k$ restricted to the plane where $\sum\_{i=1}^k y\_i=x$ (a convolution of gaussians) and $N$ and $r$ are positive real constants. I have tried two different methods for computing this integral, but they are yielding different results. I would appreciate it very much if someone could take a look and tell me what I'm doing wrong.


**Method 1**


In method 1 I just wrote it as
$$\mathop{\idotsint\limits\_{\mathbb{R}^k}}\_{\sum\_{i=1}^{k}y\_i=x} e^{-N^2r(\sum\_{i=1}^{k}y\_i^2-\frac{1}{k}x^2)} dy\_1\dots dy\_k =\int\_{-\infty}^{\infty}\dots\int\_{-\infty}^\infty e^{-N^2r((x-y\_1)^2+\sum\_{i=1}^{k-2}(y\_i-y\_{i+1})^2+y\_{k-1}^2-\frac{1}{k}x^2)} \, dy\_1\dots dy\_{k-1}=\sqrt{\frac{1} {\pi r^{k-1}k}} \frac{\pi^k}{N^{k-1}}$$


I deduced this formula by induction, first integrating in $y\_{k-1}$, then $y\_{k-2}$ and so on.


**Method 2**


In method 2 I tried writting the function in a matrix form $$\mathop{\idotsint\limits\_{\mathbb{R}^k}}\_{\sum\_{i=1}^{k}y\_i=x} e^{-N^2r(\sum\_{i=1}^{k}y\_i^2-\frac{1}{k}x^2)} dy\_1\dots dy\_{k}=\mathop{\idotsint\limits\_{\mathbb{R}^k}}\_{\sum\_{i=1}^{k}y\_i=x} e^{-N^2r(\vec{y},Q\vec{y})} dy\_1\dots dy\_{k}$$
where \begin{equation}
Q:=\left(\begin{array}{cccccccc}
(1-\frac{1}{k})& -\frac{1}{k} & -\frac{1}{k} & \cdots & -\frac{1}{k} \\
-\frac{1}{k} & (1-\frac{1}{k}) & -\frac{1}{k} & \cdots & -\frac{1}{k} \\
\vdots & \ddots & & &\vdots \\
-\frac{1}{k} & \dots & &-\frac{1}{k} &(1-\frac{1}{k}) 
\end{array}\right).
\end{equation}


This matrix $Q$ has eigenvalues $\lambda\_0=0$, $\lambda\_l=1$ and corresponding normalized eigenvetors \begin{equation}
\vec{\lambda}\_l=\frac{1}{\sqrt{k}}\left(\begin{array}{c}
1 \\
e^{\frac{2\pi i}{k}1l} \\
\vdots \\
e^{\frac{2\pi i}{k}(k-1)l}
\end{array}\right) 
\end{equation} for $0\le l\le k-1$.


As I understand it, the restriction in the integral means that I shouldn't integrate in the $\lambda\_0$ direction, since in this direction I must have all components equal, and the only place where the components are equal and the bound is satisfied is $(\frac{x}{k},\dots,\frac{x}{k})$. So my integration should occour in the orthogonal complement of this vector, which is a hyperplane of dimension $k-1$. Everything seems to check to this point, so I diagonalized the matrix $Q=U\Lambda U^{-1}$ and so


$$(\vec{y},Q\vec{y})=(\vec{\xi},\Lambda\vec{\xi})=\sum\_{i=1}^{k-1}\xi\_i^2.$$


The change of variables $\vec{\xi}=U^{-1}\vec{y}$ has a Jacobian $\frac{1}{\sqrt{k^{k-1}}}$, since $U^{-1}$ is the DFT matrix times $\frac{1}{\sqrt{k^{k-1}}}$ and the DFT matrix is known to be unitary. So


$$\mathop{\idotsint\limits\_{\mathbb{R}^k}}\_{\sum\_{i=1}^{k}y\_i=x} e^{-N^2r(\vec{y},Q\vec{y})} dy\_1\dots dy\_{k}=\idotsint\limits\_{\mathbb{R}^k} e^{-N^2r\sum\_{i=1}^{k-1}\xi\_i^2} \frac{1}{\sqrt{k^{k-1}}}d\xi\_1\dots d\xi\_{k-1}= \sqrt{\frac{\pi^{k-1}}{k^{k-1}r^{k-1}}}\frac{1}{N^{k-1}}.$$


These two results are different and I cannot figure out why.


Thank you all in advance for your help!



Change of variables in a Gaussian integral in matrix form
$\newcommand\R{\mathbb R}\newcommand\1{\mathbf1}$When you say "I want to integrate over $\mathbb{R}^k$ restricted to the plane where $\sum\_{i=1}^{k}y\_i=x$", you have to specify the measure over the plane over which you want to integrate.


It appears you want this measure to be induced by the Lebesgue measure on $\R^k$. Then the integration can be done as follows. Let
$$c:=N^2r\in(0,\infty)$$
and
$$t:=x/\sqrt k,$$
the (signed) distance from the the origin to your plane
$$\Pi\_t:=\{y\in\R^k\colon u\cdot y=t\}=\{y\in\R^k\colon \1\cdot y=x\},$$
where $\cdot$ denotes the dot product, $\1:=(1,\dots,1)\in\R^k$, and
$$u:=\1/\sqrt k$$
is a unit normal vector to the plane $\Pi\_t$. Thus, instead of the parameter $x$, we use the more geometrical parameter $t$.


Then the integral in question can be written as
$$I\_t:=e^{ct^2}J\_t,\quad\text{where}\quad J\_t:=\int\_{\Pi\_t}\mu\_t(dy)e^{-c|y|^2},$$
$|y|$ is the Euclidean norm of $y$, and, for each real $t$, $\mu\_t$ is the measure over the plane $\Pi\_t$ induced by the Lebesgue measure on $\R^k$ in the following sense:
\begin{equation}
 \int\_a^b dt\, \int\_{\Pi\_t}\mu\_t(dy)g(y)
=\int\_{\Pi\_{a,b}}dy\,g(y) \tag{1}
\end{equation}
for all nonnegative Borel-measurable functions $g\colon\R^k\to\R$ and all real $a$ and $b$ such that $a<b$,
where
$$\Pi\_{a,b}:=\bigcup\_{t\in[a,b]}\Pi\_t=\{y\in\R^k\colon a\le u\cdot y\le b\}.$$


Then for such $a$ and $b$ we have
$$\int\_a^b dt\, J\_t=\int\_a^b dt\, \int\_{\Pi\_t}\mu\_t(dy)e^{-c|y|^2}
=K\_{a,b}:=\int\_{\Pi\_{a,b}}dy\,e^{-c|y|^2}.$$
(See the remark on this at the end of this answer.)


To compute the integral $K\_{a,b}$, let us use a substitution of the form $y=Qz$, where $Q$ is any orthogonal $k\times k$ matrix whose first column is the unit vector $u$, so that
$y=Qz$ implies $z\_1=u\cdot y$, where $z\_j$ is the $j$'s coordinate of the vector $z$; such an orthogonal matrix $Q$ exists. Then we can write
$$K\_{a,b}=\int\_{\R^k}dy\,e^{-c|y|^2}\,1(a\le u\cdot y\le b) \\
=\int\_{\R^k}dz\,e^{-c|z|^2}\,1(a\le z\_1\le b) \\
=\int\_a^b dz\_1\,e^{-cz\_1^2}\int\_{\R^{k-1}}dw\,e^{-c|w|^2} \\
=\int\_a^b dz\_1\,e^{-cz\_1^2}\,(\pi/c)^{(k-1)/2}.
$$
So,
$$J\_t=\frac d{dt}\,K\_{a,t}=e^{-ct^2}\,(\pi/c)^{(k-1)/2}.$$
Thus, the integral in question is
$$I\_t:=e^{ct^2}J\_t=(\pi/c)^{(k-1)/2}=\Big(\frac\pi{N^2r}\Big)^{(k-1)/2}.$$


This differs from both of your answers -- but you never defined the measure over which you integrate.




---


**Remark:** Intuitively, think of $a$ and $b$ as being close to a real number $t$, and hence to each other. We approximate the integral $\int\_{\Pi\_t}\mu\_t(dy)e^{-c|y|^2}$ over the plane $\Pi\_t$ by $\frac1{b-a}\,\int\_{\Pi\_{a,b}}dy\, e^{-c|y|^2}$, that is, by the integral over the thin layer $\Pi\_{a,b}$ between two parallel planes $\Pi\_a$ and $\Pi\_b$ (close to the plane $\Pi\_t$) divided by thickness $b-a$ of the layer.


Formally, we are dealing here with [disintegration of a measure](https://en.wikipedia.org/wiki/Disintegration_theorem#Statement_of_the_theorem). That linked theorem deals only with probability measures, but it is trivially extended to finite measures. If we forget about this finiteness condition for a moment, then in that linked theorem we can choose $X=\R$, $Y=\R^k$, let the map $\pi\colon Y\to X$ be the projection map defined by $\pi(y):=u\cdot y$ for all $y\in Y=\R^k$, and let $\mu:=\lambda\_k$ and $\nu:=\lambda\_1$, where $\lambda\_k$ is the Lebesgue measure over $\R^k$. I think the finiteness condition in that linked theorem is inessential, and the proof will hold for any Borel measures $\mu$, at least if $\mu$ is $\sigma$-finite. Alternatively, one can approximate here the Lebesgue measure over $\R^k$ by the finite Lebesgue measures over big cubes in $\R^k$.


