# How to separate the square of a vector dot product into a product of functions of individual vectors?

I have the following function of two arbitrary vectors $X$ and $M$

$$f(X,M) = (M^{T} \cdot X)^2 = M^{T} \cdot X \cdot X^{T} \cdot M$$

Can I express the function as $f(X,M) = g(X) \cdot h(M)$ ??

If yes, then what will be $g(X)$ and $h(M$)?

-

No such decomposition is possible when the dimension $n>1$. If $f(u,v)=\langle u,v\rangle^2 = g(u)^T h(v)$ for all vectors $u,v$, then $$\left(\frac{\partial^2 f}{\partial u_i\partial v_j}\right)_{i,j\in\{1,\ldots,n\}} =\ 2vu^T + 2\operatorname{diag}(\langle u,v\rangle)\ =\ g'(u)^T h'(v).$$ In particular, if $u$ is a unit vector, then $\det\left(g'(u)^T h'(u)\right)=\det(2uu^T+2I)=4\not=0$. However, by differentiating $f$ w.r.t. $u$, we get $2\langle u,v\rangle v = g'(u)^T h(v)$. When $n>1$, if we put $v\perp u$, we get $g'(u)^T h(v)=0$ and hence $\det\,g'(u)=0$, which is a contradiction. Therefore we cannot decompose $\langle u,v\rangle^2$ into a product of functions $g(u)^T h(v)$ when $n>1$.
$$g(A) = M \cdot A\\h(A) = X \cdot A$$