# Thread: Matrix multiplication, confusing proof

1. ## Matrix multiplication, confusing proof

Hello!
I am in an ANN class right now and my professor gave a proof for clustering algorithms & scatter matrices. Right now I am having a hard time getting through some of the math of the proof. I was hoping somebody could help.

There is one portion where he goes from:

(a-b)(a-b)' + (b-c)(b-c)' (1)

to

(a-b+b-c)(a-b+b-c)' - (b-c)(a-b)' - (a-b)(b-c)' (2)

where a,b,c are matrices and ' is the transpose operator.

Now, I've tested this with some values and it seems true, but the step from (1) to (2) confuses me. Could someone fill in the gap? Is there some rule for matrix algebra that does this expansion?

Thanks for your help!

2. Going from (1) to (2) isn't an obvious step, but it's true nonetheless:

(a-b)(a-b)'+(b-c)(b-c)'
(a-b)(a'-b')+(b-c)(b'-c')
aa'-ba'-ab'+bb'+bb'-cb'-bc'+cc'

Now add some extra terms:

aa'-ba'-ab'+bb'+bb'-cb'-bc'+cc'+ca'-ca'+ac'-ac'

And move everything around a bit:

aa'-ac'-ca'+cc'-ba'+bb'+ca'-cb'-ab'+ac'+bb'-bc'
a(a'-c')-c(a'-c')-b(a'-b')+c(a'-b')-a(b'-c')+b(b'-c')
(a-c)(a'-c')+(-b+c)(a'-b')+(-a+b)(b'-c')
(a-c)(a-c)'-(b-c)(a-b)'-(a-b)(b-c)'

Lastly, just add some more extra terms:

(a-b+b-c)(a-b+b-c)'-(b-c)(a-b)'-(a-b)(b-c)'

And that's it.