Linear Algebra and Vector Geometry 201-SN4-RE • CEGEP, Montreal

Revision sheet: matrices, systems and determinants (201-SN4-RE)

This sheet does not repeat the definition of the matrix product: you have it in your notes. It deals with what decides the mark, namely every reflex from the algebra of real numbers that becomes wrong with matrices, and the write-up that a 201-SN4-RE (formerly 201-NYC) grader expects when you solve a system.

It is written for CEGEP students in Science and in the mathematics profile of Social Science. Once you have read it, the corrected exercise set on the same chapter puts each reflex to the test.

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.

The thread of the chapter

A matrix is not a number: the product is not commutative, a zero product does not force either factor to be zero, and division does not exist. Every mark lost in this chapter comes from a reflex of real-number algebra applied to matrices.

This chapter is part of 201-SN4-RE, Linear Algebra and Vector Geometry

The essentials

When the product exists, and what size it has

  • • ABAB exists only if the number of COLUMNS of AA equals the number of ROWS of BB. The result then has the number of rows of AA and the number of columns of BB.
  • • The entry (i, j)(i,\ j) of ABAB is the dot product of ROW ii of AA with COLUMN jj of BB.
  • • Sums and scalar multiples are computed entry by entry, and only between matrices of the SAME size.
  • • Transpose: (AT)ij=Aji(A^{T})_{ij}=A_{ji}. A 2×32\times 3 matrix becomes a 3×23\times 2 matrix.
  • • II is the only identity element: AI=IA=AAI=IA=A. There is no division, only multiplication by the inverse, on the left or on the right depending on the side chosen.
2 x 33 x 4gives2 x 4equalsize of the product
The two inner sizes must be equal for the product to exist; the two OUTER sizes give the size of the result.

Writing the sizes in the margin before setting up a product, in the form (2×3)(3×4)=(2×4)(2\times 3)(3\times 4)=(2\times 4), takes five seconds and removes a whole family of errors.

A system in matrix form, and the 2x2 inverse

  • • Every linear system is written AX=BAX=B, with AA the coefficient matrix, XX the COLUMN of unknowns and BB the column of constants.
  • • det⁡(abcd)=ad−bc\det\begin{pmatrix} a & b \\ c & d \end{pmatrix}=ad-bc, and AA is invertible if and only if this determinant is not zero.
  • • A−1=1det⁡A(d−b−ca)A^{-1}=\dfrac{1}{\det A}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}: SWAP aa and dd, change the SIGN of bb and cc, then divide by the determinant.
  • • If det⁡A≠0\det A\neq 0, the solution is X=A−1BX=A^{-1}B, and it is unique. If det⁡A=0\det A=0, there is no unique solution: either none or infinitely many.
  • • Cramer's rule: xi=det⁡Aidet⁡Ax_{i}=\dfrac{\det A_{i}}{\det A}, where AiA_{i} is AA with column ii replaced by BB.
