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.

The thread of the chapter

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=baab = ba, (ab)T=aTbT(ab)^T = a^T b^T, ab=0ab = 0 so a=0a = 0 or b=0b = 0, until it has been proved for matrices.

This chapter is part of MATH 133, Linear Algebra and Geometry (McGill)

The essentials

The product: sizes first, then a row meets a column

  • • AA is m×nm \times n and BB is n×pn \times p: ABAB exists because the INNER sizes agree, and it is m×pm \times p, the OUTER sizes. A sum A+BA + B needs identical sizes.
  • • (AB)ij(AB)_{ij} is row ii of AA against column jj of BB: ∑kaikbkj\sum_{k} a_{ik} b_{kj}. The first index picks a row of the LEFT factor, the second a column of the RIGHT factor.
  • • Column jj of ABAB is AA times column jj of BB, a combination of the columns of AA. Row ii of ABAB is row ii of AA times BB, a combination of the rows of BB.
  • • Always true: (AB)C=A(BC)(AB)C = A(BC), A(B+C)=AB+ACA(B + C) = AB + AC, (B+C)A=BA+CA(B + C)A = BA + CA, k(AB)=(kA)B=A(kB)k(AB) = (kA)B = A(kB), AI=IA=AAI = IA = A.
  • • Not true in general: AB=BAAB = BA, and 'AB=0AB = 0 so A=0A = 0 or B=0B = 0'. Both fail already for 2×22 \times 2 matrices.
2 × 33 × 2=2 × 2AB is 2 × 23 × 22 × 3=3 × 3BA is 3 × 3
The same two matrices in the two orders: ABAB is 2×22 \times 2 and BABA is 3×33 \times 3. For non-square factors, AB=BAAB = 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(A^T)_{ij} = a_{ji}. Rules: (AT)T=A(A^T)^T = A, (A+B)T=AT+BT(A + B)^T = A^T + B^T, (kA)T=kAT(kA)^T = kA^T, and (AB)T=BTAT(AB)^T = B^T A^T, with the order REVERSED.
  • • Symmetric: ST=SS^T = S, mirror pairs equal. Skew-symmetric: KT=−KK^T = -K, mirror pairs opposite and diagonal all zero. Every square AA is 12(A+AT)+12(A−AT)\frac{1}{2}(A + A^T) + \frac{1}{2}(A - A^T), in exactly one way.
  • • Powers exist for SQUARE matrices only. Nilpotent: Ak=0A^k = 0 for some kk. Idempotent: A2=AA^2 = A, hence An=AA^n = A for every n≥1n \ge 1.
  • • tr⁡A\operatorname{tr} A is the sum of the diagonal entries. tr⁡(A+B)=tr⁡A+tr⁡B\operatorname{tr}(A + B) = \operatorname{tr} A + \operatorname{tr} B and tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA), but tr⁡(AB)≠tr⁡A⋅tr⁡B\operatorname{tr}(AB) \neq \operatorname{tr} A \cdot \operatorname{tr} B in general.
31-2104-24501-2-1042-40symmetric: pairs equalskew: pairs opposite
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 00.

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.

NumbersMatricesVerdict
a(bc)=(ab)ca(bc) = (ab)c A(BC)=(AB)CA(BC) = (AB)C holds

Example: Brackets may move: with A=B=C=(1101)A = B = C = \begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}, both bracketings give (1301)\begin{pmatrix} 1 & 3 \\ 0 & 1 \end{pmatrix}.

a(b+c)=ab+aca(b + c) = ab + ac A(B+C)=AB+ACA(B + C) = AB + AC holds

Example: (1234)((10)+(01))=(13)+(24)=(37)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\left(\begin{pmatrix} 1 \\ 0 \end{pmatrix} + \begin{pmatrix} 0 \\ 1 \end{pmatrix}\right) = \begin{pmatrix} 1 \\ 3 \end{pmatrix} + \begin{pmatrix} 2 \\ 4 \end{pmatrix} = \begin{pmatrix} 3 \\ 7 \end{pmatrix}.

ab=baab = ba AB=BAAB = BA fails false for matrices

