I'm trying to prove the following using the moment generating function:
For $\mathbf{y}\in \mathbb{R}^n \sim \mathcal{N}(0,I_n)$, one has $\mathbf{y}^T \mathbf{A} \mathbf{y} \sim \chi^2(a) \iff \mathbf{A}^2=\mathbf{A}$ and rank($\mathbf{A})=a$.
So, by my thinking, we need to find the moment generating function of $\mathbf{y}^T \mathbf{A} \mathbf{y}$ to show it is equal to the moment generating function of a Chi Square variable with $a$ degrees of freedom, if and only if $\mathbf{A}^2=\mathbf{A}$ and rank($\mathbf{A})=a$.
So far, this is what I have:
\begin{align*} E[e^{t\mathbf{y}^T \mathbf{A} \mathbf{y}}]&=\frac{1}{(2 \pi)^{n/2}}\int_{\mathbb{R}^n} e^{-\frac{1}{2} \mathbf{y}^T \mathbf{y}}e^{t\mathbf{y}^T \mathbf{A} \mathbf{y}}\;d\mathbf{y} \\ &= \frac{1}{(2 \pi)^{n/2}}\int_{\mathbb{R}^n} e^{-\frac{1}{2} \mathbf{y}^T (I_n - 2t \mathbf{A}) \mathbf{y}}\;d\mathbf{y}\\ \end{align*}
Am I on the right track? And how does one continue from here? I'm trying to figure out if I can take the $t$ variable outside of the integral somehow, but I'm stuck in finding a way.