# Matrices ```Matrices
define matrix
We will use matrices to help us solve systems of equations. A matrix is a
rectangular array of numbers enclosed in parentheses or brackets. In linear algebra,
matrices are important because every matrix represents uniquely a linear transformation.
#1 0 0&amp;
# 2 3&amp;
%
(
Examples of matrices are: %
( and %0 1 0( . The particular numbers constituting a
\$&quot;5 4 '
%
(
\$0 0 1'
matrix are called its entries or elements. To distinguish between elements, we identify
# 2 3&amp;
their position in the matrix by row and column. E.g., in the matrix %
( the element
&quot;5
4
\$
'
!
in the first row and second column is 3 and is designated by a12 . The size or dimension
of a matrix is specified by the number of rows and the number of columns, in that order.
#1 &quot; 2 0 &amp;
!
E.g., the matrix %
( is a 2 X 3 matrix.
\$1 3 &quot;1'
!
used to describe systems of linear equations
Matrices are a natural choice to describe systems of linear equations. Consider
2x &quot; 3y + 4z = 14
!
the following system of linear equations in standard form: 3x &quot; 2y + 2z = 12 .
4 x + 5y &quot; 5z = 16
#2 &quot; 3 4 &amp;
%
(
The coefficient matrix of this system is the matrix: % 3 &quot; 2 2 ( . This matrix consists of
%
(
! \$ 4 5 &quot; 5'
the coefficients of the variables as they appear in the original system. The augmented
#2 &quot; 3 4 : 14 &amp;
%
(
matrix of this system is % 3 &quot; 2 2 : 12 ( .!The augmented matrix includes the constant
%
(
\$ 4 5 &quot; 5 : 16 '
terms. The colons separate the coefficients from the constants.
solving systems of linear equations with matrices
Matrices may be used to solve systems of linear equations. The operations that
we perform to!solve a system of linear equations correspond to similar elementary row
2x &quot; 3y + 4z = 14
operations for a matrix. We'll solve the system 3x &quot; 2y + 2z = 12 using Gaussian
4 x + 5y &quot; 5z = 16
elimination (Gaussian elimination is a modified version of the elimination or linear
combination method used to solve systems of linear equations) and similar row
operations in matrices, side-by-side. First, we represent the system of linear equations
!
with an augmented matrix.
#2 &quot; 3 4 : 14 &amp;
2x &quot; 3y + 4z = 14
%
(
3x &quot; 2y + 2z = 12
% 3 &quot; 2 2 : 12 (
%
(
4 x + 5y &quot; 5z = 16
\$ 4 5 &quot; 5 : 16 '
!
!
Our goal is to add linear combinations of the first row with the second and third
rows to &quot;eliminate&quot; the x terms, i.e., to make their x coefficients zero. Before we do this,
we want the coefficient of x in the first equation to be equal to 1. So, we need to multiply
1
the first row by 1/2. We will use the shorthand notation R1 to indicate this.
2
#
&amp;
3
3
1&quot;
2: 7 (
x &quot; y + 2z = 7
%
2
2
%
(
3x &quot; 2y + 2z = 12
% 3! &quot; 2 2 : 12 (
% 4 5 &quot; 5 : 16(
4 x + 5y &quot; 5z = 16
%
(
\$
'
Next, we multiply the first row by –3 and add it to the second row, and we
multiply the first row by –4 and add it to the third row, &quot;3R1 + R2 and &quot;4R1 + R3 .
!
#
&amp;
3
3
x &quot; y + 2z = 7
1&quot;
2: 7 (
!
%
2
2
%
(
5
5
%
!
!
y &quot; 4z = &quot;9
0
&quot;4 : &quot;9 (
% 2
(
2
%
11y &quot;13z = &quot;12
0 11 &quot;13 : &quot;12(
%
(
\$
'
Now we want to add a linear combination of the second row to the third row to
eliminate the y term. But first we want the coefficient of the y term to be equal to 1, so
!
2
we multiply the second row by 2/5,! R2 .
5
#
&amp;
3
3
x &quot; y + 2z = 7
1&quot;
2: 7 (
%
2
2
%
(
8
18!
8
18 (
%
y&quot; z=&quot;
0 1 &quot; : &quot;
%
5
5
5
5(
%
11y &quot;13z = &quot;12
0 11 &quot;13 : &quot;12(
%
(
\$
'
Next, we multiply the second row by –11 and add it to the third row, &quot;11R2 + R3 .
#
&amp;
3
3
!
x &quot; y + 2z = 7
1&quot;
2:
7(
%
2
2
!
%
(
8
18
8
18 ( !
%
y&quot; z=&quot;
0 1 &quot; : &quot;
%
5
5
5
5(
%
23
138
23 138 (
z=
:
%0 0
(
\$
5
5
5
5 '
We can solve for z (z = 6) and back substitute to solve for y (y = 6) and x (x = 4).
The final matrix form is called row echelon form and corresponds to the upper triangular
form on the left.
!
Gauss-Jordan elimination !
Gauss-Jordan elimination is a continuation of Gaussian elimination. Our goal is
to add a linear combination of the third row with the first two rows to eliminate the z
5
terms. We want the coefficient of z to be equal to 1 in the third row, so multiply
R3.
23
#
&amp;
3
3
x &quot; y + 2z = 7
1&quot;
2:
7(
%
2
2
%
(
8
18
8
18 (
%
!
y&quot; z=&quot;
0 1 &quot; : &quot;
%
5
5
5
5(
%0 0
z=6
1:
6(
%
(
\$
'
Now we want to add a linear combination of the third row and the first two rows
! to eliminate the z terms. So we add, &quot;2R3 + R1 and 8 R3 + R2 :
5
!
#
&amp;
3
3
1&quot;
0 : &quot; 5(
x&quot; y
= &quot;5
%
2
2
%
(
0:
6(
y
= 6 !
! %0 1
%0 0
1:
6(
z= 6
%
(
\$
'
Lastly, we add a combination of the second row and the first row to eliminate the
3
! y term, namely R2 + R1:
2
!
&quot;1 0
x
= 4
0:
4%
\$
'
y
= 6
0:
6'
\$0 1
\$
'
z= 6
1:
6&amp;
!
#0 0
This last matrix is called reduced row echelon form.
matrix algebra
Matrix algebra was developed to be consistent with the operations performed on
!
!
systems of equations.
Two matrices are equal provided they have the same size and corresponding
# 1 1&amp;
#1 &quot; 2 0 &amp; %
(
entries are equal. E.g., %
( ) % &quot;2 3 ( .
\$1 3 &quot;1' %
(
\$ 0 &quot;1'
To add (or subtract) two matrices, they must be of the same size and then you add
# 2 3&amp;
#1 &quot;1&amp;
(or subtract) corresponding entries. Let A = %
( and B = %
( , then
\$&quot;5 4 '
\$ 3 0'
!
# 1 4&amp;
&quot;0 0%
A&quot;B =%
( . A zero matrix, e.g., \$
' , denoted by 0, is any matrix with all its
\$&quot;4 4 '
#0 0&amp;
entries equal to zero. Zero matrices
are additive!identities, i.e., A + 0 = 0 + A = A and
!
A &quot; A = 0.
!
!
!
!
!
!
To multiply a matrix by a scalar, multiply each entry by that scalar. E.g., if
# 2 3&amp;
#1 &quot;1&amp;
# 5 5&amp;
A =%
( and B = %
( , then 2A + B = %
( .
\$&quot;5 4 '
\$ 3 0'
\$ &quot;7 8 '
The product of two matrices A and B, if it exists, is the matrix AB satisfying:
1. The number of columns in A is the same as the number of rows in B
2. If A has a columns and B has b columns, then the size of AB is a X b
! 3. The entry in
! the ith row and the jth column of AB is the inner product of
the ith row of A with the jth column of B. The inner product is defined to
be the number obtained by multiplying the corresponding entries and then
# 2 3 &amp;#1 &quot;1 &amp; # 2 )1+ 3) 3 2 ) &quot;1+ 3) 0 &amp; #11 &quot; 2&amp;
E.g., the product AB = %
(%
(=%
(=%
( . The
\$ &quot;1 4 '\$ 3 0' \$ &quot;1)1+ 4 ) 3 &quot;1) &quot;1+ 4 ) 0 ' \$11 1'
#1 &quot;1 &amp;# 2 3 &amp; # 3 &quot;1&amp;
product BA = %
(%
(=%
( . Notice that in general AB &quot; BA .
\$ 3 0'\$&quot;1 4 ' \$ 6 9 '
!Often is not possible to multiply two matrices together because of their sizes.
# 2 3&amp;
&quot;1 2 0%
E.g., let A = %
AB is exists, but BA does not!
!
( and B = \$
' . Then the product
&quot;5
4
3
0
1
\$
'
#
&amp;
!
&quot;1 0%
Matrices of the form \$ ' where the main diagonal entries are all 1 and all other
#0 1&amp;
# 2 3&amp;#1 0&amp; # 2 3&amp;
!
!
entries are 0 are multiplicative identities, i.e., %
(% ( = %
(.
\$&quot;5 4 '\$ 0 1' \$ &quot;5 4 '
#2 &quot; 3 4 &amp;# x &amp; #2x &quot; 3y + 4z&amp;
!
%
(% ( %
(
What is the product % 3 &quot; 2 2 (% y ( ? % 3x &quot; 2y + 2z (
%
(% ( %
(
\$ 4 5!&quot; 5'\$ z ' \$ 4 x + 5y &quot; 5z'
Inverse matrices
inverse matrix
We define a multiplicative identity for square matrices as a matrix of the form
&quot;1 0%
&quot; a b!%&quot;1 0% &quot;1 0%&quot; a !b % &quot; a b %
I2 = \$ ' , i.e., \$
'\$ ' = \$ '\$
'=\$
'.
#0 1&amp;
#c d &amp;# 0 1&amp; # 0 1&amp;#c d &amp; #c d &amp;
In the real numbers, multiplicative inverses are two real numbers a and b such
that ab = 1. The same terminology applies to matrices, i.e., if A and B are n X n matrices
such that AB = In and BA = In , then A and B are said to be inverses of each other. An
!
inverse matrix of A is denoted by A&quot;1 .
# &quot;2 1 &amp;
&quot;1 2%
&quot;1 %
(
! Show that the
! inverse of A = \$ 3 4 ' is A = % 3 &quot; 1 ( .
#
&amp;
\$ 2 2'
!
!
!
We must show that AA
!
!
#
&amp;
#1 2&amp;% &quot;2 1 ( #1
=%
( 3 1( = %
&quot;
\$ 3 4 '%
\$0
\$ 2 2'
0&amp;
( . And, we must show that
1'
# &quot;2 1 &amp;
#1 2&amp; #1 0&amp;
A A = % 3 1 (%
( = % (.
%
&quot; (\$ 3 4 ' \$ 0 1'
\$ 2 2 '!
finding inverse matrices
Not all matrices have inverses. First, a matrix must be square in order to have an
inverse. But even many square matrices do not have inverses. We will study two ways
of finding inverse matrices of square matrices, if they exist.
Our first method solves a system of equations to find the inverse matrix of
&quot;1 2%
&quot;1 # a b &amp;
A =\$
' . We need to find numbers a, b, c, and d in an inverse matrix A = %
(
# 3 4&amp;
\$c d'
such that the following two matrix equations are true:
&quot;1 2%&quot; a b % &quot;1 0%
&quot; a b %&quot;1 2% &quot;1 0%
\$
'\$
' = \$ ' and \$
'\$
'=\$ '
# 3 4 &amp;# c d &amp; # 0 1&amp;
#c d &amp;# 3 4 &amp; # 0 1&amp;
!
&quot; a + 2c b + 2d % &quot;1 0%
The first matrix equation is equivalent to: \$
' = \$ ' . If these
# 3a + 4c 3b + 4d &amp; #0 1&amp;
! matrices are equal, then
! their entries are equal.
a + 2c = 1 b + 2d = 0
3a + 4c = 0 3b + 4d = 1
!
This is equivalent to two 2 x 2 systems of linear equations. Solving for a, we
have a = -2. Solving for c, we have c = 3/2. Solving for b and d, we have b = 1 and
# &quot;2
1&amp;
! d = -1/2. Therefore, A&quot;1 = %
(.
\$ 3 2 &quot;1 2'
If we had solved the second matrix equation, we would have the following
systems of linear equations:
a + 3b = 1 2a + 4b = 0
!
c + 3d = 0 2c + 4d = 1
You can verify that the solutions to this system of equations are the same.
Our first method of finding inverse matrices solved systems of equations. Since
we know that not all systems of equations have solutions, we may guess that not all
!
&quot;1 2%
matrices have inverses. And we'd be right! E.g., the matrix A = \$
' does not have an
#2 4 &amp;
inverse matrix, because the first resulting system of equations ( a + 2b = 1 and
2a + 4b = 0 ) does not have a solution. SHOW. We call matrices that have inverses
singular and matrices that do not have inverses non-singular. Singular matrices must be
! and columns.
square, i.e., they must have the same number of rows
!
Our second method of finding inverse matrices uses elementary row operations
(Gauss-Jordan method) on a specially-augmented matrix. We augment our initial matrix
&quot;1
!
&quot;1
&quot;1 2%
&quot;1 2 :1 0%
A =\$
' by writing I2 next to A: A = \$
' . Our goal now is to change the matrix
# 3 4&amp;
# 3 4 : 0 1&amp;
A on the left into I2 and the resulting matrix on the right will be A&quot;1 .
1
!
!
!
!
&quot;1 2!:1 0% (3R +R &quot;1 2 : 1 0% ( R2 &quot;1 2 : 1
0 % (2R2 +R1
1 )
2
2 )*
\$
' )))
' ))
\$
' ) ) ) )*
! *\$
# 3 4 : 0 1&amp;
# 0 ( 2 : (3 1 &amp;
#0 1: 3 2 (1 2&amp;
!
!
#1 0 : &quot; 2
1&amp;
1&amp;
&quot;1 # &quot;2
%
( . Therefore, A = %
(.
\$0 1: 3 2 &quot;1 2'
\$ 3 2 &quot;1 2'
using inverse matrices to solve systems of linear equations
!
x + 2y = 8
Let's now solve the following system of equations using A&quot;1 :
.
3x + 4 y = 6
!
!
&quot;1 2%
&quot; x%
&quot;8%
If A = \$
' , X = \$ ' , and B = \$ ' , then we can represent our system of equations
# 3 4&amp;
# y&amp;
#6&amp;
!
by the matrix equation AX = B . If we multiply both sides of!the equation by A&quot;1 , i.e.,
&quot;1
&quot;1
A &quot;1 AX = A &quot;1B , we have (A A)X = I 2 X = X = A B . Therefore, the matrix A&quot;1B should
!give us our!solutions for!x and y.
1 &amp;# 8&amp; # &quot;16 + 6&amp; #&quot;10&amp;
! # &quot;2
!
A&quot;1B = %
(% ( = %
(=%
( . Therefore, x = -10 and y = 9. Let's
\$!3 2 &quot;1 2'\$ 6' \$ 12 &quot; 3' \$ 9 '
!
check our answer in the original system of equations.
&quot;10 + 2(9) = 8
3(&quot;10) + 4(9) = 6
!
&quot; a b%
1 # d &quot; b&amp;
&quot;1
In general, we can show for any A = \$
' that A =
%
( . Find
ad &quot; bc \$ &quot;c a '
#c d &amp;
#&quot;1 2 &amp;
#&quot;9 &quot; 2&amp;# &quot;1 2 &amp; #1 0&amp;
1 #&quot;9 &quot; 2&amp; #&quot;9 &quot; 2&amp;
! A&quot;1
&quot;1
if A = %
(. A =
%
(=%
( . Verify %
(%
( = % (.
9 &quot; 8 \$&quot;4 &quot;1 ' \$&quot;4 &quot;1 '
\$ 4 &quot; 9'
\$&quot;4 &quot;1 '\$ 4 &quot; 9' \$0 1'
2x &quot; !
3y + 4z = 14 !
Solve the system 3x &quot; 2y + 2z = 12 using inverse matrices.
4 x + 5y &quot; 5z = 16
!
!
!
First, we write the systems of equations as the matrix equation AX = B , where
#2 &quot; 3 4 &amp;
&quot; x%
&quot;14 %
%
(
\$ '
\$ '
A = % 3 &quot; 2 2 (!, X = \$ y ' , and B = \$12 ' . To find X, we must find A&quot;1B , where A&quot;1 is the
%
(
\$ '
\$ '
!
\$ 4 5 &quot; 5'
#z &amp;
#16 &amp;
inverse matrix of A. We can find A&quot;1 manually as we did earlier, or we can use
#0 ! 5 /23 2 /23
!&amp;
(
&quot;1 %
technology
calculator) to find A = %1 &quot; 26 /23 8 /23( . We can
! (e.g., a graphing
!
%
(
!
\$1 &quot; 22 /23 5 /23'
#0
5 /23 2 /23&amp;#14 &amp; # 4 &amp;
%
(% ( % (
&quot;1
multiply A B = %1 &quot; 26 /23 8 /23(%12 ( = % 6 ( . Therefore, x = 4, y = 6, and z = 6.
%
(% ( % (
\$1 &quot; 22 /23 5 /23'\$16!' \$ 6 '
!
!
!
!
!
Determinants and Cramer's Rule
define determinant of a square matrix
As we have seen, inverses of some square matrices may be used to solve systems
of linear equations. Can we determine a priori which square matrices have inverses? We
can define a number, called the determinant, for any square matrix. We can think of the
determinant as a function of a square matrix returning a unique number as the output. If
the determinant is equal to 0, then the square matrix does not have an inverse, i.e., it is
singular. If the determinant is equal to any number but 0, then the square matrix does
have an inverse and it is non-singular. We denote the determinant of a square matrix A
using the notations det A or A .
determinant formula for 2 x 2 matrices
&quot; a b%
The formula for the determinant of a 2 x 2 matrix \$
' is defined as
#c d &amp;
!
a b
= ad &quot; bc . We see that the formula subtracts the product of the minor diagonal from
c d
the product of the major diagonal.
!
&quot;1 5 &quot;1 5
Compute
.
= (&quot;1# 3) &quot; (&quot;2 # 5) = &quot;3 &quot; (&quot;10) = 7 .
&quot;2 3 &quot;2 3
determinant formula for 3 x 3 matrices and larger
Computing determinants for larger square matrices becomes more cumbersome.
&quot; a1 a2 a3 %
!
!
\$
'
For example, the determinant of a 3 x 3 matrix \$ a4 a5 a6 ' is defined as
\$
'
# a7 a8 a9 &amp;
a1 a2 a3
a5 a6
a4 a6
a4 a5
. This sum of products of entries and
a4 a5 a6 = a1
&quot; a2
+ a3
a8 a9
a7 a9
a7 a8
a7 a8 a9
!
determinants of smaller (2 x 2) matrices is called the minor and co-factor expansion of
the determinant along the first row. The minor of an entry is formed by eliminating all
entries in the same row and column. Each minor is then multiplied by its co-factor which
may be found by alternating signs among the entries.
1 2 &quot;1 1 2 &quot;1
&quot;1 1
2 1
2 &quot;1
Compute 2 &quot;1 1 . 2 &quot;1 1 = 1
=
&quot;2
+ (&quot;1)
0 2
4 2
4 0
4 0 2 4 0 2
1(&quot;2 &quot; 0) &quot; 2( 4 &quot; 4 ) &quot;1(0 &quot; (&quot;4 )) = 1(&quot;2) &quot; 2(0) &quot;1( 4 ) = &quot;2 &quot; 0 &quot; 4 = &quot;6 .
We can choose any column or row to expand. Sometimes it is helpful to choose a
1 2 &quot;1
!
!
2 &quot;1 1 2
row or column with a zero, e.g., row 3. 2 &quot;1 1 = 4
=
+2
&quot;1 1
2 &quot;1
4 0 2
4 (2 &quot;1) + 2(&quot;1&quot; 4 ) = 4 (1) + 2(&quot;5) = 4 &quot;10 = &quot;6 .
rules for manipulating determinants
!
!
There are three rules for manipulating determinants that make computations
easier. These rules are listed on p. 642.
5 10 15
Compute 1 2 3 . We can factor a 5 out of the first row (Rule 1) to obtain
&quot;9 11 7
5 10 15
1 2 3
1 2 3 = 5 1 2 3 . We can subtract the second row from the first (Rule 2) to
&quot;9 11 !7
&quot;9 11 7
1 2 3
1 2 3
obtain 5 1 2 3 = 5 0 0 0 . What would happen if we expanded on the second
!
&quot;9 11 7
! &quot;9 11 7
row? The determinant would be equal to 0.
Cramer's rule for solving a system of linear equations
Cramer's rule allows us to solve some systems of linear equations using
! determinants.
! See Cramer's Rule on p. 645 and its proof on p. 646.
3x + 4 y &quot; z = 5
Use Cramer's Rule to solve the system of equations x &quot; 3y + 2z = 2 . First, we
5x
&quot; 6z = &quot;7
3 4 &quot;1
5 4 &quot;1
3 5 &quot;1
3 4 5
write D = 1 &quot; 3 2 , Dx = 2 &quot; 3 2 , Dy = 1 2 2 , Dz = 1 &quot; 3 2 . Then, we
5 0 &quot;6
&quot;7 0 &quot; 6
5 &quot; 7!&quot; 6
5 0 &quot;7
compute the values of each determinant: D = 103, Dx = 103, Dy = 103, Dz = 206 . Lastly,
D 103
103
206
we solve for x, y, and z: x = x =
= 1, y =
= 1, and z =
= 2 . Therefore, the
D 103
103
103
!
solution is (1,1,2) . Verify that (1,1,2) is a solution.
!
!
!
!
!
!
```