MATH 133 Linear Algebra and Geometry • McGill University, Montreal
Revision sheet: matrix algebra, transpose and the matrix product (MATH 133)
This sheet is not a summary of sections 2.1 and 2.3 of Nicholson: you already have the course notes. It answers one question only, what makes students lose marks on matrix algebra in MATH 133 at McGill University, and which precise gesture avoids each loss.
Almost every trap on this chapter has the same root. Matrices are added like numbers but multiplied like compositions, so the ORDER of the factors carries information, and the rules of high-school algebra that quietly swap two factors stop being true. The sheet sorts them: the ones that survive, the ones that die, and the counterexample with small integers that kills each one in ten seconds.
Mark this sheet as read or add it to your favourites: a free account, no password, keeps your read sheets and favourites from one visit to the next, tells you which chapter to tackle next and lets you ask for the method or exercise you are missing. Create your space, an email is enough.
A matrix product remembers the order of its factors: a row of the LEFT factor meets a column of the RIGHT one, so check the sizes before any entry, and never use a rule of ordinary algebra that swaps two factors, ab=ba, (ab)T=aTbT, ab=0 so a=0 or b=0, until it has been proved for matrices.
•Not true in general: AB=BA, and 'AB=0 so A=0 or B=0'. Both fail already for 2×2 matrices.
The same two matrices in the two orders: AB is 2×2 and BA is 3×3. For non-square factors, AB=BA cannot even be asked.
Write the two sizes side by side before the first entry. It takes three seconds and catches both a product that does not exist and a result of the wrong shape, before a page of arithmetic is spent on it.
Transpose, symmetric parts, powers and trace
•(AT)ij=aji. Rules: (AT)T=A, (A+B)T=AT+BT, (kA)T=kAT, and (AB)T=BTAT, with the order REVERSED.
•Symmetric: ST=S, mirror pairs equal. Skew-symmetric: KT=−K, mirror pairs opposite and diagonal all zero. Every square A is 21(A+AT)+21(A−AT), in exactly one way.
•Powers exist for SQUARE matrices only. Nilpotent: Ak=0 for some k. Idempotent: A2=A, hence An=A for every n≥1.
•trA is the sum of the diagonal entries. tr(A+B)=trA+trB and tr(AB)=tr(BA), but tr(AB)=trA⋅trB in general.
Same mirror, two behaviours: on the left each coloured pair is equal, on the right each pair is opposite and the diagonal is forced to 0.
The rules in table form
Each row reads from left to right: the assumptions, then the result. A red cell is not an answer, it is the finding that the form settles nothing and the instruction to rewrite it. Every case is followed by a worked example.
Rules of ordinary algebra: which ones survive for matrices
Each line is an identity you use without thinking for numbers. The last column says whether it holds for square matrices of the same size. Red means false in general, and the example proves it with small integers: that example is the counterexample to write on a true or false question.
Numbers
Matrices
Verdict
a(bc)=(ab)c
A(BC)=(AB)C
holds
Example: Brackets may move: with A=B=C=(1011), both bracketings give (1031).
a(b+c)=ab+ac
A(B+C)=AB+AC
holds
Example: (1324)((10)+(01))=(13)+(24)=(37).
ab=ba
AB=BA
failsfalse for matrices
Example: (1002)(0010)=(0010), but the other order gives (0020).
What to do: Keep every factor in its place. Swap two factors only after checking AB=BA, or when one of them is cI.
(a+b)(a−b)
(A+B)(A−B)
A2−B2+BA−ABtwo extra terms
Example: With A=(1002) and B=(0010), the extra part BA−AB=(0010) is not zero.
What to do: Expand term by term, keeping the order: A2−AB+BA−B2. The middle cancels only if AB=BA.
ab=0
AB=0
one factor is 0false for matrices
Example: (1111)(1−1−11)=0 with both factors non-zero.
What to do: Read AB=0 column by column: each column of B solves Ax=0. Nothing more.
(ab)2=a2b2
(AB)2=A2B2
failsfalse for matrices
Example: With A=(0010) and B=(0100): (AB)2=(1000) but A2B2=0.
What to do: (AB)2=ABAB: the BA in the middle cannot be turned into AB.
The two lines that survive are exactly the ones that never swap two factors. That is the whole table in one sentence.
The mistakes that cost marks
These are the errors I correct most often in session. Each one costs marks on a paper, even when the reasoning behind it is right.
1.Multiplying two matrices entry by entry
the whole question
What not to write
“(1324)(0110)=(0320)”
What to write
“Row against column: (1324)(0110)=(2413), the two columns swapped.”
Why: The entry-by-entry product agrees with the real one only for diagonal matrices, which is why it survives so long. Here the right factor swaps the columns of the left one, and the column reading says so before any arithmetic: column 1 of the product is A(0,1)T, the second column of A.
2.Squaring a matrix that is not square
1 to 2 marks, and every part built on it
What not to write
“A is 2×3, so A2 is 2×3 as well.”
What to write
“A2=AA is (2×3)(2×3), inner sizes 3=2: it does not exist. The products that do exist are AAT, 2×2, and ATA, 3×3.”
Why: Powers, commuting and the trace are questions about SQUARE matrices only. A size written next to each factor would have stopped the line before it was written.
3.Reading the indices of an entry backwards
the entry asked for, and it looks perfectly plausible
What not to write
“(AB)23 is column 2 of A against row 3 of B.”
What to write
“(AB)23 is row 2 of A against column 3 of B: the first index is a row of the LEFT factor, the second a column of the RIGHT factor.”
Why: A question asking for one entry is testing exactly this, and the wrong reading still produces a sensible number, so nothing flags it. With A=1−12031210 and B=2011−12310, the right reading gives 0 and the backward one gives 6.
4.Transposing a product without reversing it
2 marks, and every symmetry proof that uses it
What not to write
“(AB)T=ATBT”
What to write
“(AB)T=BTAT. With A of size 2×3 and B of size 3×1, ATBT is (3×2)(1×3) and does not even exist.”
Why: Entry (i,j) of (AB)T is (AB)ji=∑kajkbki, which is row i of BT against column j of AT. Undoing a product means undoing the last factor first, so the order reverses; for square factors the wrong version exists and is simply false, the more dangerous case.
5.Using the difference of squares, or the binomial formula, as for numbers
2 marks
What not to write
“(A−B)(A+B)=A2−B2”
What to write
“(A−B)(A+B)=A2+AB−BA−B2, which reduces to A2−B2 only if AB=BA.”
Why: With A=(1002) and B=(0010), the leftover AB−BA is (00−10). The binomial formula is legitimate in one important case, a sum like cI+N, because cI commutes with everything.
6.Concluding that a matrix is zero because a power of it is
the whole question
What not to write
“N3=0, so N=0.”
What to write
“N=000100420 is not zero and N3=0: N is nilpotent. From AB=0, conclude only that each column of B solves Ax=0.”
Each power pushes the non-zero entries one diagonal further from the main diagonal; at N3 there is no diagonal left and the matrix is zero.
Why: The rule “a product of non-zero numbers is non-zero” is exactly what fails for matrices. A strictly upper triangular n×n matrix always has Nn=0, and the figure shows why.
7.Raising a matrix to a power by raising its entries
the whole question, and the induction that follows
What not to write
“(1031)2=(1091)”
What to write
“(1031)2=(1061): the corner is 1⋅3+3⋅1=6.”
Why: A2=AA is a matrix product like any other. Entry-by-entry powers are correct only for DIAGONAL matrices, where no row ever meets a non-zero off-diagonal entry.
8.Assuming that a product of symmetric matrices is symmetric
2 marks on a true or false question
What not to write
“A and B are symmetric, so AB is symmetric.”
What to write
“(AB)T=BTAT=BA, so AB is symmetric exactly when AB=BA. For instance (1110)(2001)=(2210) is not.”
Why: The reversal rule is the whole argument, one line long. Sums of symmetric matrices, A2 and AAT are symmetric; a product of two different symmetric matrices is not, unless they commute.
9.Believing that diagonal matrices commute with everything
the whole commuting question
What not to write
“D is diagonal, so DX=XD for every X.”
What to write
“Only the scalar matrices cI commute with everything: (1003)(0010)=(0010) but in the other order (0030).”
Read the second column of each product: DX sends e2 to (1,0), XD sends it to (3,0). D on the left scales a ROW, on the right a COLUMN, and here those differ.
Why: A diagonal matrix on the LEFT scales the rows, on the RIGHT it scales the columns, and the two agree only when the diagonal entries are equal. Diagonal matrices do commute with EACH OTHER, which is the source of the confusion.
10.Treating the trace as multiplicative
2 marks
What not to write
“tr(AB)=trA⋅trB”
What to write
“The trace is additive, and tr(AB)=tr(BA); it is not multiplicative: A=(1000), B=(0001) give tr(AB)=0 but trA⋅trB=1.”
Why: The one product rule the trace has is the swap rule, and it only allows cyclic shifts: tr(ABC)=tr(CAB), but not tr(ACB) in general. It is also what proves that XY−YX=I is impossible.
Which method to choose
Which reading of the product the question is asking for
Read what the question wants FROM the product before multiplying anything
What each reading takes from each factor: a row and a column for one entry, all of A and one column for a column, one row and all of B for a row.
If one entry (i,j) → row i of the left factor against column j of the right one, and nothing else
Example: for two 3×3 factors: 3 multiplications instead of 27
If one column of AB → A times that column of B, a combination of the columns of A
Example: A(1,−1,2)T=a1−a2+2a3
If one row of AB → that row of A times B, a combination of the rows of B
Example: (2,1,0)B=2r1+r2
If a trace → only the diagonal entries of the product, or tr(AB)=tr(BA) on the smaller product
Example: A is 2×3, B is 3×2: two entries of AB, not three of BA
If a product of three factors → bracket so that the intermediate product is the smallest
Example: B(AB) with AB of size 2×2, rather than (BA)B with BA of size 3×3
If a relation between the columns of B → the same relation holds between the columns of AB
Example: b3=2b1−b2 gives (AB)3=2(AB)1−(AB)2
Computing the whole product to read one entry is not wrong, only slow, and on a midterm the time goes to the last question. The one reading that is WRONG is combining the rows of the left factor or the columns of the right one.
Before raising a matrix to a power
Look at the SHAPE of the matrix first, not at n
If the matrix is diagonal → raise each diagonal entry to the power n
Example: diag(2,−1)5=diag(32,−1)
If it is strictly upper triangular, n×n → it is nilpotent: An=0
Example: N=000100420 gives N3=0
If A2=A → idempotent: An=A for every n≥1
Example: (1010)10=(1010)
If A=cI+N with N nilpotent → binomial theorem, legal because cI commutes with N
Example: (3013)n=(3n0n3n−13n)
If none of the above → compute A2 and A3, conjecture, then prove by induction
Example: (1011)n=(10n1), proved with An+1=AnA
A pattern read off three powers is a conjecture, not an answer: without the induction step the question is worth half its marks.
How the answer is expected to be written
A marker ticks steps. Here they are in order, with the concluding sentence expected word for word.
Finding all matrices that commute with a given matrix
When to use it: “Find all 2×2 matrices X such that AX=XA.”
1Write the unknown in full: X=(acbd).
2Compute AX. Then compute XA as a SEPARATE product, row of X against column of A; it is not the same computation.
3Equate the four entries and write the four equations, even the ones that repeat.
4Solve the homogeneous system and name the free parameters.
5Write the general X and check one numerical member in both products.
Concluding sentence
“The matrices that commute with A are exactly the matrices X=(3b+d0bd) with b and d real, that is X=(b+d)I+bA.”
The trap: Stopping at one example that commutes. The question says ALL, so the answer is a family with its parameters, and the check with one member proves nothing about the others.
Marking: Typically 2 marks for the two products written separately, 1 for the equations, 1 for the solution, 1 for the final sentence.
Proving an identity with the transpose
When to use it: “Show that AAT is symmetric”, “show that A+AT is symmetric”, “prove (An)T=(AT)n”
1Start from ONE side, usually the transpose of the expression, never from the conclusion.
2Transform it with named rules only: the reversal rule (XY)T=YTXT, (XT)T=X, (X+Y)T=XT+YT.
3Arrive at the expression itself, or at its opposite for a skew-symmetric claim.
4For a statement about every n, use induction: (An+1)T=(AnA)T=AT(An)T.
Concluding sentence
“(AAT)T=(AT)TAT=AAT by the reversal rule and (AT)T=A, so AAT is symmetric.”
The trap: Checking the identity on one numerical matrix. It illustrates the claim, it does not prove it, and it is worth no more than the illustration mark.
Check before you hand in
Five minutes of checking recover more marks than one more problem started in a hurry.
The size test, three seconds
Write the size under each factor. The inner sizes must agree and the outer sizes give the answer's shape; a sum needs identical sizes.
(2×3)(3×2) gives 2×2. A 3×3 answer for AB means you computed BA.
A matrix that must be symmetric, is
AAT, ATA, A+AT and the part S of a decomposition must come out symmetric, and K must have a zero diagonal. Any asymmetry is an arithmetic slip, found before the marker finds it.
A=(1021) gives AAT=(5221); a 2 and a 3 off the diagonal would betray an error.
The trace test
When both AB and BA have been computed, their traces must agree, even if their sizes differ.
tr(AB)=6 and tr(BA)=5 means one of the two products is wrong.
One column recomputed another way
Pick one column of your product and recompute it as A times the matching column of B, as a combination of the columns of A. It checks a third of a 3×3 product in one line.
A(1,−1,2)T=a1−a2+2a3 must equal the second column you wrote down.
A found family, checked on one member
After solving AX=XA or AX=0, pick simple values of the parameters and compute both sides. A family that fails the check was solved with a wrong product.
b=1, d=0 gives X=(3010) and AX=XA=(6020).
The typical problem, taken apart
Every matrix that commutes with a given one, solved step by step
Find all 2×2 matrices X that commute with A=(201−1), and show that each of them is a combination of I and A.
Step 1
Write X=(acbd) and compute AX=(2a+c−c2b+d−d), row of A against column of X.
Why
The unknown is written in full so that every entry has a name: the question becomes a system in four unknowns, which is a chapter you already master.
Step 2
Compute XA separately: XA=(2a2ca−bc−d), row of X against column of A.
Why
This is the step that is skipped. XA is a different product, with the roles of rows and columns exchanged, and its entries are not a rearrangement of those of AX.
Step 3
Equate entry by entry: 2a+c=2a, 2b+d=a−b, −c=2c and −d=c−d. Three of them give c=0, the fourth gives a=3b+d.
Why
All four equations are written, even the repetitive ones: that is where the marker looks for the method, and a missing equation is how a free parameter gets lost.
Step 4
So X=(3b+d0bd) with b, d real. Since bA+(b+d)I=(2b+b+d0b−b+b+d)=X, every such X is (b+d)I+bA.
Why
Two free parameters, and the family is exactly the combinations of I and A. Matrices of the form αI+βA obviously commute with A, so this is also the sanity check on the size of the answer.
Step 5
Check with b=1, d=0: X=(3010), and AX=(6020)=XA.
Why
One member of the family, computed in both orders. It catches a sign error in the system, which is the usual slip of the third step.
The conclusion, written out
“The matrices that commute with A are exactly X=(3b+d0bd), b,d∈R, that is X=(b+d)I+bA.”
The classic mistake on this problem: Writing XA as the same matrix as AX turns all four equations into 0=0 and concludes that every matrix commutes with A. One test refutes it: X=(0100) gives AX=(1−100) but XA=(0201).
Learn by heart
•(m×n)(n×p)=m×p: the inner sizes agree, the outer sizes give the shape.
•(AB)ij = row i of A against column j of B. Column j of AB = Abj; row i of AB = riB.
•AB=BA in general; AB=0, A2=0 and A2=I with A=±I all happen with non-zero 2×2 matrices.
•(AB)T=BTAT, order REVERSED; AAT and ATA are always symmetric.
•A=21(A+AT)+21(A−AT): symmetric plus skew-symmetric, in exactly one way.
•Binomial theorem for (A+B)n ONLY when AB=BA; cI commutes with every matrix, and only cI does.
•Powers entry by entry: diagonal matrices ONLY.
•tr(AB)=tr(BA), cyclic shifts only; hence XY−YX=I is impossible.
Frequently asked questions
Why is matrix multiplication not commutative?
Because a product combines rows of the left factor with columns of the right factor, and swapping the factors swaps which matrix gives the rows. For non-square matrices the two products do not even have the same size. For square ones they usually differ too: even two simple two by two matrices, one diagonal and one with a single one in the corner, give different products in the two orders.
How do I know if two matrices can be multiplied?
Write the size of each matrix, rows by columns, side by side. The product exists when the number of columns of the left matrix equals the number of rows of the right one, the two inner numbers. The result has the rows of the left matrix and the columns of the right one, the two outer numbers. A two by three times a three by four gives a two by four.
What is the transpose of a product of two matrices?
The transpose of AB is B transpose times A transpose, in the reverse order. The order must reverse because each entry of the transposed product is a row of B transpose against a column of A transpose. Writing A transpose times B transpose is a classic loss of marks, and for non-square matrices that wrong product often does not even exist.
How do I find all matrices that commute with a given matrix?
Write the unknown matrix with four letters, compute the product in both orders as two separate computations, and set the four entries equal. You get a homogeneous linear system in the four letters. Solve it, keep the free parameters, and write the general solution. Finish by checking one numerical member of the family in both products.
Can the product of two non-zero matrices be the zero matrix?
Yes, and it happens with two by two matrices. If every column of the right factor is a solution of the homogeneous system of the left factor, the product is zero although neither factor is. So from a zero product you may not conclude that one factor is zero, and a matrix can even have a zero square without being zero itself. Such a matrix is called nilpotent.
Corrected exercises: Matrix algebra and the matrix product, MATH 133 at McGill
A method is proved on a paper, not on a sheet. The set for the same chapter takes each of these traps into a problem, with the solution written out step by step.
Something missing from this sheet?A method, a trap, an exercise to practise it, a mistake you spotted: tell me, I read every request.
Sending goes through your free space: that is how I can answer you and tell you when the exercise is added. An email is enough, no password. Create your space.
Rather not create an account? Write to me directly.
Get in touch for a first session. Matrix algebra is where linear algebra stops being arithmetic: once the order of the factors is under control, the rest of the course reads much faster.