Given two functions $f(\mathbf{x^TAx})$ and $g(\mathbf{x^TBx})$, consider the new function $h(\mathbf{x})=f(\mathbf{x^TAx})g(\mathbf{x^TBx})$. Can $h$ be a function with a quadratic argument of the form $\mathbf{x^TS_{A,B}x}$?
I know for exponential $f=e^{-\mathbf{x^TAx}}$ and $g=e^{-\mathbf{x^TBx}}$ it follows immediately that $h=e^{-\mathbf{x^T(A+B)x}}$. But in general, are there any conditions on $f$ and $g$ that result in an $h$ with quadratic argument even if $\mathbf{S_{A,B}}$ is unknown? For example if $f=e^{-\mathbf{x^TAx}}$ and $g=\frac{1}{1+\mathbf{x^TBx}}$, can we have $h=\frac{e^{-\mathbf{x^TAx}}}{1+\mathbf{x^TBx}}=h(\mathbf{x^TS_{A,B}x})$?
Thanks for any helps and hints.
PS: A simpler case where either $\mathbf{A}$ or $\mathbf{B}$ is the identity matrix would also be very helpful.