-2-112345-112345(1, 2)x + y = 3x − 2y = −3
The system {x+y=3x−2y=−3\begin{cases} x+y=3 \\ x-2y=-3 \end{cases} has determinant −3≠0-3\neq 0: its two lines meet at a single point, (1, 2)(1,\ 2), and that point is exactly X=A−1BX=A^{-1}B.

Multiplying on the left by A−1A^{-1} is legitimate only if you write A−1(AX)=A−1BA^{-1}(AX)=A^{-1}B: associativity does the work, and the side chosen must be the same on both sides of the equation.

The identities of real numbers that become false

  • • AB≠BAAB\neq BA in general. The two products may not even have the same size, or one may exist and the other not.
  • • AB=0AB=0 implies neither A=0A=0 nor B=0B=0. There is no zero-product rule for matrices.
  • • (AB)T=BTAT(AB)^{T}=B^{T}A^{T}: transposition REVERSES the order. Likewise (AB)−1=B−1A−1(AB)^{-1}=B^{-1}A^{-1}.
  • • (A+B)2=A2+AB+BA+B2(A+B)^{2}=A^{2}+AB+BA+B^{2}, not A2+2AB+B2A^{2}+2AB+B^{2}, unless AA and BB commute.
  • • AB=ACAB=AC does not imply B=CB=C, unless AA is invertible: multiplying on the left by A−1A^{-1} then proves it.

The only way to know whether an identity of real numbers survives is to ask where COMMUTATIVITY was used in its proof. If it was, the identity falls.

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. Setting up a product whose sizes do not match

the whole question, and an answer that makes no sense.

What not to write

“AA is 2×32\times 3 and BB is 2×32\times 3: I compute ABAB.”

What to write

“ABAB does not exist: AA has 33 columns and BB has 22 rows. On the other hand ABTAB^{T} exists, because BTB^{T} is 3×23\times 2, and the result is a 2×22\times 2 matrix.”

Why: The existence condition is not a formality: it is what lets the row-by-column dot product have the same number of terms on both sides.

2. Treating the matrix product as if it were commutative

2 marks per product, and more if the result is used in a composition of transformations.

What not to write

“AB=BAAB=BA, so I compute in whichever order is easier.”

What to write

“With A=(1201)A=\begin{pmatrix} 1 & 2 \\ 0 & 1 \end{pmatrix} and B=(1011)B=\begin{pmatrix} 1 & 0 \\ 1 & 1 \end{pmatrix}: AB=(3211)AB=\begin{pmatrix} 3 & 2 \\ 1 & 1 \end{pmatrix} and BA=(1213)BA=\begin{pmatrix} 1 & 2 \\ 1 & 3 \end{pmatrix}. The order is set by the question.”

32111213ABBAsame factors, different results
The same two matrices multiplied in both orders: the off-diagonal entries happen to agree, but the diagonals, 3,13, 1 against 1,31, 3, do not, so AB≠BAAB\neq BA. The order is given by the question, not chosen.

Why: The entry (i, j)(i,\ j) crosses row ii of the first factor with column jj of the second: swapping the factors swaps the roles of the rows and the columns, and so changes the result.

3. Concluding from a zero product that one of the factors is zero

the whole proof question, often 4 marks.

What not to write

“AB=0AB=0, so A=0A=0 or B=0B=0.”

What to write

“False for matrices: with A=(1000)A=\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} and B=(0001)B=\begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}, AB=0AB=0 although neither of them is zero.”

-1123-1123vBvA(Bv) = 0
AA and BB project onto the xx-axis and onto the yy-axis: BB sends v⃗\vec{v} onto the vertical axis, then AA crushes that result to 0⃗\vec{0}. Neither AA nor BB is zero, and yet AB=0AB=0.

Why: The zero-product rule comes from the existence of an inverse for every non-zero real number. A non-zero matrix can perfectly well be singular, and that is exactly the case here.

4. Transposing a product without reversing the order

2 marks, and an expression that often makes no sense.

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}: transposition reverses the order. The size check is immediate: if AA is 2×32\times 3 and BB is 3×43\times 4, then ATBTA^{T}B^{T} does not even exist, whereas BTATB^{T}A^{T} is indeed 4×24\times 2.”

abcdefadbecfA: 2 x 3Aᵀ: 3 x 2
The transpose flips the array: the first row of AA (in blue) becomes the first column of ATA^{T}. This flip is what forces the order of the factors to be reversed in (AB)T(AB)^{T}.

Why: The transpose swaps rows and columns, and the product crosses the rows of the first factor with the columns of the second. Swapping the two roles forces you to swap the two factors as well.

5. Expanding the square of a sum of matrices like that of a sum of real numbers

the whole question, and the error comes back with (A+B)(A−B)(A+B)(A-B), which equals A2−B2A^{2}-B^{2} only in the same case.

What not to write

“(A+B)2=A2+2AB+B2(A+B)^{2}=A^{2}+2AB+B^{2}.”

What to write

“(A+B)2=(A+B)(A+B)=A2+AB+BA+B2(A+B)^{2}=(A+B)(A+B)=A^{2}+AB+BA+B^{2}. ABAB and BABA can be combined only if the two matrices COMMUTE, which must then be proved.”

