Suppose $S$ is a vector subspace of $\mathbb{R}^{n}$ such that $\mathbb{R}^{n} = S \oplus S^{\perp}$ and let $P_{S}: \mathbb{R}^{n}\to S$ be the associate orthogonal projection. Suppose I want to evaluate a Gaussian integral: $$I = \int_{S}e^{-\frac{1}{2}\langle x, C^{-1}x\rangle} dx$$ or, more generally: $$I' = \int_{S}e^{-\frac{1}{2}\langle x, C^{-1}x\rangle}f(x)dx$$ where, here, $C^{-1}$ is a given covariance matrix and $\langle \cdot, \cdot \rangle$ denotes the usual inner product on $\mathbb{R}^{n}$. On one hand, it seems to me that: $$I' = \int_{S}e^{-\frac{1}{2}\langle x, C^{-1}x\rangle}f(x)dx = \int_{\mathbb{R}^{n}}e^{-\frac{1}{2}\langle P_{S}x, C^{-1}P_{S}x\rangle} f(P_{S}x)dx \tag{1}\label{1}$$ but, on the other hand, I don't know how to justify why the integral on the right hand side of the above expression is not zero, since by a change of variable $y = P_{S}x$ and the change of variable formula, this would be zero given the fact $\operatorname{det}P_{S} = 0$. (Maybe the use of the change of variable formula do not hold here since $P_{S}$ is not a diffeomorphism?)
I'd like to know if my formula (\ref{1}) is correct and if it is or is not identically zero. Moreover, is this kind of object studied somewhere, i.e. are there references for integrals of the form (\ref{1})?