Chapter 2.
Square matrices
Lecture notes for MA1111
P. Karageorgis
pete@maths.tcd.ie
1 / 18
Invertible matrices
Definition 2.1 – Invertible matrices
An n × n matrix A is said to be invertible, if there is a matrix B such
that AB = In and BA = In . If such a matrix exists, then it is unique.
The matrix B is called the inverse of A. It is denoted by B = A−1 .
A square matrix is not invertible, if it has a row/column of zeros.
Theorem 2.2 – Inverse of a product
Suppose A1 , A2 , . . . , Ak are invertible matrices of the same size. Then
their product A1 A2 · · · Ak is also invertible and its inverse is
(A1 A2 · · · Ak )−1 = A−1
k · · · A2 A1 .
−1 −1
2 / 18
Elementary matrices
Definition 2.3 – Elementary matrix
An elementary matrix is a matrix obtained from the identity matrix In
using a single elementary row operation.
Theorem 2.4 – Elementary matrices are invertible
Every elementary matrix is invertible and its inverse is elementary.
Theorem 2.5 – Elementary row operations
Every elementary row operation corresponds to left multiplication by
an elementary matrix. This matrix can be found explicitly by applying
the same elementary row operation to the identity matrix.
3 / 18
Finding the inverse of a matrix
Theorem 2.6 – Reduced row echelon form of square matrices
The reduced row echelon form of an n × n matrix is either the identity
matrix In or else a matrix whose last row is zero. Moreover, an n × n
matrix is invertible if and only if its reduced row echelon form is In .
To find the inverse of an n × n matrix A, one may use row reduction
of the augmented matrix [A In ]. There are two possible scenarios.
If row reduction leads to a matrix of the form [In B], then the given
matrix A is invertible with inverse B. Otherwise, A is not invertible.
Theorem 2.7 – One-sided inverse
Knowing that AB = In , one knows that BA = In and vice versa.
4 / 18
Finding the inverse: Example
We compute the inverse of the matrix
1 2 2
A = 1 1 2 .
1 2 1
Merge the given matrix with the identity matrix I3 and then use row
reduction on the resulting matrix to get
1 2 2 1 0 0 1 0 0 −3 2 2
1 1 2 0 1 0 −→ 0 1 0 1 −1 0 .
1 2 1 0 0 1 0 0 1 1 0 −1
The inverse of A is the rightmost submatrix, namely
−3 2 2
A−1 = 1 −1 0 .
1 0 −1
5 / 18
Invertibility conditions
Theorem 2.8 – Invertibility conditions
The following statements are equivalent for each n × n matrix A.
1 The system Ax = y has a unique solution for every y ∈ Rn .
2 The system Ax = y has a unique solution for some y ∈ Rn .
3 The reduced row echelon form of A is the identity matrix In .
4 The matrix A is the product of elementary matrices.
5 The matrix A is invertible.
The inverse of a 2 × 2 matrix A is given by the formula
a b 1 d −b
A= =⇒ A−1 = ,
c d ad − bc −c a
provided that ad − bc 6= 0. The matrix A is not invertible, otherwise.
6 / 18
Definition of the determinant
We are hoping to define the determinant of a square matrix in such a
way that the following four properties hold.
(A1) Breaking up a row into two pieces gives
.. .. ..
. . .
det
R + S = det R + det S .
.. .. ..
. . .
(A2) Pulling out a common factor from a row gives
.. ..
. .
cR = c det R .
det
.. ..
. .
(A3) One has det A = 0 when A has two equal rows.
(A4) One has det In = 1 when In is the identity matrix.
7 / 18
Computation of determinants: first method
Theorem 2.9 – Determinants using row reduction
If there is a definition of the determinant so that (A1)-(A4) hold, then
it is unique and one may compute determinants using row reduction.
The determinant remains the same, if we add a multiple of one row to
another, and it changes by a minus sign, if we interchange two rows.
As a typical example, one can use row reduction to compute
3 6 1 2 1 2
det = 3 det = 3 det
2 9 2 9 0 5
1 2 1 0
= 15 det = 15 det = 15.
0 1 0 1
More generally, the determinant of a 2 × 2 matrix is given by
a b
det = ad − bc.
c d
8 / 18
Computation of determinants: second method
Definition 2.10 – Expansion by minors
The minor Mij of a matrix A is obtained by deleting both the ith row
and the jth column of A. To define the determinant of a square matrix
using induction, one defines det[a] = a for 1 × 1 matrices and then
n
X
det A = (−1)i+1 ai1 det Mi1
i=1
for all larger matrices. This defines det A for any square matrix A.
For instance, one can use expansion by minors to compute
2 4 3
5 1 4 3
det 3 5 1 = 2 det − 3 det
2 3 2 3
0 2 3
= 2(15 − 2) − 3(12 − 6) = 26 − 18 = 8.
9 / 18
Lower and upper triangular matrices
Theorem 2.11 – Lower and upper triangular matrices
The determinant of a lower or upper triangular matrix is equal to the
product of its diagonal entries.
A square matrix is called lower/upper triangular, if the entries that lie
above/below its main diagonal are zero.
One can prove this theorem using either expansion by minors or row
reduction. For instance, expansion by minors gives
a11 0 0
a22 0
det a21 a22 0 = a11 det
= a11 a22 a33 .
a32 a33
a31 a32 a33
Thus, the theorem holds in the case of 3 × 3 lower triangular matrices.
To prove the general case, one uses a similar argument and induction.
10 / 18
Further properties of determinants
Definition 2.12 – Transpose of a matrix
The transpose of an m × n matrix A is the n × m matrix At obtained
by turning rows into columns. One can easily check that
(A + B)t = At + B t , (At )t = A, (AB)t = B t At .
Theorem 2.13 – Further properties of determinants
1 One has det(AB) = (det A)(det B) for all n × n matrices A, B.
2 To say that A is invertible is to say that det A 6= 0.
3 If A is invertible, then det A−1 = 1/(det A).
4 If At is the transpose of A, then det At = det A.
11 / 18
Cofactor matrix and adjoint
Definition 2.14 – Cofactor matrix and adjoint
Let A be a square matrix and let Mij be its minors. The cofactor Cij
is defined as the signed determinant of the minor Mij , namely
Cij = (−1)i+j · det Mij .
The adjoint of A is defined as the transpose of the cofactor matrix C.
When it comes to 2 × 2 matrices, for instance, one has
a b d −c d −b
A= =⇒ C = =⇒ adj A = .
c d −b a −c a
The identity A · adj A = (det A)In holds for every square matrix A.
In particular, the inverse of an invertible matrix A is given by
1
A−1 = · adj A.
det A
12 / 18
Adjoint matrix: Example, page 1
We compute both the adjoint and the inverse of the matrix
1 x y
A = 1 z .
1
First, we compute the cofactor entries Cij . There are 9 entries to be
found. The cofactor entry C11 is given by
1 x y
C11 = + det 0 1 z = 1,
0 0 1
while the cofactor entry C12 is given by
1 x y
C12 = − det 0 1 z = 0.
0 0 1
The remaining cofactor entries may be computed similarly.
13 / 18
Adjoint matrix: Example, page 2
Proceeding as above, one finds that the cofactor entries are
C11 = C22 = C33 = 1, C21 = −x,
C12 = C13 = C23 = 0, C32 = −z, C31 = xz − y.
Once we now merge those into a matrix, we get
1 0 0 1 −x xz − y
C = −x 1 0 =⇒ adj A = C t = 0 1 −z .
xz − y −z 1 0 0 1
Since A is upper triangular, its determinant is equal to the product of
its diagonal entries. This gives det A = 1, so
1 −x xz − y
1
A−1 = · adj A = 0 1 −z .
det A
0 0 1
14 / 18
Computation of determinants: third method
Theorem 2.15 – Complete expansion of the determinant
The determinant of an n × n matrix A can be expressed in the form
X 1 2 ··· n
det A = sign a a · · · anin
i1 i2 · · · in 1i1 2i2
with the sum taken over all permutations i1 , i2 , . . . , in of 1, 2, . . . , n.
A permutation is called odd/even, if one needs an odd/even number
of index swaps in order to get from (i1 , i2 , . . . , in ) to (1, 2, . . . , n).
Even permutations have sign +1. Odd permutations have sign −1.
The complete expansion of the determinant contains n! terms, so it is
not particularly useful for large n. We shall mainly use it to compute
determinants when n = 2, 3 and use row reduction when n ≥ 4.
15 / 18
Determinant of 3 × 3 matrices
The determinant of a 3 × 3 matrix A is given by the formula
det A = a11 a22 a33 + a12 a23 a31 + a13 a21 a32
− a31 a22 a13 − a32 a23 a11 − a33 a21 a12 .
To find the six terms on the right hand side, one repeats the first two
columns of the matrix and then forms six diagonal products as in the
figure below. Note that three of the products are associated with a
plus sign, while the other three have a minus sign, instead.
+ + +
a11 a12 a13 a11 a12
a21 a22 a23 a21 a22
a31 a32 a33 a31 a32
− − −
16 / 18
Permutation matrices
A permutation matrix is a square matrix that has a single 1 in each
row and each column, all other entries being zero. Left multiplication
by such a matrix results in a permutation of the rows.
As a typical example, let us consider the equation
0 0 1 0 x1 y 1 x3 y 3
0 0 0 1 x2 y2 x4 y4
0 1 0 0 x3 y3 = x2 y2 .
1 0 0 0 x4 y 4 x1 y 1
We note that row 1 is mapped to row 3, row 2 is mapped to row 4,
and so on. The corresponding permutation of the rows is thus
1 2 3 4
.
3 4 2 1
In general, left multiplication by a permutation matrix P maps row i
to row j whenever the (i, j)th entry of P is equal to 1.
17 / 18
Cycles and transpositions
Definition 2.16 – Cycles and transpositions
A permutation that cyclically permutes k indices is called a k-cycle. A
permutation that interchanges two indices is called a transposition.
A typical example of a 3-cycle is the permutation 1 → 3 → 4 → 1. It
is very common to denote such a cycle by (134).
Every permutation can be expressed in terms of cycles. For instance,
1 2 3 4 5 6 7
= (1572)(364).
5 1 6 3 7 4 2
Since a k-cycle may be obtained using k − 1 transpositions, its sign is
given by (−1)k−1 . As for the permutation above, its sign is given by
sign (1572)(364) = (−1)3 (−1)2 = −1.
18 / 18