Example: (1002)(0100)=(0100)\begin{pmatrix} 1 & 0 \\ 0 & 2 \end{pmatrix}\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}, but the other order gives (0200)\begin{pmatrix} 0 & 2 \\ 0 & 0 \end{pmatrix}.

What to do: Keep every factor in its place. Swap two factors only after checking AB=BAAB = BA, or when one of them is cIcI.

(a+b)(a−b)(a + b)(a - b) (A+B)(A−B)(A + B)(A - B) A2−B2+BA−ABA^2 - B^2 + BA - AB two extra terms

Example: With A=(1002)A = \begin{pmatrix} 1 & 0 \\ 0 & 2 \end{pmatrix} and B=(0100)B = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}, the extra part BA−AB=(0100)BA - AB = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} is not zero.

What to do: Expand term by term, keeping the order: A2−AB+BA−B2A^2 - AB + BA - B^2. The middle cancels only if AB=BAAB = BA.

ab=0ab = 0 AB=0AB = 0 one factor is 00 false for matrices

Example: (1111)(1−1−11)=0\begin{pmatrix} 1 & 1 \\ 1 & 1 \end{pmatrix}\begin{pmatrix} 1 & -1 \\ -1 & 1 \end{pmatrix} = 0 with both factors non-zero.

What to do: Read AB=0AB = 0 column by column: each column of BB solves Ax=0Ax = 0. Nothing more.

(ab)2=a2b2(ab)^2 = a^2 b^2 (AB)2=A2B2(AB)^2 = A^2 B^2 fails false for matrices

Example: With A=(0100)A = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} and B=(0010)B = \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix}: (AB)2=(1000)(AB)^2 = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} but A2B2=0A^2 B^2 = 0.

What to do: (AB)2=ABAB(AB)^2 = ABAB: the BABA in the middle cannot be turned into ABAB.

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

“(1234)(0110)=(0230)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 2 \\ 3 & 0 \end{pmatrix}”

What to write

“Row against column: (1234)(0110)=(2143)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}\begin{pmatrix} 0 & 1 \\ 1 & 0 \end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 4 & 3 \end{pmatrix}, 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)TA(0, 1)^T, the second column of AA.

2. Squaring a matrix that is not square

1 to 2 marks, and every part built on it

What not to write

“AA is 2×32 \times 3, so A2A^2 is 2×32 \times 3 as well.”

What to write

“A2=AAA^2 = AA is (2×3)(2×3)(2 \times 3)(2 \times 3), inner sizes 3≠23 \neq 2: it does not exist. The products that do exist are AATAA^T, 2×22 \times 2, and ATAA^T A, 3×33 \times 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(AB)_{23} is column 2 of AA against row 3 of BB.”

What to write

“(AB)23(AB)_{23} is row 2 of AA against column 3 of BB: 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=(102−131210)A = \begin{pmatrix} 1 & 0 & 2 \\ -1 & 3 & 1 \\ 2 & 1 & 0 \end{pmatrix} and B=(2130−11120)B = \begin{pmatrix} 2 & 1 & 3 \\ 0 & -1 & 1 \\ 1 & 2 & 0 \end{pmatrix}, the right reading gives 00 and the backward one gives 66.

4. Transposing a product without reversing it

2 marks, and every symmetry proof that uses it

What not to write

“(AB)T=ATBT(AB)^T = A^T B^T”

What to write

“(AB)T=BTAT(AB)^T = B^T A^T. With AA of size 2×32 \times 3 and BB of size 3×13 \times 1, ATBTA^T B^T is (3×2)(1×3)(3 \times 2)(1 \times 3) and does not even exist.”

Why: Entry (i,j)(i,j) of (AB)T(AB)^T is (AB)ji=∑kajkbki(AB)_{ji} = \sum_k a_{jk} b_{ki}, which is row ii of BTB^T against column jj of ATA^T. 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(A - B)(A + B) = A^2 - B^2”

What to write

“(A−B)(A+B)=A2+AB−BA−B2(A - B)(A + B) = A^2 + AB - BA - B^2, which reduces to A2−B2A^2 - B^2 only if AB=BAAB = BA.”

