# How to multiply vector and matrix expressions involving transposes

How do i expand and simplify the vector expression
$(\vec{a}-\vec{b})^T.(\vec{a}-\vec{b})$ = ?
And if there are matrices A and B instead of vectors a and b, how do i multiply and simplify this expression? $(A-B)^T.(A-B)$ = ?
Also in the normal equations for solving least squares problems, we have expressions of the type
$(Ax-b)^T.(Ax-b)$ = ?

I know that is really basic. Sorry but my basics are rusty. In fact, I need to so some matrix calculus next. Please do point me to some relevant links.

-
$(A+B)^T = A^T + B^T$. Then just expand and distribute the normal way... – Rahul Jan 24 '11 at 14:22
@Rahul.Thanks. can you give me some links having all these basic identities involving vectors and matrices? Like a'b+ba'=? and so on. – hAcKnRoCk Jan 24 '11 at 14:34
– Rahul Jan 24 '11 at 14:46
@Rahul.Thanks again. I should have googled for "matrix transpose properties". – hAcKnRoCk Jan 24 '11 at 15:28

A useful source of useful identities (most of which aren't proved though) is the matrix cookbook.

-

Just think of a vector as a matrix of one column, and all the matrix rules apply.

-