How to multiply out brackets when they contain vectors

$\begingroup$

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

$\endgroup$ 2

2 Answers

$\begingroup$

To see why removing brackets is a bit different, you can remove them step by step:$$(\mathbf x - \mathbf y)(\mathbf x - \mathbf y)^T = \mathbf x (\mathbf x - \mathbf y)^T - \mathbf y(\mathbf x - \mathbf y)^T = \mathbf x \mathbf x^T - \mathbf x\mathbf y^T - \mathbf y\mathbf x^T - \mathbf y \mathbf y^T$$The result cannot be simplified any further, because unlike the scalar case, $\mathbf x\mathbf y^T \neq \mathbf y\mathbf x^T$

$\endgroup$ 2 $\begingroup$

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$$

$\endgroup$ 5

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like