Why: With A=(1002)A = \begin{pmatrix} 1 & 0 \\ 0 & 2 \end{pmatrix} and B=(0100)B = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix}, the leftover AB−BAAB - BA is (0−100)\begin{pmatrix} 0 & -1 \\ 0 & 0 \end{pmatrix}. The binomial formula is legitimate in one important case, a sum like cI+NcI + N, because cIcI commutes with everything.

6. Concluding that a matrix is zero because a power of it is

the whole question

What not to write

“N3=0N^3 = 0, so N=0N = 0.”

What to write

“N=(014002000)N = \begin{pmatrix} 0 & 1 & 4 \\ 0 & 0 & 2 \\ 0 & 0 & 0 \end{pmatrix} is not zero and N3=0N^3 = 0: NN is nilpotent. From AB=0AB = 0, conclude only that each column of BB solves Ax=0Ax = 0.”

014002000N002000000N²000000000N³N ≠ 0 and N² ≠ 0, yet N³ = 0
Each power pushes the non-zero entries one diagonal further from the main diagonal; at N3N^3 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×nn \times n matrix always has Nn=0N^n = 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

“(1301)2=(1901)\begin{pmatrix} 1 & 3 \\ 0 & 1 \end{pmatrix}^2 = \begin{pmatrix} 1 & 9 \\ 0 & 1 \end{pmatrix}”

What to write

“(1301)2=(1601)\begin{pmatrix} 1 & 3 \\ 0 & 1 \end{pmatrix}^2 = \begin{pmatrix} 1 & 6 \\ 0 & 1 \end{pmatrix}: the corner is 1⋅3+3⋅1=61 \cdot 3 + 3 \cdot 1 = 6.”

Why: A2=AAA^2 = 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

“AA and BB are symmetric, so ABAB is symmetric.”

What to write

“(AB)T=BTAT=BA(AB)^T = B^T A^T = BA, so ABAB is symmetric exactly when AB=BAAB = BA. For instance (1110)(2001)=(2120)\begin{pmatrix} 1 & 1 \\ 1 & 0 \end{pmatrix}\begin{pmatrix} 2 & 0 \\ 0 & 1 \end{pmatrix} = \begin{pmatrix} 2 & 1 \\ 2 & 0 \end{pmatrix} is not.”

Why: The reversal rule is the whole argument, one line long. Sums of symmetric matrices, A2A^2 and AATAA^T 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

“DD is diagonal, so DX=XDDX = XD for every XX.”

What to write

“Only the scalar matrices cIcI commute with everything: (1003)(0100)=(0100)\begin{pmatrix} 1 & 0 \\ 0 & 3 \end{pmatrix}\begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} = \begin{pmatrix} 0 & 1 \\ 0 & 0 \end{pmatrix} but in the other order (0300)\begin{pmatrix} 0 & 3 \\ 0 & 0 \end{pmatrix}.”

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)=tr⁡A⋅tr⁡B\operatorname{tr}(AB) = \operatorname{tr} A \cdot \operatorname{tr} B”

What to write

“The trace is additive, and tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA); it is not multiplicative: A=(1000)A = \begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix}, B=(0001)B = \begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix} give tr⁡(AB)=0\operatorname{tr}(AB) = 0 but tr⁡A⋅tr⁡B=1\operatorname{tr} A \cdot \operatorname{tr} B = 1.”

Why: The one product rule the trace has is the swap rule, and it only allows cyclic shifts: tr⁡(ABC)=tr⁡(CAB)\operatorname{tr}(ABC) = \operatorname{tr}(CAB), but not tr⁡(ACB)\operatorname{tr}(ACB) in general. It is also what proves that XY−YX=IXY - 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

