I have a vector $\mathbf{x}$ with a multivariate Gaussian distribution
$$P[\textbf{x}\in S]
=\int\_{\textbf{x}\in S}
\det(2\pi H^{-1})^{-1/2}\exp(-\frac{1}{2} \textbf{x}^T H\textbf{x}) \, d\textbf{x}$$How can I compute probability densities within the hyperplane $\textbf{x}\cdot \textbf{g}=C$ using the standard Lebesgue measure? ${}$


The closest question & answer I have found on this site was for a particular instance of Gaussian and hyperplane [here](https://mathoverflow.net/a/381215/102071).



Probability density of a hyperplane for a Gaussian distribution
$\newcommand{\Si}{\Sigma}\newcommand{\R}{\mathbb R}$First, one should not denote a random vector in $\R^n$ (which is not actually a vector in $\R^n$ but a function with values in $\R^n$) and a true, non-random vector in $\R^n$ by the same symbol, such as $\mathbf x$.


Accordingly, let $X\sim N(0,S)$, where $S:=H^{-1}$. Let $c:=C$ and $g:=\mathbf g\ne0$. We want to find the conditional density of $X$ given $X^\top g=c$; as usual, we identify $\R^n$ with the set $\R^{n\times1}$ of all $n\times1$ real matrices. Without loss of generality,
$g$ is a unit vector; otherwise, replace $g$ and $c$ by $g/|g|$ and $c/|g|$, respectively, where $|g|$ is the Euclidean norm of $g$. Let
$g\_1,\dots,g\_n$
be any orthonormal vectors in $\R^n$ such as $g\_n=g$.


Let $Y\_1,\dots,Y\_n$ be the coordinates of the random vector $X$ in the orthonormal basis $(g\_1,\dots,g\_n)$, so that $Y\_k=g\_k^\top X$ and $X=\sum\_{k=1}^n Y\_kg\_k$. Let $Y:=[Y\_1,\dots,Y\_n]^\top$, so that
$Y=G^\top X$ and $X=GY$, where $G:=[g\_1,\dots,g\_n]$, the $n\times n$ matrix with columns $g\_1,\dots,g\_n$. The covariance matrix of $Y$ is
\begin{equation}
 EYY^\top=G^\top SG=:
 \begin{bmatrix}
 \Si\_{11}&\Si\_{12} \\ 
 \Si\_{21}&\Si\_{22} 
 \end{bmatrix},
\end{equation}
where $\Si\_{12}$ is the $(n-1)\times1$ matrix that is the covariance matrix of $[Y\_1,\dots,Y\_{n-1}]^\top$ and $Y\_n$. Also, $Y\sim N(0,G^\top SG)$.
So, the [conditional pdf](https://en.wikipedia.org/wiki/Multivariate_normal_distribution#Conditional_distributions) of $[Y\_1,\dots,Y\_{n-1}]^\top$ given $Y\_n=c$ is the pdf, say $p\_c$, of the $(n-1)$-dimensional normal distribution
\begin{equation}
 N(\Si\_{12}\Si\_{22}^{-1}c,\Si\_{11}-\Si\_{12}\Si\_{22}^{-1}\Si\_{21}).
\end{equation}


This conditional pdf, $p\_c$, can be regarded as the desired conditional density of $X$ given $X^\top g=c$. Indeed, $p\_c$ can be used as follows: for any (say) nonnegative Borel function $f\colon\R^n\to\R$,
\begin{equation}
 E(f(X)|X^\top g=c)=E(f(GY)|Y\_n=c) \\ 
 =\int\_{\R^{n-1}}f(G[y\_1,\dots,y\_{n-1},c]^\top)p\_c(y\_1,\dots,y\_{n-1})\,
 dy\_1\cdots dy\_{n-1}. 
\end{equation}
In particular, for any Borel subset $B$ of $\R^n$,
\begin{equation}
 P(X\in B|X^\top g=c)=P(GY\in B|Y\_n=c) \\ 
 =\int\_{\R^{n-1}}1(G[y\_1,\dots,y\_{n-1},c]^\top\in B)p\_c(y\_1,\dots,y\_{n-1})\,
 dy\_1\cdots dy\_{n-1}. 
\end{equation}


