I posted a question that went unanswered, but managed to figure that what I need is something to do with the following.
If $X\sim N(\mu,\sigma^2)$ and $P$ is an idempotent matrix. Then what can be said about the distribution of $X'PX$? If not distribution, then what about expectation and variance?
The classic result is this: if $\mathbf{X}$ is a random vector such that $\mathbf{X}\sim \text{Multivariate Normal}(\mathbf{0},I)$, and $P$ is an idempotent matrix, then $$\mathbf{X}^TP \mathbf{X}\sim \chi^2\ \ \text{with tr}(P)\ \ \text{d.f.}$$ in which tr$(P)$ is the trace of matrix $P$.