Matrices and Determinants
Matrices and Determinants
INTRODUCTION
There are many real-world situations where solving an equation is valuable. The world is a
very complicated place and many more situations lead to more than one variable. In that case,
solving a system of equations becomes important. In this section, we will describe another
method for solving linear systems called Cramer’s rule, which uses determinants. However,
this method can only be used on square matrices; when the number of equations equals the
number of variables and is typically used for systems with either two or three equations.
LEARNING OUTCOMES
COMPILED BY T. PAEPAE
1.1 MATRIX NOTATION AND DETERMINANTS
You are currently familiar with solving a system of equations (a set of equations that involve
the same variables) in two variables using either elimination or substitution methods. In this
section, you will study another technique that involves the use of a rectangular array of real
numbers called a matrix. This is motivated by the fact that some methods are easier to apply
than others and are more appropriate in certain situations.
The numbers within a matrix are called an array and the coefficients forming the array are
called the elements (or entries) of the matrix (importantly, note that matrix definition, notation,
and operations will be considered in detail in the second semester).
Every square matrix (a matrix with the same number of rows as columns) can be associated
with a real number called its determinant. It is a number that is very useful in mathematics
because it has multiple applications. E.g., it can be used to solve systems of linear equations
or determine whether a matrix has an inverse. We denote the determinant of a square matrix
𝐴𝐴 by the symbol det(𝐴𝐴) or |𝐴𝐴|. The following box gives the definition of a 2 × 2 determinant.
𝑎𝑎 𝑏𝑏
The determinant of a 2 × 2 matrix 𝐴𝐴 = � � is given by
𝑐𝑐 𝑑𝑑
𝑎𝑎 𝑏𝑏
det(𝐴𝐴) = |𝐴𝐴| = � � = 𝑎𝑎𝑎𝑎 − 𝑏𝑏𝑏𝑏
𝑐𝑐 𝑑𝑑
Note that the determinant is the difference of the products of the two diagonals of the matrix.
1
Notice that brackets, [ ], are used to denote a matrix, whereas vertical lines similar to absolute
value are used to denote the determinant of a matrix.
2 −5 0.5 0.2 2
1.1) � � 1.2) � � 1.3) � �3 1�
−1 4 −3 −4.2 2 3
Solution:
2 −5
1.1) � � = (2)(4) − (−5)(−1) = 8 − 5 = 3
−1 4
0.5 0.2
1.2) � � = (0.5)(−4.2) − (0.2)(−3) = −2.1 + 0.6 = −1.5
−3 −4.2
2
� �3 1� = � � (3) − (1)(2) = 2 − 2 = 0
2
1.3)
3
2 3
One method is to augment the 3 × 3 matrix with a repetition of the first two columns, giving a
3 × 5 matrix. Then we calculate the sum of the products of entries down each of the three
diagonals (upper left to lower right) and subtract the products of entries up each of the three
diagonals (lower left to upper right). This is more easily understood with a visual and an
example. Determine the determinant of the 3 × 3 matrix.
2
𝑎𝑎1 𝑏𝑏1 𝑐𝑐1 𝑎𝑎1 𝑏𝑏1
det(𝐴𝐴) = �𝑎𝑎2 𝑏𝑏2 𝑐𝑐2 � 𝑎𝑎2 𝑏𝑏2 �
𝑎𝑎3 𝑏𝑏3 𝑐𝑐3 𝑎𝑎3 𝑏𝑏3
2. From upper left to lower right: Multiply the entries down the first diagonal. Add the result
to the product of entries down the second diagonal. Add this result to the product of the
entries down the third diagonal.
a1 b1 c1 a1 b1
a2 b2 c2 a2 b2
a3 b3 c3 a 3 b3
+ + +
3. From lower left to upper right: Subtract the product of entries up the first diagonal. From
this result subtract the product of entries up the second diagonal. From this result, subtract
the product of entries up the third diagonal.
a1 b1 c1 a1 b1
a 2 b2 c2 a 2 b2
a3 b3 c3 a3 b3
− − −
det(𝐴𝐴) = 𝑎𝑎1 𝑏𝑏2 𝑐𝑐3 + 𝑏𝑏1 𝑐𝑐2 𝑎𝑎3 + 𝑐𝑐1 𝑎𝑎2 𝑏𝑏3 − 𝑐𝑐1 𝑏𝑏2 𝑎𝑎3 − 𝑎𝑎1 𝑐𝑐2 𝑏𝑏3 − 𝑏𝑏1 𝑎𝑎2 𝑐𝑐3 (1)
1 3 −2
Find the value of �2 0 1 � using Sarrus’ rule.
4 −1 1
Solution:
1 3 −21 3
2 0 1 2 0
4 −1 1 4 −1
3
1.1.3.2 Method 2 – Expansion by cofactors
The value of a determinant of order 3 is the sum of three products obtained by multiplying
each element in any row or any column by its cofactor. This is called expanding along a row
𝑎𝑎1 𝑏𝑏1 𝑐𝑐1
or column. That is, given the square matrix 𝐴𝐴 = �𝑎𝑎2 𝑏𝑏2 𝑐𝑐2 �, the third-order determinant of 𝐴𝐴
𝑎𝑎3 𝑏𝑏3 𝑐𝑐3
can be defined in terms of second-order determinants as follows:
𝑎𝑎1 𝑏𝑏1 𝑐𝑐1
𝑏𝑏 𝑐𝑐2 𝑎𝑎2 𝑐𝑐2 𝑎𝑎2 𝑏𝑏2
det(𝐴𝐴) = �𝑎𝑎2 𝑏𝑏2 𝑐𝑐2 � = 𝑎𝑎1 � 2 � − 𝑏𝑏1 �𝑎𝑎 𝑐𝑐3 � + 𝑐𝑐1 �𝑎𝑎3 �
𝑏𝑏3 𝑐𝑐3 3 𝑏𝑏3
𝑎𝑎3 𝑏𝑏3 𝑐𝑐3
= 𝑎𝑎1 (𝑏𝑏2 𝑐𝑐3 − 𝑐𝑐2 𝑏𝑏3 ) − 𝑏𝑏1 (𝑎𝑎2 𝑐𝑐3 − 𝑐𝑐2 𝑎𝑎3 ) + 𝑐𝑐1 (𝑎𝑎2 𝑏𝑏3 − 𝑏𝑏2 𝑏𝑏3 ) (2)
Compare equation (2) with equation (1). To better understand this procedure, we introduce
the concept of a minor of an element, sign of an element, and cofactor of an element.
The sign factor associated with an element depends on the position of the element in the
determinant. To find the sign factor, add the row number and column number, and:
In a 3 × 3 determinant, the sign factor can also be determined with the following grit pattern:
+ − +
�− + −�
+ − +
4
1.1.3.2.3 Cofactor of an element (or signed minor)
A quantity closely associated with the minor of an element is the cofactor of an element, which
is defined as the product of the minor and the sign factor associated with that element.
1 −6
The minor of 5 is � � = (2 − 6) = −4. Since the place sign of 5 is (−1), the required
−1 2
cofactor is 4.
−4 3 2
1. Evaluate � 2 −1 2� using expansion by cofactors.
1 −2 3
Solution:
It is important to note that the determinant will work out the same regardless of which row or
column you choose to expand along. Hence, if possible, you should choose a row or column
with one or more zeros to minimize the number of computations.
If we choose the first row, we get
−4 3 2
−1 2 2 2 2 −1
2 − 1 2 = +(− 4 ) − (3) + (2 )
−2 3 1 3 1 −2
1 −2 3
= −4 [− 3 + 4] − 3 [6 − 2] + 2 [− 4 + 1]
= −4 − 12 − 6
= −22
5
2 −2 0
2. Evaluate − 3 1 2 using expansion by cofactors.
1 − 3 −1
Solution:
We can choose any row or column to expand along. We will choose the first row because of
the zero: we won’t need to find that cofactor because it will be multiplied by zero.
2 −2 0
1 2 −3 2
−3 1 2 =2 +2 +0
− 3 −1 1 −1
1 − 3 −1
= 2 (− 1 + 6 ) + 2 (3 − 2 )
= 2 (5) + 2 (1)
= 12
Note: This method of evaluating determinants is actually more valuable than our first method,
because it works with any size determinant from 3 × 3 to 4 × 4 to any higher order
determinant. Method 1 only works for 2 × 2 and 3 × 3 matrices.
Since the use of electronic calculators is now commonplace, the application of these
properties has somewhat decreased. Learn how to use your calculator to evaluate a 3 × 3
determinant.
We will now see how determinants can be used to solve systems of equations. We’ll start by
investigating two equations in two variables, and then extend our results to three equations in
three variables. For now, given a system of two equations
𝑎𝑎1 𝑥𝑥 + 𝑏𝑏1 𝑦𝑦 = 𝑐𝑐1
𝑎𝑎2 𝑥𝑥 + 𝑏𝑏2 𝑦𝑦 = 𝑐𝑐2
we can extract three different determinants as follows:
𝑎𝑎1 𝑏𝑏1
𝐷𝐷 = � � = 𝑎𝑎1 𝑏𝑏2 − 𝑏𝑏1 𝑎𝑎2
𝑎𝑎2 𝑏𝑏2
𝑐𝑐1 𝑏𝑏1
𝐷𝐷𝑥𝑥 = � � = 𝑐𝑐1 𝑏𝑏2 − 𝑏𝑏1 𝑐𝑐2
𝑐𝑐2 𝑏𝑏2
6
Determinant formed by replacing coefficients of 𝑦𝑦 by constants (denoted by 𝐷𝐷𝑦𝑦 )
𝑎𝑎1 𝑐𝑐1
𝐷𝐷𝑦𝑦 = �𝑎𝑎 𝑐𝑐2 � = 𝑎𝑎1 𝑐𝑐2 − 𝑐𝑐1 𝑎𝑎2
2
To see how Cramer’s Rule works, let’s see what happens when we attempt to solve the
following general system by elimination method:
𝑎𝑎1 𝑥𝑥 + 𝑏𝑏1 𝑦𝑦 = 𝑐𝑐1 (1A)
𝑎𝑎2 𝑥𝑥 + 𝑏𝑏2 𝑦𝑦 = 𝑐𝑐2 (1B)
We proceed by multiplying equations (1A) and (1B) by suitable constants so that when the
resulting equations are added, left side to left side and right side to right side, one of the
variables drops out. If we choose to eliminate 𝑦𝑦, we will multiply equation (1A) by 𝑏𝑏2 and (1B)
by −𝑏𝑏1; then add:
a1b2 x + b1b2 y = b2 c1
− a 2 b1 x − b1b2 y = −b1c 2
a1b2 x − a 2 b1 x = b2 c1 − b1c 2
x (a1b2 − a 2 b1 ) = b2 c1 − b1c 2
b2 c1 − b1c 2
x= 𝑎𝑎1 𝑏𝑏2 − 𝑎𝑎2 𝑏𝑏1 ≠ 0
a1b2 − a2b1
At this point, the numerator and denominator might remind you of second-order determinants
(written above). In fact, the value of 𝑥𝑥 can be written as:
𝑐𝑐 𝑏𝑏1
𝑐𝑐1 𝑏𝑏2 − 𝑏𝑏1 𝑐𝑐2 � 1 � 𝐷𝐷
𝑐𝑐2 𝑏𝑏2 𝑥𝑥
𝑥𝑥 = = =
𝑎𝑎1 𝑏𝑏2 − 𝑏𝑏1 𝑎𝑎2 𝑎𝑎1 𝑏𝑏1 𝐷𝐷
� �
𝑎𝑎2 𝑏𝑏2
Similarly, starting with system (1A) and (1B) and eliminating 𝑥𝑥 (this is left as an exercise), we
obtain:
𝑎𝑎1 𝑐𝑐1
𝑎𝑎1 𝑐𝑐2 − 𝑐𝑐1 𝑎𝑎2 �𝑎𝑎2 𝑐𝑐2 � 𝐷𝐷𝑦𝑦
𝑦𝑦 = = =
𝑎𝑎1 𝑏𝑏2 − 𝑏𝑏1 𝑎𝑎2 𝑎𝑎 𝑏𝑏1 𝐷𝐷
� 1 �
𝑎𝑎2 𝑏𝑏2
These results are summarized by what is commonly known as Cramer’s rule, which is named
after the Swiss mathematician Gabriel Cramer (1704–1752). The key to Cramer’s Rule is
replacing the variable column of interest with the constant column and calculating the
determinants. If we are solving for 𝑥𝑥, the 𝑥𝑥 column is replaced with the constant column. If we
are solving for 𝑦𝑦, the 𝑦𝑦 column is replaced with the constant column.
7
Example 1.5 Solving a Two-Variable System with Cramer’s Rule
1. Given the system of linear equations below, solve for 𝑥𝑥 and 𝑦𝑦 by using Cramer's rule:
3x − 5 y = 2
− 4 x + 3 y = −1
Solution:
Now replace the x column with the constants and find the determinant.
2 −5
Dx = = 6 −5 =1
−1 3
Now repeat, this time replacing the y column with the constants.
3 2
Dy = = −3 − (−8) = 5
− 4 −1
4 x + 3 y = 12
2. Solve using Cramer’s rule:
2 x + 5 y = −8
Solution:
12 3 4 12
D −8 5 84 Dy 2 − 8 − 56
x= x = = =6 and y= = = = −4
D 4 3 14 D 4 3 14
2 5 2 5
Cramer’s rule can be generalized completely for any size linear system that has the same
number of variables as equations. However, it cannot be used to solve systems where the
number of variables is not equal to the number of equations. Below, we state without proof
Cramer’s rule for three equations in three variables.
8
1.2.2 Cramer’s Rule for Three Equations in Three Variables
d1 b1 c1 a1 d1 c1 a1 b1 d1
d2 b2 c2 a2 d2 c2 a 2 b2 d2
d b3 c3 D x a3 d3 c3 D y a b3 d 3 Dz
x= 3 = , y= = and z= 3 =
a1 b1 c1 D a1 b1 c1 D a1 b1 c1 D
a2 b2 c2 a2 b2 c2 a 2 b2 c2
a3 b3 c3 a3 b3 c3 a3 b3 c3
You can easily remember these determinant formulas for 𝑥𝑥, 𝑦𝑦, and 𝑧𝑧 if you observe the
following:
Determinant 𝐷𝐷 is formed from the coefficients of 𝑥𝑥, 𝑦𝑦, and 𝑧𝑧, keeping the same relative
position in the determinant as found in the system of equations.
Determinant 𝐷𝐷 appears in the denominators for 𝑥𝑥, 𝑦𝑦, and 𝑧𝑧.
Determinants 𝐷𝐷𝑥𝑥 , 𝐷𝐷𝑦𝑦 and 𝐷𝐷𝑧𝑧 are obtained by replacing columns 1, 2 and 3, respectively,
by the right side of the system above. In short, the constants on the right side of the
system are used to replace the coefficients of the variable you are solving for.
1 1 1
−1 1 2 1 2 −1
D = 2 −1 1 = 1 −1 +1
2 −3 1 −3 1 2
1 2 −3
9
6 1 1
−1 1 3 1 3 −1
Dx = 3 − 1 1 = 6 −1 +1
2 −3 −4 −3 −4 2
−4 2 −3
1 6 1
6 1 1 1 1 6
Dy = 2 3 1 = −2 +3 −1
−4 −3 1 −3 1 −4
1 −4 −3
1 1 6
−1 3 1 6 1 6
Dz = 2 − 1 3 = 1 −2 +1
2 −4 2 −4 −1 3
1 2 −4
= 1(− 2 ) − 2 (− 16 ) + 1(9 )
= 39
Dx 13 Dy 26 Dz 39
x= = =1, y= = =2 and z= = =3
D 13 D 13 D 13
Solution:
It is helpful to rewrite the system using zeros for the coefficients of those variables not shown
in each equation:
x + y + 0 z = −1
2x + 0 y − z = 3
0 x + y + 2 z = −1
The four determinants used in Cramer’s rule are:
1 1 0 −1 1 0
D = 2 0 − 1 = −3 D x = 3 0 − 1 = −6
0 1 2 −1 1 2
10
1 −1 0 1 1 −1
Dy = 2 3 − 1 = 9 Dz = 2 0 3 = −3
0 −1 2 0 1 −1
Dx − 6 Dy 9 Dz − 3
x= = =2 y= = = −3 z= = =1
D −3 D −3 D −3
Solution:
1 1 1
Letting p = , q= and r = and re-writing the equations give:
x y z
3 p − 4q − 2r = 1
2 p + 5q − 2r = 3
p + 2q + r = 2
3 −4 −2 1 −4 −2
D= 2 5 − 2 = 45 Dp = 3 5 − 2 = 45
1 2 1 2 2 1
3 1 −2 3 −4 1
Dq = 2 3 − 2 = 15 Dr = 2 5 3 = 15
1 2 1 1 2 2
Thus, x = 1 , y = 3 and z = 3
11
ACTIVITY 1
1. Evaluate:
−1 2
1.1 [10]
−3 −4
−8 − 4
1.2 [− 4]
−7 −3
2 − 10
1.3 [− 2]
3 − 16
1 2 3
2.1 2 −3 4 [− 78]
−3 4 5
1 23
2.2 x 2 x 3x [0]
8 9 10
1 −1 −1
2.3 5 2 0 [52]
0 −2 6
3 2 7
3. Given A = 9 1 0 , determine the cofactor of:
3 −1 2
12
4. Expand the determinants and solve for x in each of the following equations:
3 x 2 −1
4.1 = [x = 8]
1 2 x −5
4 x2 x 4
4.2 = [x = 1] or [x = −4]
1 −1 2 3
3 x 1
4.3 x 0 −2 =
2 x
[x = −1]
x 4
4 0 1
x −1 2
4.4 −2 x 3 =
2 2
[x = 3] or [x = −4]
5 x
4 − 3 −1
3 x + 2 y = −4 8 46
5.1 x = , y = −
− 4 x + 3 y = −10 17 17
1 = x + 2y 1 2
5.2
2x = y x = 5 , y = 5
1
3x + y =1
2 1
5.3
1 5 x = 2 , y = −1
4x + y =
3 3
2 3
− =2
x y 1 3
5.4
5 6 x = 3 , y = 4
− =7
x y
13
6. Solve the simultaneous equations given, using determinants:
2x + y = 2
1
6.1 z − 4y = 0 x = 2 , y = 1 , z = 4
4x + z = 6
2 x − 3 y = 4 − 5z
1 2 4
6.2 2 z + 3x = 3 − 2 y x = − 3 , y = 3 , z = 3
y + 4x = 4z − 6
1 2 2
+ + =4
x y z
3 1 4 1 1 1
6.3 − + = 25 x = 2 , y = − 3 , z =
x y z 4
3 2 1
+ − = −4
x y z
2x − 3y = 4 − z 1
6.4
4 x + y = −3 = 3 y + z − 2 x = − 2 , y = −1 , z = 2
2x 2z
−y+ =2
3 3
6.5 x + 8 y + 3 z = −31 [x = −5 , y = −4 , z = 2]
6x 4 y 2z
− + = −2
5 5 5
2x + 3 y + 4z = 7
7.1 [𝑦𝑦 = −3]
3x − 2 y = 0 = 5 y + 3z
x + 2 (y + z) = 7
7.2 [𝑦𝑦 = 2]
3 x − y = 3 x + 2 ( y − 3) = z
2𝑥𝑥 − 𝑦𝑦 − 1 = 0
3
7.3 𝑥𝑥 + 4𝑦𝑦 + 3 = 𝑧𝑧 �𝑦𝑦 = 5�
3𝑥𝑥 + 𝑦𝑦 − 3 = 0
14