Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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.

share|cite|improve this question
$(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
Try this: – 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
up vote 0 down vote accepted

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

share|cite|improve this answer

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

share|cite|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.