Why: The real-number identity uses commutativity to add ABAB and BABA. Without it, the four terms of the expansion stay distinct.

6. Putting entries in the wrong place in the 2x2 inverse formula

the whole question, when checking AA−1=IAA^{-1}=I would have taken thirty seconds.

What not to write

“A−1=1det⁡A(a−b−cd)A^{-1}=\dfrac{1}{\det A}\begin{pmatrix} a & -b \\ -c & d \end{pmatrix}, you just change the signs of bb and cc.”

What to write

“A−1=1det⁡A(d−b−ca)A^{-1}=\dfrac{1}{\det A}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}: aa and dd are SWAPPED as well as the signs being changed. The check is to verify AA−1=IAA^{-1}=I.”

then divide by det AAadj Aabcdd-b-cagivesa and d swapb and c change sign
Two moves, not one: the main diagonal is swapped, the other diagonal changes sign. Forgetting the first leaves a matrix that does not give back the identity.

Why: Swapping the diagonal is not decoration: it is what makes ad−bcad-bc appear in both diagonal entries of the product AA−1AA^{-1}, hence the determinant you then divide by.

7. Dividing by a matrix

2 marks for rigour, and more if the side chosen is not the same on both sides.

What not to write

“AX=BAX=B, so X=BAX=\dfrac{B}{A}.”

What to write

“Matrix division does not exist. Multiply both sides on the LEFT by A−1A^{-1}: A−1AX=A−1BA^{-1}AX=A^{-1}B, so X=A−1BX=A^{-1}B.”

Why: Since the product is not commutative, A−1BA^{-1}B and BA−1BA^{-1} are two different matrices. A fraction does not say on which side you multiply: it is ambiguous, and therefore not allowed.

8. Using the inverse or Cramer without looking at the determinant

3 marks, and an invented answer, since the matrix written does not exist.

What not to write

“X=A−1BX=A^{-1}B, so the system has a unique solution.”

What to write

“I first compute det⁡A\det A. If it is 00, A−1A^{-1} does not exist and Cramer does not apply: the system then has either no solution or infinitely many, and I must use Gaussian elimination.”

Why: The inverse and Cramer's rule share the same hypothesis, a non-zero determinant, and both divide by it. The determinant is therefore the first calculation, not the last.

Which method to choose

Which method solves a system, given its shape and its determinant

First check whether the system is SQUARE, then compute the determinant. These two facts point to the method, and there are only four.

  • If a square 2×22\times 2 system with det⁡A≠0\det A\neq 0 → explicit inverse, X=A−1BX=A^{-1}B, with the swap-and-sign formula

    Example: det⁡A=−5\det A=-5 gives A−1=1−5(−1−3−12)A^{-1}=\frac{1}{-5}\begin{pmatrix} -1 & -3 \\ -1 & 2 \end{pmatrix}

  • If a square 3×33\times 3 system with det⁡A≠0\det A\neq 0 and a SINGLE unknown asked for → Cramer's rule on that unknown only, which avoids inverting the whole matrix

    Two determinants of order 3 are enough, against nine cofactors for the full inverse.

  • If a square system with det⁡A=0\det A=0 → neither inverse nor Cramer: Gaussian elimination on the augmented matrix, to tell no solution from infinitely many

  • If a NON-square system, or more than three unknowns → Gauss-Jordan elimination on [A ∣ B][A\,|\,B], the only general method

    A non-square matrix has no determinant, and a large one costs more than the reduction itself: looking for it is time lost.

  • If the same AA is used with SEVERAL right-hand sides → compute A−1A^{-1} once, then multiply by each BB

    This is the only case where inverting the matrix pays off better than Gauss.

No branch applies? Then the system contains a parameter. Study det⁡A\det A as a function of the parameter, and treat each value that makes it vanish separately.

Does this real-number identity survive for matrices?

