How to multiply out brackets when they contain vectors Little confused on the rules here, obviously if I treat it as a vector and its transpose I can compute this if I knew each vector entry but I am keen to know the general rule for any vector:
$(\mathbf x - \mathbf y)(\mathbf x - \mathbf y)^T$
How does it relate to $(x-y)(x-y) = x^2 - 2xy + y^2 $
Thanks for your help

EDIT/CAVEAT: I am interpreting the vectors as row vectors. Please see the other answer for interpreting the vectors as column vectors.
You're correct that you should treat it as the vector and its transpose. This is called an "inner product", or a "dot product". In the trivial case that the vectors are both scalars, it reduces to the formula you said. Otherwise, it becomes $$x x^T -xy^T - yx^T + yy^T$$
$$=|x|^2 - 2 x\cdot y + |y|^2$$
