How to expand inner product square?

4.6k Views Asked by At

How does this $||x-x'||$ expand to the equation below?

$\|x-x'\|^2 = (x^T)x + (x')^T x' - 2x^T x'$

2

There are 2 best solutions below

2
On BEST ANSWER

Using the fact that the inner product is a bilinear symmetric form we get

$$||x-x'||^2=\langle x-x',x-x'\rangle=\langle x,x\rangle-\langle x,x'\rangle-\langle x',x\rangle+\langle x',x'\rangle\\=\langle x,x\rangle-2\langle x,x'\rangle+\langle x',x'\rangle$$

0
On

Once you know that $\|u\|^2 = \langle u, u \rangle = u^tu $ is the inner product, it's pretty straightforward: apply the distributive law a few times, using $u = x - x'$.