Ask where the proof of the identity uses the commutativity of the product. If it does, the identity falls.

  • If the identity involves a single matrix, like A2A=A3A^{2}A=A^{3} → it SURVIVES: a matrix always commutes with its own powers and with II

  • If the identity combines two terms of the form ABAB and BABA → it FALLS: (A+B)2(A+B)^{2} keeps four distinct terms

    Example: (A+B)2=A2+AB+BA+B2(A+B)^{2}=A^{2}+AB+BA+B^{2}

  • If the identity reverses an operation on a product, transpose or inverse → it survives provided the order is REVERSED

    Example: (AB)T=BTAT(AB)^{T}=B^{T}A^{T} and (AB)−1=B−1A−1(AB)^{-1}=B^{-1}A^{-1}

  • If the identity cancels a common factor, as in AB=ACAB=AC so B=CB=C → it FALLS, unless AA is invertible, which must then be written

  • If the identity uses the zero-product rule → it FALLS: AB=0AB=0 does not force either factor to be zero

A 2×22\times 2 counterexample is always enough to refute an identity, and the two most useful ones are (1000)\begin{pmatrix} 1 & 0 \\ 0 & 0 \end{pmatrix} and (0001)\begin{pmatrix} 0 & 0 \\ 0 & 1 \end{pmatrix}: learning them by heart saves five minutes on the exam.

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.

Solving a system with the inverse matrix

When to use it: The question asks you to solve “using matrices”, or gives AA and BB and asks for XX.

  1. 1 Write the system in the form AX=BAX=B, giving the three matrices explicitly, and recalling that XX is a COLUMN.
  2. 2 Compute det⁡A\det A and conclude on the existence of the inverse: “det⁡A=−5≠0\det A=-5\neq 0, so AA is invertible and the system has a unique solution”.
  3. 3 Write A−1A^{-1} by swapping the diagonal and changing the signs, then simplify the fraction.
  4. 4 Justify the step: “multiplying on the LEFT by A−1A^{-1}, we get X=A−1BX=A^{-1}B”, then carry out the product.
  5. 5 Check by recomputing AXAX and getting BB back, and write this check on your paper.

Concluding sentence

Since det⁡A=−5≠0\det A=-5\neq 0, the matrix AA is invertible and the system has a unique solution: X=A−1B=(21)X=A^{-1}B=\begin{pmatrix} 2 \\ 1 \end{pmatrix}, that is, x=2x=2 and y=1y=1.

The trap: Writing X=BA−1X=BA^{-1}. The product is not commutative, and here it does not even exist: BB is 2×12\times 1 and A−1A^{-1} is 2×22\times 2. The side of the multiplication must be the same on both sides of the equation.

Marking: 0.5 mark for the matrix form, 0.5 mark for the determinant and the invertibility conclusion, 1 mark for the inverse, 1 mark for the product and the check.

Proving a property for arbitrary matrices

When to use it: The question says “show that”, “prove that for all matrices AA and BB”, or asks for a counterexample.

  1. 1 Set the frame: “Let AA and BB be two square matrices of order nn”, or state the sizes if the product must exist.
  2. 2 Start from the more COMPLICATED side and transform it, naming on each line the property used: associativity, distributivity, definition of the inverse.
  3. 3 Never swap two factors without having written and justified that the matrices commute.
  4. 4 Conclude by returning exactly to the statement you started from, with its quantifiers.
  5. 5 If the property is FALSE, give a complete 2×22\times 2 counterexample, with both sides computed, and say so.

Concluding sentence

For all matrices AA and BB such that the product ABAB exists, (AB)T=BTAT(AB)^{T}=B^{T}A^{T}, which completes the proof.

The trap: Proving a general property on a numerical example. An example can only REFUTE: you need letters to prove, and numbers only to contradict.

Marking: 0.5 mark for the frame and the quantifiers, 1.5 marks for the calculation justified line by line, 0.5 mark for the conclusion.

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

A 2x2 system, solved with the inverse and checked with Cramer

