Let $X$ be a $N_n(\mu, \Sigma)$ random variable, where both $\mu \in \mathbb{R}^n$ and the positive definite $n \times n$ matrix $\Sigma$ are known. Given an $n \times n$ matrix $A$, what is the most general result regarding the distribution of $X^TA X$? To state it in an operational way, what are the procedures to follow to compute the distribution of $X^TAX$ when we receive matrix $A$?
The result I know about is that $A\Sigma$ is idempotent if and only if $X^TAX$ follows a non-central chi-squared distribution $\chi_r^2(\frac{1}{2}\mu^TA\mu)$, where $r = \text{rank}(A)$. This result follows directly from the moment generating function. Namely, write $M(t)$ for the moment generating function $\mathbb{E}[e^{tX^TAX}]$, then :
\begin{equation*} M(t) = [\text{det}(I_n - 2t A\Sigma)]^{-\frac{1}{2}}\exp{\left\{ -\frac{1}{2}\mu^T [I_n - (I_n - 2tA\Sigma)^{-1}]\Sigma^{-1}\mu\right \}} \end{equation*}
So that, if $A\Sigma$ is idempotent, one might further simplify this $M(t)$ until one recognizes this as non-central chi-squared .
What do I do if $A\Sigma$ is not idempotent? It is not clear how to read a meaningful distribution from $M(t)$. Maybe I have to use the characteristic function and then inverse Fourier transform ?
Another route I hope to be useful is to use Cochran's theorem trying to get a decomposition of $A$. However, it is not clear how to do such a thing for a generic matrix $A$ .