one entryrow i, column jone columnall of A, column jone rowrow i, all of B
What each reading takes from each factor: a row and a column for one entry, all of AA and one column for a column, one row and all of BB for a row.
  • If one entry (i,j)(i,j) → row ii of the left factor against column jj of the right one, and nothing else

    Example: for two 3×33 \times 3 factors: 3 multiplications instead of 27

  • If one column of ABAB → AA times that column of BB, a combination of the columns of AA

    Example: A(1,−1,2)T=a1−a2+2a3A(1, -1, 2)^T = a_1 - a_2 + 2a_3

  • If one row of ABAB → that row of AA times BB, a combination of the rows of BB

    Example: (2,1,0) B=2r1+r2(2, 1, 0)\,B = 2r_1 + r_2

  • If a trace → only the diagonal entries of the product, or tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA) on the smaller product

    Example: AA is 2×32 \times 3, BB is 3×23 \times 2: two entries of ABAB, not three of BABA

  • If a product of three factors → bracket so that the intermediate product is the smallest

    Example: B(AB)B(AB) with ABAB of size 2×22 \times 2, rather than (BA)B(BA)B with BABA of size 3×33 \times 3

  • If a relation between the columns of BB → the same relation holds between the columns of ABAB

    Example: b3=2b1−b2b_3 = 2b_1 - b_2 gives (AB)3=2(AB)1−(AB)2(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 nn

  • If the matrix is diagonal → raise each diagonal entry to the power nn

    Example: diag⁡(2,−1)5=diag⁡(32,−1)\operatorname{diag}(2, -1)^5 = \operatorname{diag}(32, -1)

  • If it is strictly upper triangular, n×nn \times n → it is nilpotent: An=0A^n = 0

    Example: N=(014002000)N = \begin{pmatrix} 0 & 1 & 4 \\ 0 & 0 & 2 \\ 0 & 0 & 0 \end{pmatrix} gives N3=0N^3 = 0

  • If A2=AA^2 = A → idempotent: An=AA^n = A for every n≥1n \ge 1

    Example: (1100)10=(1100)\begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix}^{10} = \begin{pmatrix} 1 & 1 \\ 0 & 0 \end{pmatrix}

  • If A=cI+NA = cI + N with NN nilpotent → binomial theorem, legal because cIcI commutes with NN

    Example: (3103)n=(3nn 3n−103n)\begin{pmatrix} 3 & 1 \\ 0 & 3 \end{pmatrix}^n = \begin{pmatrix} 3^{n} & n\,3^{n-1} \\ 0 & 3^{n} \end{pmatrix}

  • If none of the above → compute A2A^2 and A3A^3, conjecture, then prove by induction

    Example: (1101)n=(1n01)\begin{pmatrix} 1 & 1 \\ 0 & 1 \end{pmatrix}^n = \begin{pmatrix} 1 & n \\ 0 & 1 \end{pmatrix}, proved with An+1=AnAA^{n+1} = A^n A

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×22 \times 2 matrices XX such that AX=XAAX = XA.”

  1. 1 Write the unknown in full: X=(abcd)X = \begin{pmatrix} a & b \\ c & d \end{pmatrix}.
  2. 2 Compute AXAX. Then compute XAXA as a SEPARATE product, row of XX against column of AA; it is not the same computation.
  3. 3 Equate the four entries and write the four equations, even the ones that repeat.
  4. 4 Solve the homogeneous system and name the free parameters.
  5. 5 Write the general XX and check one numerical member in both products.

Concluding sentence

“The matrices that commute with AA are exactly the matrices X=(3b+db0d)X = \begin{pmatrix} 3b + d & b \\ 0 & d \end{pmatrix} with bb and dd real, that is X=(b+d)I+bAX = (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 AATAA^T is symmetric”, “show that A+ATA + A^T is symmetric”, “prove (An)T=(AT)n(A^n)^T = (A^T)^n”

  1. 1 Start from ONE side, usually the transpose of the expression, never from the conclusion.
  2. 2 Transform it with named rules only: the reversal rule (XY)T=YTXT(XY)^T = Y^T X^T, (XT)T=X(X^T)^T = X, (X+Y)T=XT+YT(X + Y)^T = X^T + Y^T.
  3. 3 Arrive at the expression itself, or at its opposite for a skew-symmetric claim.
  4. 4 For a statement about every nn, use induction: (An+1)T=(AnA)T=AT(An)T(A^{n+1})^T = (A^n A)^T = A^T (A^n)^T.

Concluding sentence

“(AAT)T=(AT)TAT=AAT(AA^T)^T = (A^T)^T A^T = AA^T by the reversal rule and (AT)T=A(A^T)^T = A, so AATAA^T 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 typical problem, taken apart

Every matrix that commutes with a given one, solved step by step

Find all 2×22 \times 2 matrices XX that commute with A=(210−1)A = \begin{pmatrix} 2 & 1 \\ 0 & -1 \end{pmatrix}, and show that each of them is a combination of II and AA.

Step 1

Write X=(abcd)X = \begin{pmatrix} a & b \\ c & d \end{pmatrix} and compute AX=(2a+c2b+d−c−d)AX = \begin{pmatrix} 2a + c & 2b + d \\ -c & -d \end{pmatrix}, row of AA against column of XX.

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 XAXA separately: XA=(2aa−b2cc−d)XA = \begin{pmatrix} 2a & a - b \\ 2c & c - d \end{pmatrix}, row of XX against column of AA.

Why

This is the step that is skipped. XAXA is a different product, with the roles of rows and columns exchanged, and its entries are not a rearrangement of those of AXAX.

Step 3

Equate entry by entry: 2a+c=2a2a + c = 2a, 2b+d=a−b2b + d = a - b, −c=2c-c = 2c and −d=c−d-d = c - d. Three of them give c=0c = 0, the fourth gives a=3b+da = 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+db0d)X = \begin{pmatrix} 3b + d & b \\ 0 & d \end{pmatrix} with bb, dd real. Since bA+(b+d)I=(2b+b+db0−b+b+d)=XbA + (b + d)I = \begin{pmatrix} 2b + b + d & b \\ 0 & -b + b + d \end{pmatrix} = X, every such XX is (b+d)I+bA(b + d)I + bA.

