When does $x^T (xy^T) y = x^T (x^Ty) y$? $x$ and $y$ are column vectors. When does $x^T (xy^T)  y = x^T (x^Ty) y$?
After a few trial and errors, I found that if at least one of $x$ and $y$ is a zero matrix then the equality is true. The equation is also true if $x$ = $y$. 
I'm interested in knowing if there's a way to solving this problem, rather than plugging in numbers, to see if I'm missing values.
 A: So you have, in summation convention,
$$ x_i (xy^T)_{ij} y_j = x_i x_i y_j y_j = \lVert x \rVert^2 \lVert y \rVert^2, $$
and
$$ x_i (x_j y_j ) y_i = (x \cdot y)^2. $$
This is just the case of equality in the Cauchy-Schwarz inequality,
$$ (x \cdot y)^2 \leqslant \lVert x \rVert^2 \lVert y \rVert^2; $$
one checks by examining the discriminant of the quadratic $\lVert x-\lambda y \rVert^2$ that equality can only occur when $x$ is a scalar multiple of $y$.
A: Strictly speaking your second expression makes no sense. The middle factor $x^Ty$ is a $1\times1$ matrix, which (assuming you are not working in dimension$~1$) you cannot multiply to the right of the $1$-row matrix $x^T$, nor to the left of the $1$-column matrix$~y$. So the only way to make sense of the expression $x^T(x^Ty)y$ is to treat the middle $x^Ty$ is a scalar, and move it out of the way, to give $x^Ty(x^Ty)$. Also I assume you are working in $\Bbb R^n$, since in $\Bbb C^n$ products like $x^Ty$ are not related to any inner product.
Note that matrix multiplication is associative, so on the left you have $x^T(xy^T)y=(x^Tx)(y^Ty)$ which is a $1\times1$ matrix with entry $(x\mid x)(y\mid y)$; on the right $x^Ty(x^Ty)$ is a $1\times1$ matrix with entry $(x\mid y)^2$. So those entries are the numbers occurring in the Cauchy-Schwarz inequality, whose statement tells you when you have equality; this answers your question.