Solve the system {2x+3y=7x−y=1\begin{cases} 2x+3y=7 \\ x-y=1 \end{cases} by the matrix method, then check the result with Cramer's rule.

Step 1

A=(231−1)A=\begin{pmatrix} 2 & 3 \\ 1 & -1 \end{pmatrix}, X=(xy)X=\begin{pmatrix} x \\ y \end{pmatrix}, B=(71)B=\begin{pmatrix} 7 \\ 1 \end{pmatrix}, and the system reads AX=BAX=B.

Why

Writing the three matrices separately avoids the most frequent error, the one that lines the unknowns up in a row instead of a column.

Step 2

det⁡A=2×(−1)−3×1=−2−3=−5≠0\det A=2\times(-1)-3\times 1=-2-3=-5\neq 0, so AA is invertible and the system has a unique solution.

Why

This calculation decides everything: without it, you would write an A−1A^{-1} that may not exist. It is also the only justification of uniqueness, which is worth half a mark.

Step 3

A−1=1−5(−1−3−12)=(153515−25)A^{-1}=\dfrac{1}{-5}\begin{pmatrix} -1 & -3 \\ -1 & 2 \end{pmatrix}=\begin{pmatrix} \frac{1}{5} & \frac{3}{5} \\ \frac{1}{5} & -\frac{2}{5} \end{pmatrix}.

Why

The diagonal entries 22 and −1-1 have been swapped, and 33 and 11 have changed sign. It is the double move that half of the papers reduce to a single one.

Step 4

Check: AA−1=(25+3565−6515−1535+25)=(1001)AA^{-1}=\begin{pmatrix} \frac{2}{5}+\frac{3}{5} & \frac{6}{5}-\frac{6}{5} \\ \frac{1}{5}-\frac{1}{5} & \frac{3}{5}+\frac{2}{5} \end{pmatrix}=\begin{pmatrix} 1 & 0 \\ 0 & 1 \end{pmatrix}.

Why

Thirty seconds that secure the most error-prone step of the problem. Any entry other than 1 on the diagonal, or other than 0 off it, would expose a forgotten swap.

Step 5

Multiplying on the LEFT by A−1A^{-1}: X=A−1B=(75+3575−25)=(21)X=A^{-1}B=\begin{pmatrix} \frac{7}{5}+\frac{3}{5} \\ \frac{7}{5}-\frac{2}{5} \end{pmatrix}=\begin{pmatrix} 2 \\ 1 \end{pmatrix}.

Why

The words “on the left” are not decoration: BA−1BA^{-1} does not even exist here, since the sizes do not match. Saying it earns half a mark for rigour.

Step 6

Check in the system: 2×2+3×1=72\times 2+3\times 1=7 and 2−1=12-1=1.

Why

Substituting back tests BOTH equations, whereas the matrix calculation may have gone wrong on a single row of A−1A^{-1}.

Step 7

Check with Cramer: det⁡A1=∣731−1∣=−7−3=−10\det A_{1}=\begin{vmatrix} 7 & 3 \\ 1 & -1 \end{vmatrix}=-7-3=-10, so x=−10−5=2x=\dfrac{-10}{-5}=2.

Why

Replace the FIRST column by BB to get xx, not the first row. This confusion is the only possible error in Cramer's rule.

Step 8

det⁡A2=∣2711∣=2−7=−5\det A_{2}=\begin{vmatrix} 2 & 7 \\ 1 & 1 \end{vmatrix}=2-7=-5, so y=−5−5=1y=\dfrac{-5}{-5}=1, the same values as with the inverse.

Why

Two independent methods giving the same pair: it is the best guarantee available before handing in, and it costs only two 2x2 determinants.

The conclusion, written out

The system has the unique solution x=2x=2 and y=1y=1, obtained with X=A−1BX=A^{-1}B and confirmed by Cramer's rule.

The classic mistake on this problem: Writing A−1=1−5(2−3−1−1)A^{-1}=\frac{1}{-5}\begin{pmatrix} 2 & -3 \\ -1 & -1 \end{pmatrix}, changing only the signs without swapping the diagonal. The product AA−1AA^{-1} then does not give the identity, and the check in step 4 would have shown it.

Learn by heart

  • • ABAB exists if the columns of AA == the rows of BB; the size of the product is rows of AA by columns of BB.
  • • AB≠BAAB\neq BA in general: the order is set by the question, never chosen.
  • • AB=0AB=0 implies neither A=0A=0 nor B=0B=0.
  • • (AB)T=BTAT(AB)^{T}=B^{T}A^{T} and (AB)−1=B−1A−1(AB)^{-1}=B^{-1}A^{-1}: the order is REVERSED.
  • • (A+B)2=A2+AB+BA+B2(A+B)^{2}=A^{2}+AB+BA+B^{2}, four terms.
  • • det⁡(abcd)=ad−bc\det\begin{pmatrix} a & b \\ c & d \end{pmatrix}=ad-bc, and AA is invertible if and only if it is non-zero.
  • • A−1=1det⁡A(d−b−ca)A^{-1}=\frac{1}{\det A}\begin{pmatrix} d & -b \\ -c & a \end{pmatrix}: SWAP aa and dd, change the sign of bb and cc.
  • • Matrix division does not exist: multiply by the inverse, and say on which side.
  • • Cramer: xi=det⁡Aidet⁡Ax_{i}=\frac{\det A_{i}}{\det A}, replacing COLUMN ii by BB.
  • • det⁡A=0\det A=0: neither inverse nor Cramer. Switch to Gaussian elimination.

Frequently asked questions

Why is the product of two matrices not commutative?

Because each entry of the product crosses a row of the first factor with a column of the second. Swapping the two factors swaps the roles of the rows and the columns, and so changes the entries you get. The two products may not even have the same size, or one may exist and the other not.

How do you know if a product of matrices exists?

The number of columns of the first matrix must equal the number of rows of the second. The result then has as many rows as the first and as many columns as the second. Writing the two sizes side by side before computing settles the question in five seconds.

How do you find the inverse of a two by two matrix?

First compute the determinant, the product of the main diagonal minus the product of the other two entries. If it is not zero, swap the two entries of the main diagonal, change the sign of the other two, then divide the whole matrix by the determinant. The check is to get the identity back when you multiply by the original matrix.

Can you divide by a matrix?

No. Division does not exist for matrices, because the product is not commutative and a fraction would not say on which side you multiply. So you multiply by the inverse matrix, stating whether it is on the left or on the right, and doing the same thing on both sides of the equation.

What do you do when the determinant of the system is zero?

Neither the inverse matrix nor Cramer's rule applies, since both divide by this determinant. The system then has no unique solution: it has either none or infinitely many. Switch to Gaussian elimination on the augmented matrix, which is the only way to tell the two cases apart.

When is it better to invert the matrix than to use Gaussian elimination?

When the same coefficient matrix is used with several different right-hand sides, which happens in production or ticket-sales problems. You compute the inverse once, then each situation is solved by a single multiplication. In every other case, Gaussian elimination is faster and less risky.

Practise it

Corrected exercises: Matrices, systems and determinants, 201-SN4-RE

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.

  • 17 corrected exercises
  • 170 points
  • 225 minutes
Do the exercises
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.

What is it about?
I read every request myself, nobody else sees it. No need to write your name or your school.
When your request is dealt with, you hear about it by email and in your space.

By sending, you agree that I read your request to answer it. It is kept with your account, erased with it, and never published: privacy policy.

Previous sheet Lines and planes in space Next sheet Linear systems, Gauss and Gauss-Jordan

© Ahmed Squalli Houssaini. Revision sheet published at www.letuteurscientifique.ca/en/fiches/cegep-sn4-matrices-and-determinants. Free for personal and classroom use; republishing it elsewhere requires written permission (legal notice).

See also

Looking for a 201-SN4-RE tutor in Montreal?

Get in touch for a first session. We go over the moves that cost marks on the linear algebra exam, from reading a system to writing a proof about arbitrary matrices, then put them to the test on exercises at the real level of CEGEP evaluations.

Site by Studio Squalli