Why

Two free parameters, and the family is exactly the combinations of II and AA. Matrices of the form αI+βA\alpha I + \beta A obviously commute with AA, so this is also the sanity check on the size of the answer.

Step 5

Check with b=1b = 1, d=0d = 0: X=(3100)X = \begin{pmatrix} 3 & 1 \\ 0 & 0 \end{pmatrix}, and AX=(6200)=XAAX = \begin{pmatrix} 6 & 2 \\ 0 & 0 \end{pmatrix} = 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 AA are exactly X=(3b+db0d)X = \begin{pmatrix} 3b + d & b \\ 0 & d \end{pmatrix}, b,d∈Rb, d \in \mathbb{R}, that is X=(b+d)I+bAX = (b + d)I + bA.”

The classic mistake on this problem: Writing XAXA as the same matrix as AXAX turns all four equations into 0=00 = 0 and concludes that every matrix commutes with AA. One test refutes it: X=(0010)X = \begin{pmatrix} 0 & 0 \\ 1 & 0 \end{pmatrix} gives AX=(10−10)AX = \begin{pmatrix} 1 & 0 \\ -1 & 0 \end{pmatrix} but XA=(0021)XA = \begin{pmatrix} 0 & 0 \\ 2 & 1 \end{pmatrix}.

Learn by heart

  • • (m×n)(n×p)=m×p(m \times n)(n \times p) = m \times p: the inner sizes agree, the outer sizes give the shape.
  • • (AB)ij(AB)_{ij} = row ii of AA against column jj of BB. Column jj of ABAB = AbjA b_j; row ii of ABAB = riBr_i B.
  • • AB≠BAAB \neq BA in general; AB=0AB = 0, A2=0A^2 = 0 and A2=IA^2 = I with A≠±IA \neq \pm I all happen with non-zero 2×22 \times 2 matrices.
  • • (AB)T=BTAT(AB)^T = B^T A^T, order REVERSED; AATAA^T and ATAA^T A are always symmetric.
  • • A=12(A+AT)+12(A−AT)A = \frac{1}{2}(A + A^T) + \frac{1}{2}(A - A^T): symmetric plus skew-symmetric, in exactly one way.
  • • Binomial theorem for (A+B)n(A + B)^n ONLY when AB=BAAB = BA; cIcI commutes with every matrix, and only cIcI does.
  • • Powers entry by entry: diagonal matrices ONLY.
  • • tr⁡(AB)=tr⁡(BA)\operatorname{tr}(AB) = \operatorname{tr}(BA), cyclic shifts only; hence XY−YX=IXY - 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.

Practise it

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.

  • 10 corrected exercises
  • 100 points
  • 150 minutes
Do the exercises
Previous sheet Homogeneous systems and the rank theorem Next sheet Matrix inverses

See also

Looking for a MATH 133 tutor in Montreal?

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.

Site by Studio Squalli