
1. Introduction
 This unit introduces the theory and application of mathematical structures known as matrices. With the advent of computers matrices have become widely used in the mathematical modelling of practical realworld problems in computing, engineering and business where, for example, there is a need to analyse large data sets. Applications of matrices occur:
 in all areas of science to solve (large) systems of equations.
 in computer graphics to project three dimensional images onto two dimensional screens and apply transformations to rotate and move these screen objects.
 in cryptography to encode messages, computer files, PIN numbers, etc.
 in business to formulate and solve linear programming problems to optimise resources subject to a set of constraints.

2. Definitions
Before we undertake calculations involving matrices it is firstly necessary to present some definitions and terminology.
2.1. What is a matrix?
A matrix is an ordered rectangular array of numbers and/or variables arranged in rows and columns and enclosed in brackets. For our purposes these elements will take the form of real numbers. In general, matrices are denoted by upper case letters.
Example 1
The following are all matrices:
(i). $A = \pmatrix {0 & \;\,\,4 \\ 1 & 1}$
(ii). $B = \pmatrix {\;50 & 25 & \;45 \\ 125 & 80 & \;60 \\ \;60 & 0 & \;75 \\ \;90 & 80 & 110}$.
(iii). $K = \pmatrix{\;\;\,1.2 & 3.8 & 0.2 & 0.2 & 3.1 \\ 2.3 & 2.1 & 3.6 & \;\;\,3.8 & 0.1}$
(iv). $M = \pmatrix{3 \\ 1}$.
End of Example 12.2. Rows and columns of a matrix
A useful interpretation of the structure of a matrix is to consider the rows and columns of the matrix. These are simple and obvious concepts; but we need to know that the rows are numbered starting from the top (i.e. Row 1) and the columns are numbered starting from the left hand side of the matrix (i.e. Column 1). For example, we have
2.3. Order of a matrix
The size, also called the order or dimension, of a matrix is identified by a number pair in the form $m \times n$, where $m$ is the number of rows in the matrix and $n$ the number of columns.
$A = \pmatrix{a_{11} & a_{12} & \cdots & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & \cdots & a_{2n} \\ \vdots & & \ddots & & \vdots \\ \vdots & & & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & \cdots & a_{mn}} $
We say that the matrix $A$ is a “$m$ by $n$ matrix”.
A matrix with the same number of rows as columns, i.e. $m = n$, is called a square matrix.
Example 2
The matrices in Example 1 have the following sizes,
(i). $A$ is a $2 \times 2$ matrix, i.e. 2 rows and 2 columns.
(ii). $B$ is a $4 \times 3$ matrix, i.e. 4 rows and 3 columns.
(iii). $K$ is a $2 \times 5$ matrix, i.e. 2 rows and 5 columns.
(iv). $M$ is a $2 \times 1$ matrix, i.e. 2 rows and 1 column.
End of Example 22.4. Element of a matrix
Each element, or entry, in a matrix is denoted by a lower case letter with appropriate subscripts indicating its row and column position. Hence, element $a_{ij}$ is located in the $i$th row and $j$th column of the matrix $A$ as shown below.
$A = \pmatrix{a_{11} & a_{12} & \cdots & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & \cdots & a_{2n} \\ \vdots & & \ddots & & \vdots \\ \vdots & & & \ddots & \vdots \\ a_{m1} & a_{m2} & \cdots & \cdots & a_{mn}} $
Example 3
For the matrix $A = \pmatrix{\;\,50 & \;\;\,25 & 45 \\ \,125 & \;\;\,80 & \;\;\,60 \\ \;\;60 & 50 & \;\;\,75 \\ \;\,90 & \,120 & \,110 }$
(i). element $a_{43} = 110$, as it is located at Row 4, Column 3.
(ii). element $a_{32} = 50$ , as it is located at Row 3, Column 2.
We can easily draw parallels between matrices and computer arrays as used in programming languages. For example, in C++ if $A$ is an array we would use the syntax $A[2][3]$ to index the element in the second row and third column of $A$, in Maple we would use the notation $A[2, 3]$ and in MATLAB we would write $A(2, 3)$.
End of Example 32.5. Equality of matrices
 Two matrices $A$ and $B$ are equal if and only if:
 they are of the same size, i.e. both are $m \times n$ matrices
 their corresponding elements are the same, i.e. $a_{ij} = b_{ij}$ for $i = 1, ..., m$ and $j = 1,...,n$.
Example 4
Determine the values of $w, x, y$ and $z$ that guarantee the matrices $A$ and $B$ are equal,
$A = \pmatrix{4 & x \\ x+z & 0}$, $B = \pmatrix{y & 6 \\ 7 & w}$
Solution
We require $w = 0,\; x = 6,\; y = 4,\; x + z = 7 \implies z = 1$.
End of Example 4Now watch the following:

3. Operations with matrices
We now look at some basic arithmetic operations with matrices.
3.1. Matrix addition
 Two matrices can be added if and only if they are of the same size.
 To add two matrices we add corresponding elements.
 The result of the addition is a matrix of the same size.
 Matrix addition is commutative, i.e. $A + B = B + A$, see parts (ii) and (iii) in the following example.
Example 5
In each of the following carry out the specified addition.
(i). $\pmatrix{\;\;50 & \;\;25 & \;\;45 \\ 125 & \;\;80 & \;\;60 \\ \;\;60 & \;\;80 & \;\;75 \\ \;\;90 & 120 & 110} + \pmatrix {50 & 35 & \;\;\,45 \\ 25 & 80 & 70 \\ 80 & 10 & \;\,5 \\ \;\;\,90 & 20 & 135} = \pmatrix{\;\;\;0 & \;\;\,60 & \;\;\,90 \\ \,100 & \,160 & 10 \\ 20 & \;\;\,90 & \;\;\,70 \\ \,180 & \,140 & 25}$
(ii). $\pmatrix {2 & 1 \\3 & \;\;\,6} + \pmatrix{\;\;\,0 & 4 \\ 2 & 5} = \pmatrix{2 & \;\,3 \\ 1 & 11}$
(iii). $\pmatrix{\;\;\,0 & 4 \\ 2 & 5} + \pmatrix{2 & 1 \\ 3 & \;\;\,6} = \pmatrix{2 & \;\,3 \\ 1 & 11}$
End of Example 53.2. Matrix subtraction
 Two matrices $A$ and $B$ can be subtracted if and only if they are of the same size.
 To form $A  B$ subtract each element of $B$ from the corresponding element of $A$.
 The result of the subtraction is a matrix of the same size.
 As for subtraction of real numbers, matrix subtraction is not commutative, i.e. $A  B \neq B  A$, see the next example.
Example 6
In the following carry out the specified subtraction.
(i). $\pmatrix{3 & 1 & 2 \\ 4 & 0 & \;\;\,8}  \pmatrix{2 & 3 & 1 \\ 2 & 5 & \;\;\,1} = \pmatrix{1 & 4 & 1 \\ 2 & 5 & \;\;\,7}$
(ii). $\pmatrix{2 & 3 & 1 \\ 2 & 5 & \;\;\,1}  \pmatrix{3 & 1 & 2 \\ 4 & 0 & \;\;\,8} = \pmatrix{1 & 4 & \;\;\,1 \\ 2 & 5 & 7}$
End of Example 63.3. Scalar multiplication of a matrix
 Any matrix can be multiplied by a number (scalar) and this procedure is referred to as scalar multiplication.
 Scalar multiplication is performed by multiplying each element in the matrix by the number.
 Scalar multiplication must not be confused with matrix multiplication which will be defined later.
Example 7
Simplify each of the following by performing the scalar multiplication.
(i). $2\pmatrix{0 & \;\;\,4 \\1 & 1} = \pmatrix{0 & \;\;\,8 \\ 2 & 2}$
(ii). $0.1\pmatrix{3 \\ 2 \\ \;\;\,0 \\ \;\;\,2} = \pmatrix{\;\;0.3 \\ \;\;0.2 \\ \;\;\;\;0 \\ 0.2}$
End of Example 7Example 8
Let $A = \pmatrix{1 & 1 & 2 \\ 2 & 3 & 4}, B = \pmatrix{0 & 1 & \;\;\,0 \\ 1 & \;\;\,0 & 1}$ and $C = \pmatrix{\;\;\,1 & 0 \\ 9 & 4}$
If possible simplify each of the following:
(i). $2A + 3B$, (ii). $3B  2A$(iii). $C  A$
Solution
(i). $2A + 3B = 2\pmatrix{1 & 1 & 2 \\ 2 & 3 & 4} + 3\pmatrix{0 & 1 & \;\;\,0 \\ 1 & \;\;\,0 & 1}$
$=\; \pmatrix{2 & 2 & 4 \\ 4 & 6 & 8} + \pmatrix{0 & 3 & \;\;\,0 \\ 3 & \;\;\,0 & 3}$
$=\; \pmatrix{2 & 1 & 4 \\ 7 & \;\;\,6 & 5}$
(ii). $3B  2A = 3\pmatrix{0 & 1 & \;\;\,0 \\ 1 & \;\;\,0 & 1}  2\pmatrix{1 & 1 & 2 \\ 2 & 3 & 4}$
$=\; \pmatrix{0 & 3 & \;\;\,0 \\ 3 & \;\;\,0 & 3}  \pmatrix{2 & 2 & 4 \\ 4 & 6 & 8}$
$=\; \pmatrix{2 & 5 & \;\;4 \\ 1 & 6 & 11}$
(iii). We are unable to calculate $C  A$ as the matrices have different sizes.
Here $C$ is a $2 \times 2$ matrix while $A$ is a $2 \times 3$ matrix.
End of Example 8Now watch the following:
📹 Addition, subtraction and scalar multiplication of matrices
3.4. Matrix Multiplication
 Matrix multiplication can only be carried out between matrices which are conformable for matrix multiplication.
 Two matrices $A$ and $B$, with sizes $m \times n$ and $p \times q$ respectively, are conformable for multiplication, $A \times B$, if and only if $n = p$ ; i.e the number of columns of $A$ is the same as the number of rows of $B$.
 The result of multiplying a $m \times n$ matrix, $A$, (on the left) and an $p \times q$ matrix, $B$, (on the right) where $n = p$, is a $m \times q$ matrix and we write the product as $AB$.
 Note that matrix multiplication may be defined for $AB$ but not necessarily for $BA$. Hence, matrix multiplication is not in general commutative.
Note: If the “inner dimensions” $n$ and $p$ are equal we can multiply the matrices and the resulting product matrix has size given by the “outer dimensions”, i.e. $m \times q$.
If required further resources on multiplication of matrices can be found at:
📹 Matrix Multiplication 1 (Exam Solutions)
📹 Matrix Multiplication 2 (Khan Academy)
🔗 Matrix Multiplication 3 (Mathcentre)
Example 9
Determine which of the following matrices are conformable for matrix multiplication
$A = \pmatrix{1 & \;\;\,2 & 3 \\ 4 & 5 & 6}, B = \pmatrix{1 & 2 \\ 3 & 4}, C = \pmatrix{1 & \;\;\,2 \\ 2 & \;\;\,4 \\ 3 & 1}$.
Solution
The matrix $A$ is $2 \times 3$.
The matrix $B$ is $2 \times 2$.
The matrix $C$ is $3 \times 2$.
(i). First consider the matrix product $AB$.
The “inner dimensions” are not equal and so we cannot perform the matrix multiplication. The number of columns in $A(3)$ does not equal the number of rows in $B( 2)$.
(ii). Now consider the matrix product $AC$.
The “inner dimensions” are equal and so we can perform the matrix multiplication and the product matrix will have size given by the “outer dimensions”, i.e. $2 \times 2$.
Exercise: Confirm the following: $BA, AC, CA, CB$ and $BB$ are valid multiplications; whereas we cannot calculate $AB, BC, AA$ or $CC$.
End of Example 93.4.1. Matrix multiplication and the scalar (dot) product
To multiply two matrices, conformable for matrix multiplication, involves an extension of the scalar (dot) product procedure from vector algebra.
To form the result of multiplying $A$ (on the left) by $B$ (on the right) (i.e. to form the product $AB$) we view $A$ as a matrix composed of rows and $B$ as a matrix made up of columns.
The entries in the product matrix are determined by forming dot products.
To determine the element in Row $i /$ Column $j$, i.e. position $( i, j )$, of $AB$ we form the dot product of Row $i$ of matrix $A$ with Column $j$ of matrix $B$.
Example 10
Let $A = \pmatrix{\;\;\,1 & 6 & 2 \\ \;\;\,3 & 0 & \;\;\,3 \\ 2 & 3 & 1}$ and $B = \pmatrix{1 & \;\;\,2 \\ 1 & 2 \\ 3 & \;\;\,0}$
The product matrix $AB$ can be calculated as $A$ has size $3 \times 3$ and $B$ has size $3 \times 2$, i.e. the number of columns of $A$ is the same as the number of rows of $B$.
Hence, the product matrix, $AB$ will have size $3 \times 2$.
For example, to obtain the element in Row 1/Column 1, i.e. position $(1, 1)$ of $AB$ we take the dot product of Row 1 of $A$ with Column 1 of $B$, i.e.
To obtain the element in Row 1/Column 2, i.e. position $(1, 2)$ we take the dot product of Row 1 of $A$ with Column 2 of $B$. In vector form we have,
$\pmatrix{1 & 6 & 2}. \pmatrix{\;\;\,2 \\ 2 \\ \;\;\,0} = 1 \times 2 + 6 \times (2) + (2) \times 0 = 10$.
This process can be continued to generate the 6 components of the $3 \times 2$ product matrix, $AB$.
$\pmatrix{\;\;\,1 & 6 & 2 \\ \;\;\,3 & 0 & \;\;\,3 \\ 2 & 3 & 1}\pmatrix{1 & \;\;\,2 \\ 1 & 2 \\3 & \;\;\,0} = \pmatrix{1 \times 1 + 6 \times 1 + (2) \times 3 & 1 \times 2 + 6(2) + (2) \times 0 \\ 3 \times 1 + 0 \times 1 + 3 \times 3 & 3 \times 2 + 0 \times (2) + 3 \times 0 \\ 2 \times 1 + 3 \times 1 + (1) \times 3 & 2 \times 2 + 3 \times (2) + (1) \times 0}$
$= \pmatrix{\;\;\,1 & 10 \\ \;\;12 & \;\;\;\,6 \\ 2 & 10}$
End of Example 10Example 11
Let $A = \pmatrix{0 & \;\;\;4 \\ 1 & 1}$ and $B = \pmatrix{1 & \;\;\;1 \\ 2 & 1}$. If possible calculate $AB$ and $BA$.
Solution
In this case $A$ and $B$ are both $2 \times 2$ (square) matrices and so we can calculate $AB$ and $BA$. The result of both multiplications will be a $2 \times 2$ matrix. We have
$AB = \pmatrix{0 & \;\;\;4 \\ 1 & 1}\pmatrix{1 & \;\;\;1 \\ 2 & 1} = \pmatrix{\;\;\;8 & 4 \\ 1 & \;\;\;2}$
and
$BA = \pmatrix{1 & \;\;\;1 \\ 2 & 1}\pmatrix{0 & \;\;\;4 \\ 1 & 1} = \pmatrix{\;\;\;1 & 3 \\ 1 & 9}$
Note: This is an example of a very important result in matrix arithmetic. In general, for square matrices $A$ and $B$, we have that $AB \neq BA$.
End of Example 11Example 12
If possible evaluate the following matrix products:
(i). $\pmatrix{\;\;\,1 & 2 & \;\;\,3 \\ \;\;\,2 & 0 & \;\;\,1 \\ 1 & 1 & 1}\pmatrix{\;\;\,1 & 2 \\ \;\;\,4 & 2 \\ 1 & 0}$.
(ii). $\pmatrix{a & b \\ b & a}\pmatrix{1 & 2 \\ 3 & 4}$.
(iii). $\pmatrix{1 & x \\ x & 2}\pmatrix{x & y \\ x & 1}$.
(iv). $\pmatrix{\;\;\,3 \\ 1 \\ \;\;\,2}\pmatrix{2 & 0 & 1 & 6}$
(v). $\pmatrix{2 & 0 & 1 & 6}\pmatrix{\;\;\,3 \\ 1 \\ \;\;\,2}$.
Solution
(i) $\pmatrix{\;\;\,1 & 2 & \;\;\,3 \\ \;\;\,2 & 0 & \;\;\,1 \\ 1 & 1 & 1}\pmatrix{\;\;\,1 & 2 \\ \;\;\,4 & 2 \\ 1 & 0}$.
The product can be formed as the first matrix has size $3 \times 3$ and the second matrix has size $3 \times 2$, i.e. the number of columns in the first matrix $(3)$ is the same as the number of rows $(3)$ in the second matrix. The product matrix will have size $3 \times 2$. Multiplying gives,
$\pmatrix{1 \times 1 + 2 \times 4 + 3 \times (1) & 1 \times 2 + 2 \times 2 + 3 \times 0 \\ 2 \times 1 + 0 \times 4 + 1 \times (1) & 2 \times 2 + 0 \times 2 + 1 \times 0 \\1 \times 1 + 1 \times 4 + (1) \times (1) & 1 \times 2 + 1 \times 2 + (1) \times 0} = \pmatrix{6 & 6 \\ 1 & 4 \\ 4 & 0}$
(ii). $\pmatrix{a+3b & 2a+4b \\ b+3a & 2b+4a}$ (Exercise: Check this answer)
(iii). $\pmatrix{x + x^2 & y + x \\ x^2 + 2x & xy + 2}$ (Exercise: Check this answer)
(iv). $\pmatrix{\;\;\,3 \\ 1 \\ \;\;\,2}\pmatrix{2 & 0 & 1 & 6}$
The product can be formed as the first matrix has size $3 \times 1$ and the second matrix has size $1 \times 4$, i.e. the number of columns in the first matrix $(1)$ is the same as the number of rows $(1)$ in the second matrix. The product matrix will have size $3 \times 4$. Multiplying gives,
$\pmatrix{\;\;\,3 \times 2 & \;\;\,3 \times 0 & \;\;\,3 \times (1) & \;\;\,3 \times 6 \\ 1 \times 2 & 1 \times 0 & 1 \times (1) & 1 \times 6 \\ \;\;\,2 \times 2 & \;\;\,2 \times 0 & \;\;\,2 \times (1) & \;\;\,2 \times 6} = \pmatrix{\;\;\,6 & 0 & 3 & \;\;16 \\ 2 & 0 & \;\;\,1 & 6 \\ \;\;\,4 & 0 & 2 & \;\;12}$
(v). $\pmatrix{2 & 0 & 1 & 6}\pmatrix{\;\;\,3 \\ 1 \\ \;\;\,2}$
The product cannot be formed as the first matrix has size $1 \times 4$ and the second matrix has size $3 \times 1$, i.e. the number of columns in the first matrix $(4)$ is not the same as the number of rows $(3)$ in the second matrix.
End of Example 12Example 13
Let $A = \pmatrix{1 & 2 & 3 \\ 2 & 5 & 3 \\ 1 & 0 & 8}$ and $B = \pmatrix{40 & 16 & \;\;\,9 \\ \;\;\,13 & 5 & 3 \\ \;\;\;\;5 & 2 & 1}$. Calculate the matrix products $AB$ and $BA$.
Solution
(i). $AB = \pmatrix{1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1}, BA = \pmatrix{1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1}$.
Exercise: You should verify these calculations.
Unlike Example 11 we find that in this case matrix multiplication is commutative and $AB = BA$. This particular square matrix, with 1’s on the main diagonal (top left to bottom right) and 0’s everywhere else, is known as the identity matrix – see Sections 4.2 and 5 for further discussions.
End of Example 13Example 14
Determine the values of $x$ and $y$ that satisfy the following matrix equation.
$\pmatrix{1 & \;\;\,3 \\ x & 2}\pmatrix{2 & 4 \\ 3 & y} = \pmatrix{11 & \;\;\,1 \\ \;\;\,6 & 26}$
Solution
Expanding the lefthandside (LHS) gives,
$\pmatrix{1 & \;\;\,3 \\ x & 2}\pmatrix{2 & 4 \\ 3 & y} = \pmatrix{11 & 4 + 3y \\ 2x  6 & 4x  2y} = \pmatrix{11 & \;\;\,1 \\ \;\;\,6 & 26}$
We therefore have three equations. The first two of these are equations in one variable which can easily be solved for $x$ and $y$. The third equation can be used to check our answers.
$ {\array{2x 6 = 6 \\ 4 + 3y = 1 \\ 4x  2y = 26}}\Bigg\} \implies x = 6,\; y = 1 $.
End of Example 14 
4. Special matrices
There are several special matrices that we should be aware of as they will be needed in future calculations.
4.1. Transpose Matrix
The matrix obtained from $A$ by interchanging the rows and the columns of $A$ is called the transpose of $A$ and is denoted $A^T$. We refer to this matrix as, “$A$ transpose”.
Example 15
Let $A = \pmatrix{1 & 2 & 7 \\ 6 & \;\;\,0 & 5}$. Write down the matrix $A^T$.
Solution
The matrix $A^T$ is obtained by interchanging rows and columns of the matrix $A$. Hence,
$A^T = \pmatrix{\;\;\,1 & 6 \\ 2 & 0 \\ \;\;\,7 & 5}$.
Note that Row 1 of $A$ is Column 1 of $A^T$ and Row 2 of $A$ is Column 2 of $A^T$.
Alternatively, Column 1 of $A$ is Row 1 of $A^T$, etc.
End of Example 154.1.1. Properties of transpose matrices
$(A^T)^T = A$ the transpose of a transpose matrix equals the original matrix. $(AB)^T = B^TA^T$ the transpose of a matrix product equals the product of the transpose matrices, with the order of multiplication reversed. $(A + B)^T = A^T + B^T$ the transpose of a matrix sum equals the sum of the transpose matrices. $(k A)^T = kA^T$ the transpose of a matrix multiplied by a scalar equals the scalar multiplied by the transpose of the matrix, $k \neq 0$ is a scalar 4.2. The identity matrix
We know that when any number in multiplied by the number 1 the value of the original number is unchanged, e.g. $1 \times 9 = 9,\;\; 1 \times 100 = 100$, etc.
In this context we call 1 the identity element for multiplication.
We now define an identity element for matrix multiplication so that when a matrix is multiplied by the identity it remains unchanged. This identity element is called an identity matrix and is only defined for square matrices. Although there is only a single multiplicative identity, i.e. 1, when working with numbers there are many different identity matrices depending on the size of the matrix in question, e.g. $2 \times 2,\;\; 3 \times 3$, etc.
The identity matrix has 1 on the main diagonal (the diagonal starting at top left and going to bottom right) and zeros everywhere else – see Example 13. The matrix is usually represented by $I$. Note that some textbooks include a subscript $n$, and write $I_n$, to indicate the size of the identity matrix.
Example 16
(i). The $2 \times 2$ identity matrix is, $I = \pmatrix{1 & 0 \\ 0 & 1}$.
(ii). We met the $3 \times 3$ identity matrix, $I = \pmatrix{1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1}$ in Example 13.
End of Example 164.3. The zero matrix
The zero matrix is a matrix for which every element is zero. Strictly speaking there are many zero matrices, one for each possible size of matrix. Here are the $2 \times 2$ and $2 \times 4$ zero matrices.
$\pmatrix{0 & 0 \\ 0 & 0}$$\pmatrix{0 & 0 & 0 & 0 \\ 0 & 0 & 0 & 0}$
The zero matrix is the identity matrix for matrix addition as shown in the following example.
Example 17
If $A = \pmatrix{\;\;\,1 & 9 \\ 2 & 3}$ then
$\pmatrix{\;\;\,1 & 9 \\ 2 & 3} + \pmatrix{0 & 0 \\ 0 & 0} = \pmatrix{\;\;\,1 & 9 \\ 2 & 3}$
The matrix $A$ is unchanged by addition of the zero matrix.
End of Example 174.4. Diagonal matrices
A square matrix is called a diagonal matrix if all the entries that do not lie on the main diagonal are zero. Note that it is allowed for some entries on the main diagonal to equal zero.
Example 18
The following matrices are all examples of diagonal matrices:
(i). $\pmatrix{6 & \;\;\,0 \\ 0 & 1} $ (ii). $\pmatrix{2 & \;\;\,0 & 0 \\ 0 & 5 & 0 \\0 & \;\;\,0 & 3}$(iii). $\pmatrix{4 & 0 & \;\;\,0 \\ 0 & 0 & \;\;\,0 \\0 & 0 & 1}$.
The identity matrix is a special case of a diagonal matrix where all the diagonal entries are equal to 1.
End of Example 184.5. Upper and lower triangular matrices
An upper triangular matrix is a square matrix in which all the entries below the main diagonal are zeros. Note that some entries on the main diagonal and/or above the main diagonal can equal zero.
Example 19
The matrices below are all examples of upper triangular matrices :
(i). $\pmatrix{6 & \;\;2 \\ 0 & 1}$ (ii). $\pmatrix{2 & 5 & 4 \\ 0 & \;\;9 & 6 \\ 0 & \;\;0 & 3}$(iii). $\pmatrix{4 & 2 & \;\;0 \\ 0 & 0 & \;\;3 \\ 0 & 0 & 1}$.
End of Example 19A lower triangular matrix is a square matrix in which all the entries above the main diagonal are zeros. Note that some entries on the main diagonal and/or below the main diagonal can equal zero.
Example 20
The matrices below are all examples of lower triangular matrices :
(i). $\pmatrix{6 & \;\;0 \\ 2 & 1}$ (ii). $\pmatrix{2 & \;\;0 & 0 \\ 6 & \;\;9 & 0 \\ 4 & 5 & 3}$(iii). $\pmatrix{4 & 0 & 0 \\ 3 & 1 & 0 \\ 2 & 0 & 0}$.
End of Example 204.6. Symmetric matrices
A square matrix is called a symmetric matrix if it is equal to its own transpose, i.e. $A = A^T$.
Example 21
The following matrices are all symmetric,
(i). $\pmatrix{\;\;\,3 & 1 \\ 1 & \;\;\,3}$ (ii). $\pmatrix{2 & \;\;\,0 & 1 \\ 0 & 6 & 3 \\ 1 & \;\;\,3 & 5}$(iii). $\pmatrix{3 & \;\;\,2 & \;\;\,1 \\ 2 & 9 & 3 \\ 1 & 3 & \;\;\,4}$
End of Example 21You are now ready to attempt the multiple choice exercise at the link below.
In the next section we look at how to calculate the determinant and inverse ( if it exists ) of a $2 \times 2$ matrix.

5. The determinant and inverse of a $2 × 2$ matrix
Consider the following arithmetic evaluations for numbers,
$ \matrix{2 \times 2^{1}=2^{1} \times 2 = 1 \\ 3 \times 3^{1} = 3^{1} \times 3 = 1 \\ 4 \times 4^{1} = 4^{1} \times 4 = 1 \\ ......................\\ ...................... \\ a \times a^{1} = a^{1} \times a = 1 \\ ..................... \\ ......................}$
One way of interpreting the above is that any (nonzero) number $a$ has associated with it a multiplicative inverse $a^{1}$. Furthermore, any number multiplied by its inverse equals 1, the multiplicative identity for scalars.
We can make an analogous statement for (some) square matrices that will prove useful later.
For a general $2 \times 2$ matrix, $A = \pmatrix{a & b \\ c & d}$ provided
$det(A) = ad  bc \neq 0$
there exists another $2 \times 2$ matrix, called the inverse of $A$, denoted $A^{1}$, where
$A^{1} = {\Large\frac{1}{det(A)}}\pmatrix{\;\;\,d & b \\ c & \;\;\,a}$.
The quantity $det(A)$ is called the determinant of $A$ and is often written, $\mid A \mid$ .
The determinant of a matrix can therefore be used to determine the existence (or otherwise) of a matrix inverse by checking that it is nonzero.
In a manner similar to that observed earlier for scalars,
$AA^{1} = A^{1}A = I$
where $I$ is the identity matrix with the same size as the square matrix $A$. Also,
$AI = IA = A$.
Note that $A^{1}$ must not be interpreted as ${\Large\frac{1}{A}}$.
A matrix with an inverse is called invertible or nonsingular.
A matrix with no inverse is said to be noninvertible or singular.
We now look at how to determine inverse matrices, where they exist, for the $2 \times 2$ case.
Example 22
Calculate the determinant of each of the following matrices. Hence, identify which matrices are invertible and for each invertible matrix calculate its inverse.
(i). $A = \pmatrix{\;\;\,2 & 1 \\ 2 & \;\;\,1}$ (ii). $B = \pmatrix{7 & 3 \\ 2 & 1}$
(iii). $C = \pmatrix{0 & 1 \\ 0 & 1}$ (iv). $M = \pmatrix{\;\;\,2 & \;\;\,0 \\ 2 & 3}$
Solution
(i). $det(A) = 2 \times 1  (1) \times (2) = 2  2 = 0$. No Inverse.
(ii). $det(B) = 7 \times 1  3 \times 2 = 7  6 = 1 \neq 0$. Matrix has an inverse.
$B^{1} = \ {\Large\frac{1}{1}}\pmatrix{\;\;\,1 & 3 \\ 2 & \;\;\,7} =\pmatrix{\;\;\,1 & 3 \\ 2 & \;\;\,7}$
Exercise: Check that $BB^{1} = B^{1}B = I$ .
(iii). $det(C) = 0 \times 1  1 \times 0 = 0  0 = 0$. No inverse.
(iv). $det(M) = 2 \times (3)  0 \times (2) = 6 \neq 0$.
$M^{1} = {\Large\frac{1}{6}}\pmatrix{3 & 0 \\ \;\;\,2 & 2}$
$= {\Large\frac{1}{6}}\pmatrix{\;\;\,3 & \;\;\,0 \\ 2 & 2}$
Exercise: Check that $MM^{1} = M^{1}M = I$.
End of Example 22Now watch the following:
📹 Inverse of a $2 \times 2$ matrix
5.1. Properties of inverse matrices
If $A$ and $B$ are invertible matrices:
$(A^{1})^{1} = A$ the inverse of an inverse matrix equals the original matrix. $(AB)^{1} = B^{1}A^{1}$ the inverse of a matrix product equals the product of the inverse matrices, with the order of multiplication reversed. $(kA)^{1} = {\Large\frac{1}{k}}A^{1}$ the inverse of a matrix multiplied by a scalar equals the inverse of the scalar multiplied by the inverse of the matrix, $k \neq 0$ is a scalar. $(A^T)^{1} = (A^{1})^T$ the inverse of a transpose matrix equals the transpose of the inverse matrix. Aside: Geometrically, the absolute value of the determinant of a $2 \times 2$ matrix $A = \pmatrix{a & b \\ c & d}$ is the area of a parallelogram whose edges are the vectors $\boldsymbol{a} = (a,b)$ and $\boldsymbol{b} = (c,d)$.
In the next section we look at how to calculate the determinant and inverse of a $3 \times 3$ matrix.

6. The determinant and inverse of a $3 \times 3$ matrix
There are a number of techniques available for calculating the inverse of a $3 \times 3$ matrix. In our work we shall focus on the cofactor method. Before looking at finding the inverse of a $3 \times 3$ matrix, when it exists, we need to know how to calculate the determinant of the matrix.
6.1. The determinant a $3 \times 3$ matrix
Here we look at two methods for calculating the determinant of a $3 \times 3$ matrix,
$A = \pmatrix{a_{11} & a_{12} & a_{13} \\ a_{21} & a_{22} & a_{23} \\ a_{31} & a_{32} & a_{33}}$.
6.1.1. Evaluating the determinant by cofactor expansion
To apply this method we need to know how to calculate minors and cofactors.
Consider a typical element, $a_{ij}$, of the $3 \times 3$ matrix, $A$, given above.
 The minor of element, $a_{ij}$ , denoted by $M_{ij}$ , is obtained as follows :
 remove the $i^{\text{th}}$ row from $A$.
 remove the $j^{\text{th}}$ row from $A$.
 the minor $M_{ij}$ is the determinant of the remaining $2 \times 2$ submatrix.
The cofactor, $C_{ij}$, for element $a_{ij}$ is obtained by multiplying the minor of $a_{ij}$ by $(1)^{i + j}$, so that $C_{ij} = (1)^{i + j}M_{ij}$.
We note here that $C_{ij} = M_{ij}$ if $i + j$ is even and $C_{ij} = M_{ij}$ if $i + j$ is odd.
To obtain the determinant of the matrix $A$ we select a row (column), multiply each entry in the chosen row (column) by its cofactor and sum the resulting values.
For example, if we expand on row $k$ we have:
$$\text{det}(A) = a_{k1}C_{k1} + a_{k2}C_{k2} + a_{k3}C_{k3} = \sum_{j = 1}^{3} a_{kj}C_{kj}.$$
Alternatively, if we expand on column $k$ we have
$$\text{det}(A) = a_{1k}C_{1k} + a_{2k}C_{2k} + a_{3k}C_{3k} = \sum_{j = 1}^{3} a_{jk}C_{jk}.$$
We illustrate the process with an example.
Example 23
Calculate the determinant of the matrix, $A = \pmatrix{3 & \;\;\,2 & 1 \\ 1 & \;\;\,6 & \;\;\,3 \\ 2 & 4 & \;\;\,0}$ using cofactor expansion.
Solution
 We choose to expand along Row 1 and first calculate the minor for each entry :
 the minor of entry $a_{11} = 3$ is:
 the minor of entry $a_{12} = 2$ is:
 the minor of entry $a_{13} = 1$ is:
 Now calculate the cofactors :
 the cofactor of entry $a_{11}$ is: $C_{11} = (1)^{1 + 1} \times M_{11} = (1)^2 \times 12 = 12$.
 the cofactor of entry $a_{12}$ is: $C_{12} = (1)^{1 + 2} \times M_{12} = (1)^3 \times (6) = 6$.
 the cofactor of entry $a_{13}$ is: $C_{13} = (1)^{1 + 3} \times M_{13} = (1)^4 \times (16) = 16$.
Finally, multiply each entry in Row 1 by its cofactor and sum the values. Hence,
$$\text{det}(A) = \sum_{j = 1}^{3}a_{1j}C_{1j}$$
$= a_{11}C_{11} + a_{12}C_{12} + a_{13}C_{13}$
$= 3 \times 12 + 2 \times 6 + (1) \times (16)$
$= 36 + 12 + 16$
$=$ $64$.
Notes
(i). The value of the determinant will be the same regardless of which row or column we expand on.
(ii). When calculating the determinant of a matrix we expand along the row or column containing the most zeros in order to minimise the arithmetic.
End of Example 23The process described above can be presented in a more compact form by making use of the sign array,
$$\pmatrix{+ &  & + \\  & + &  \\ + &  & +}$$
to associate a sign with each entry in our matrix. This approach eliminates the need to calculate the cofactors explicitly. We illustrate the method by repeating Example 23 to (hopefully) obtain the same value as above for the determinant of the matrix $A$.
Example 24
Calculate the determinant of the matrix, $A = \pmatrix{3 & \;\;\,2 & 1 \\1 & \;\;\,6 & \;\;\,3 \\ 2 & 4 & \;\;\,0}$ by expanding on Row 1. Repeat the calculation by expanding on Column 2.
Solution
Expand along the first row of $A$ calculating the minors. Multiply each minor by the corresponding entry from the matrix $A$, augmented by the appropriate sign from the first row of the sign array, i.e. $(+ \;\;  \;\; +)$ and sum the results.
$\text{det}(A) = + 3. \bigg \matrix{\;\;\,6 & 3 \\ 4 & 0}\bigg   2. \bigg \matrix{1 & 3 \\ 2 & 0} \bigg  + (1). \bigg \matrix{1 & \;\;\,6 \\ 2 & 4}\bigg $
$= 3.(6 \times 0  3 \times (4))  2.(1 \times 0  3 \times 2) + (1).(1 \times(4)  6 \times 2)$
$= 36 + 12 + 16$
$=$ $64$.
Now expand along the second column of $A$ using the appropriate signs from the second column of the sign array, i.e. $( \;\; + \;\; )$ :
$\text{det}(A) = 2. \bigg  \matrix{1 & 3 \\ 2 & 0} \bigg  + 6. \bigg  \matrix{3 & 1 \\ 2 & \;\;\, 0} \bigg   (4). \bigg  \matrix{3 & 1 \\ 1 & \;\;\, 3} \bigg $
$=  2.(1 \times 0  3 \times 2) + 6.(3 \times 0  (1) \times 2) + 4.(3 \times 3  (1) \times 1)$
$= 12 + 12 + 40$
$=$ $64$ as obtained earlier.
End of Example 24Now watch the following:
📹 Determinant of a 3x3 matrix Example (1)
📹 Determinant of a 3x3 matrix Example (2)
6.1.2. Evaluating the determinant by the Rule of Sarrus
An alternative approach for calculating the determinant of a $3 \times 3$ matrix
$A = \pmatrix{a_1 & a_2 & a_3 \\ b_1 & b_2 & b_3 \\ c_1 & c_2 & c_3}$
was developed by the French mathematician Pierre Sarrus (17981861). The Rule of Sarrus involves the following steps:
Rewrite the first two columns of the matrix to the right of it :
$${\LARGE\matrix{a_1 & a_2 & a_3 & a_1 & a_2 \\ b_1 & b_2 & b_3 & b_1 & b_2 \\ c_1 & c_2 & c_3 & c_1 & c_2}}$$
Using the left to right diagonals take the products $a_1b_2c_3, \; a_2b_3c_1, \; a_3b_1c_2$:
Using the right to left diagonals take the products $a_3b_2c_1, \; a_1b_3c_2, \;a_2b_1c_3$ :
Combine the above and calculate the determinant as follows :
$\text{det}(A) = a_1b_2c_3 + a_2b_3c_1 + a_3b_1c_2  a_3b_2c_1  a_1b_3c_2  a_2b_1c_3$.The Rule of Sarrus is essentially the same as the method we described previously.
Example 25
Calculate the determinant of the matrix, $A = \pmatrix{3 & \;\;\,2 & 1 \\ 1 & \;\;\,6 & \;\;\, 3 \\ 2 & 4 & \;\;\,0}$ using the Rule of Sarrus.
Solution
Rewrite the first two columns of the matrix to the right of it :
$\matrix{3 & \;\;\,2 & 1 & 3 & \;\;\,2 \\ 1 & \;\;\,6 & \;\;\,3 & 1 & \;\;\,6 \\ 2 & 4 &\;\;\,0 & 2 & 4}$Calculate the determinant as described above :
$\text{det}(A) = 3 \times 6 \times 0 + 2 \times 3 \times 2 + (1) \times 1 \times (4)$
$\, 2 \times 1 \times 0  3 \times 3 \times (4)  (1) \times 6 \times 2$
$= 0 + 12 + 4  0  (36)  (12)$
$=$ $64$.
Note that, as expected, this is the same answer as we obtained using the previous method.
Now watch the following:
Aside: Geometrically, the absolute value of the determinant of a $3 \times 3$ matrix is the volume of a parallelepiped whose edges are the vectors $\boldsymbol{u} = (a_1, \,a_2,\,a_3)$, $\boldsymbol{v} = (b_1,\,b_2,\,b_3)$ and $\boldsymbol{w} = (c_1, \,c_2,\,c_3)$.
End of Example 256.2. The inverse of a $3 \times 3$ matrix by the cofactor method
We now extend the idea of an inverse matrix to the $3 \times 3$ case. In general, the inverse of a matrix, $A$, is given by the formula :
$A^{1} = \frac{1}{\det(A)}adj(A)$ $\text{det}(A) \neq 0$
where the matrix $adj(A)$ is known as the adjoint matrix of $A$.
In order to calculate the inverse of a matrix $A$, if it exists, we must therefore obtain the determinant of $A$ and the adjoint of $A$. The derivation of the adjoint matrix requires us to calculate the matrix of minors of $A$ and matrix of cofactors of $A$. The following paragraphs illustrate the methodology by way of an example reducing the procedure to five distinct steps.
Example 26
Determine the inverse of the matrix, $A = \pmatrix{3 & \;\;\, 2 & 1 \\ 1 & \;\;\, 6 & \;\;\, 3 \\ 2 & 4 & \;\;\, 0}$ , if it exists.
Solution
Although we have performed some of the calculations for this example previously for completeness we present a full solution.
STEP 1: Calculate the determinant of $A$
Expanding along the third row the determinant of $A$ is :
$\text{det}(A) = 2. \bigg  \matrix{2 & 1 \\ 6 & \;\;\, 3} \bigg   ( 4) \bigg  \matrix{3 & 1 \\ 1 & \;\;\, 3} \bigg  + 0. \bigg  \matrix{3 & 2 \\ 1 & 6} \bigg  = 2 \times 12 + 4 \times 10 = 64$.
Since $\text{det}(A) \neq 0,\; A^{1}$ exists.
STEP 2: Calculate the matrix of minors
 The minor of entry $a_{ij}$, denoted by $M_{ij}$, is obtained as follows:
 remove the $i^{\text{th}}$ row.
 remove the $j^{\text{th}}$ column.
 the minor $M_{ij}$ is the determinant of the remaining $2 \times 2$ submatrix.
The minor of entry $a_{11}$ is:
The minor of entry $a_{12}$ is:
The minor of entry $a_{13}$ is:
The minor of entry $a_{21}$ is:
The minor of entry $a_{22}$ is:
The minor of entry $a_{23}$ is:
The minor of entry $a_{31}$ is:
The minor of entry $a_{32}$ is:
The minor of entry $a_{33}$ is:
Hence, the matrix of minor is : $\pmatrix{\;\,12 & 6 & 16 \\4 & \;\;\,2 & 16 \\ \;\,12 & \;\,10 & \;\;\, 16}$.
STEP 3: Calculate the cofactor matrix
The cofactor of entry $a_{ij}$, denoted by $C_{ij}$, is defined as $C_{ij} = (1)^{i + j}M_{ij}$.
To obtain the cofactor matrix $cof(A)$ we use a shortcut and simply change signs of the elements of the matrix of minors, calculated in Step 2, using the sign matrix :
$\pmatrix{+ &  & + \\  & + &  \\ + &  & +}$
Hence, we obtain the cofactor matrix :
$cof(A) = \pmatrix{12 & \;\;\,6 & 16 \\\;\,4 & \;\;\,2 & 16 \\ 12 & 10 & \;\;\, 16}$
STEP 4: Calculate the adjoint matrix
The adjoint of $A$ is defined to be the transpose of the cofactor matrix, i.e.
$adj(A) = \pmatrix{\;\;\,12 & \;\,4 & \;\;\,12 \\ \;\;\;6 & \;\,2 & 10 \\ 16 & 16 & \;\;\,16}$
STEP 5: Calculate the inverse matrix
The inverse of the matrix $A$ is calculated as :
$$A^{1} = \frac{1}{\text{det}(A)}adj(A)$$
so that $A^{1} = {\Large\frac{1}{64}} \pmatrix{\;\;\,12 & \;\,4 & \;\;12 \\ \;\;\;6 & \;\,2 & 10 \\16 & 16 & \;\;16}$ which simplifies to give $A^{1} = {\Large\frac{1}{32}} \pmatrix{\;\;\;6 & 2 & \;\;\;6 \\ \;\;\;3 & 1 & 5 \\ 8 & 8 & \;\;\;8}$ .
It is straightforward to check that $AA^{1} = A^{1}A = I$. We have,
$AA^{1} = {\Large\frac{1}{32}}\pmatrix{3 & \;\;\;2 & 1 \\ 1 & \;\;\;6 & \;\;\;3 \\ 2 & 4 & \;\;\;0}\pmatrix{\;\;\;6 & 2 & \;\;\;6 \\ \;\;\;3 & 1 & 5 \\ 8 & 8 & \;\;\;8} = {\Large\frac{1}{32}}\pmatrix{32 & \;\;\,0 & \;\;\,0 \\ \;\;0 & 32 & \;\;0 \\ \;\;\,0 & \;\;\,0 & 32} = \pmatrix{1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1} = I$ as required.
End of Example 26Watch these videos in the given order :
📹 Inverse of a $3 \times 3$ matrix
Example 27
Determine the inverse of the matrix $A = \pmatrix{3 & 1 & 6 \\ 9 & 5 & 2 \\ 0 & \;\;\,4 & 7}$ if it exists.
Solution
STEP 1: Calculate the determinant of $A$
$\text{det}(A) = 3. \bigg  \matrix{5 & 2 \\ \;\;\,4 & 7} \bigg   (1). \bigg  \matrix{9 & 2 \\0 & 7} \bigg  + 6. \bigg  \matrix{9 & 5 \\ 0 & \;\;\,4} \bigg  = 3 \times (43) + 63 + 6 \times 36 = 150.$
Since $\text{det}(A) \neq 0,\; A^{1}$ exists.
STEP 2: Calculate the matrix of minors
The minor of entry $a_{11}$ is:
The minor of entry $a_{12}$ is:
The minor of entry $a_{13}$ is:
The minor of entry $a_{21}$ is:
The minor of entry $a_{22}$ is:
The minor of entry $a_{23}$ is:
The minor of entry $a_{31}$ is:
The minor of entry $a_{32}$ is:
The minor of entry $a_{33}$ is:
Hence, the matrix of minors is: $\pmatrix{43 & \;\;63 & \;36 \\ 31 & \;\;21 & \;12 \\ \;\;\,28 & 48 & 6}$
STEP 3: Calculate the cofactor matrix
The cofactor of entry $a_{ij}$, denoted by $C_{ij}$, is defined as $C_{ij} = (1)^{i+j}M_{ij}$.
To obtain the cofactor matrix $cof(A)$ we simply change signs of the elements of the matrix of minors in Step 2 using the sign matrix :
$\pmatrix{+ &  & + \\  & + &  \\ + &  & +}$
Hence, we obtain the cofactor matrix :
$cof(A) = \pmatrix{43 & 63 & \;\;36 \\ \;\;\,31 & \;\;\,21 & 12 \\ \;\;\,28 & \;\;\,48 & \;6}$.
STEP 4: Calculate the adjoint matrix
The adjoint of $A$ is determined as the transpose of the cofactor matrix, i.e.
$adj(A) = \pmatrix{43 & \;\;\;31 & \;28 \\ 63 & \;\;\;21 & \;48 \\ \;\;\;36 & 12 & 6}$
STEP 5: Calculate the inverse matrix
The inverse of the matrix $A$ is calculated as
$A^{1} = {\Large\frac{1}{\text{det}(A)}}adj(A)$
so that $A^{1} = {\Large\frac{1}{150}}\pmatrix{43 & \;\;\;31 & \;28 \\ 63 & \;\;\;21 & \;48 \\ \;\;\;36 & 12 & 6}$.
Check the inverse is correct as follows :
$AA^{1} = {\Large\frac{1}{150}} \pmatrix{3 & 1 & 6 \\ 9 & 5 & 2 \\ 0 & \;\;\;4 & 7} \pmatrix{43 & \;\;\;31 & \;28 \\ 63 & \;\;\;21 & \;48 \\ \;\;\;36 & 12 & 6} = {\Large\frac{1}{150}}\pmatrix{150 & 0 & 0 \\ 0 & 150 & 0 \\ 0 & 0 & 150} = \pmatrix{1 & 0 & 0 \\ 0 & 1 & 0 \\ 0 & 0 & 1} = I$ as required.
End of Example 27Example 28
Calculate the determinant of the matrix, $A = \pmatrix{1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9}$ and find $A^{1}$ if it exists.
Solution
As an alternative we use the Rule of Sarrus to calculate the determinant. Writing
$\matrix{1 & 2 & 3 & 1 & 2 \\ 4 & 5 & 6 & 4 & 5 \\ 7 & 8 & 9 & 7 & 8}$
$\text{det}(A) = 1 \times 5 \times 9 + 2 \times 6 \times 7 + 3 \times 4 \times 8  2 \times 4 \times 9  1 \times 6 \times 8  3 \times 5 \times 7$
$= 45 + 84 + 96  72  48  105 = 225  225 = 0$.
As $\text{det}(A) = 0$ the matrix $A$ is not invertible.
Aside: Geometrically the result that $\det(A) = 0$ means that the vectors $(1, 2, 3)$, $(4, 5, 6)$, and $(7, 8, 9)$ are coplanar, i.e. they lie in the same plane.
End of Example 28 
7. Solving systems of linear equations by matrix methods
In the past we have solved systems of linear equations (simultaneous equations) using methods such as elimination and substitution. As systems increase in size these methods quickly become difficult to apply and it is considerably more efficient to use matrices to obtain a solution. There are several matrix methods available, including Gaussian elimination, but we shall focus our interest on using the inverse matrix to solve systems of equations.
In dealing with simultaneous equations, we normally require as many equations as there are unknowns, e.g. 2 equations in 2 unknowns, 3 equations in 3 unknowns, and so on. For example, a system of $n$ equations in $n$ unknowns is given by :
$a_{11}x_1 + a_{12}x_2 + \cdots + a_{1n}x_n = b_1 \\ a_{21}x_1 + a_{22}x_2 + \cdots + a_{2n}x_n = b_2 \\ ............................... \\ ............................... \\ a_{n1}x_1 + a_{n2}x_2 + \cdots + a_{nn}x_{n} = b_n$
This system can be written as a matrix equation of the form
$A\boldsymbol{x} = \boldsymbol{b}$
 where
 $\boldsymbol{x}$ is a column vector $(n \times 1 )$ whose components are the unknowns in the equations.
 $A$ is a square matrix $(n \times n )$ whose elements are the coefficients of the unknowns.
 $\boldsymbol{b}$ is a column vector $(n \times 1 )$ of the equation constants, i.e. the righthandside values.
We therefore have
$A = \pmatrix{a_{11} & a_{12} & \cdots & \cdots & a_{1n} \\ a_{21} & a_{22} & \cdots & \cdots & a_{2n} \\ \vdots & & \ddots & & \vdots \\ \vdots & & &\ddots & \vdots \\ a_{n1} & a_{n2} & \cdots & \cdots & a_{nn}}$, $\boldsymbol{x} = \pmatrix{x_1 \\ x_2 \\ \vdots \\ \vdots \\ x_n}$, $\boldsymbol{b} = \pmatrix{b_1 \\ b_2 \\ \vdots \\ \vdots \\ b_n }$.
Provided $A$ is invertible, i.e. $\text{det}(A) \neq 0$ , the system has a unique solution.
The solution of the matrix equation is the vector $\boldsymbol{x}$ and the elements of $\boldsymbol{x}$ give the solution of the simultaneous equations.
To find $\boldsymbol{x}$, provided the coefficient matrix $A$ is invertible, we premultiply both sides of the matrix equation by the inverse of $A$ and simplify. We have
$A\boldsymbol{x} = \boldsymbol{b}$
$A^{1}A\boldsymbol{x} = A^{1}\boldsymbol{b}$
$I\boldsymbol{x} = A^{1}\boldsymbol{b}$
$\boldsymbol{x} = A^{1}\boldsymbol{b}$.
For comparison, an analogous procedure for a scalar equation is given below.
$ax = b$
$a^{1}ax = a^{1}b$
$1x = a^{1}b$
$x = a^{1}b$.
Now watch the following:
📹 Solving simultaneous equations – matrix methods:
Example 29
(i). Solve the system of equations
$x + 2y =  1$
$4x  3y = 18$
using the inverse matrix method.
Solution
First write the equations in the matrix form, $A\boldsymbol{x} = \boldsymbol{b}$ :
$\pmatrix{1 & \;\;\,2 \\ 4 & 3} \pmatrix{x \\ y} = \pmatrix{1 \\ \;18} \\ \;\;\;\;\;\;\; A \;\;\;\;\;\;\;\;\;\, \boldsymbol{x} \;\;\;=\;\;\;\;\; \boldsymbol{b}$
Calculate $A^{1}$ if it exists.
$\text{det}(A) = 1 \times (3)  2 \times 4 =  11 \neq 0$ and so the matrix is invertible.
Hence,
$A^{1} =  {\Large\frac{1}{11}}\pmatrix{3 & 2 \\ 4 & \;\;\;1} = {\Large\frac{1}{11}} \pmatrix{3 & \;\;\;2 \\ 4 & 1}$.
Now solve the system by forming, $\boldsymbol{x} = A^{1} \boldsymbol{b}$:
$\pmatrix{x \\ y} = {\Large\frac{1}{11}} \pmatrix{3 & \;\;\;2 \\ 4 & 1}\pmatrix{1 \\ \;18} = {\Large\frac{1}{11}} \pmatrix{\;\;\,33 \\ 22} = \pmatrix{\;\;\,3 \\ 2} \\ \\ \;\;\boldsymbol{x} \;\;\; = \;\;\;\;\;\;\;\;\;\;\;A^{1}\;\;\;\;\;\;\;\; \boldsymbol{b}$
Hence, $x = 3$ and $y = 2$.
(ii). Solve the system of equations
$4x + 2y = 10$
$3x  7y = 1$
using the inverse matrix method.
Solution
First write the equations in the matrix form, $A \boldsymbol{x} = \boldsymbol{b}$ :
$\pmatrix{4 & \;\;\;2 \\ 3 & 7} \pmatrix{x \\ y} = \pmatrix{\;10 \\ 1}$.
Calculate $A^{1}$ if it exists.
$\det(A) = 28  6 =  34 \neq 0$ and so the matrix is invertible.
Hence,
$A^{1} =  {\Large\frac{1}{34}}\pmatrix{7 & 2 \\ 3 & \;\;\;4} = {\Large\frac{1}{34}} \pmatrix{7 & \;\;\;2 \\ 3 & 4}$.
Now solve the system by forming, $\boldsymbol{x} = A^{1} \boldsymbol{b}$:
$\pmatrix{x \\ y} = {\Large\frac{1}{34}} \pmatrix{7 & \;\;\;2 \\ 3 & 4} \pmatrix{\;10 \\ 1} = {\Large\frac{1}{34}} \pmatrix{68 \\ 34} = \pmatrix{2 \\ 1}$.
Hence, $x = 2$ and $y = 1$.
(iii). Solve the system of equations given by
$3x + 2y  \;\;z = \;\;\;3$
$\;\;x + 6y + 3z = \;\;29$.
$2x  4y \;\;\;\;\;\;\;\;= 18$
using the inverse matrix method.
Solution
In matrix form, $A \boldsymbol{x} = \boldsymbol{b}$, we have
$\pmatrix{3 &\;\;\; 2 & 1 \\ 1 & \;\;\;6 & \;\;\;3 \\ 2 & 4 & \;\;\;0} \pmatrix{x \\ y \\ z} = \pmatrix{\;\;\;3 \\ \;\;29 \\ 18}$.
We found the inverse of $A$ in Example 26, $A^{1} = {\Large\frac{1}{32}} \pmatrix{\;\;\;6 & 2 & \;\;\;6 \\ \;\;\;3 & 1 & 5 \\ 8 & 8 & \;\;\; 8}$.
Now solve the system by forming, $\boldsymbol{x} = A^{1} \boldsymbol{b}$ :
$\pmatrix{x \\ y \\ z} = {\Large\frac{1}{32}} \pmatrix{\;\;\; 6 & 2 & \;\;\;6 \\ \;\;\;3 & 1 & 5 \\ 8 & 8 & \;\;\;8} \pmatrix{\;\;\;\,3 \\ \;\;29 \\ 18} = {\Large\frac{1}{32}} \pmatrix{\;\;\;\,3 \\ \;\;29 \\ 18} = {\Large\frac{1}{32}} \pmatrix{32 \\ \;128 \\ \;\;64} = \pmatrix{1 \\ \;\;\; 4 \\ \;\;\; 2}$.
Hence, $x = 1$, $y = 4$ and $z = 2$.
End of Example 29Note: When the determinant of the coefficient matrix is nonzero, as in the above examples, the system will have a unique solution. If however, the determinant is close to zero this indicates that the matrix is almost singular (noninvertible) and we could run into numerical problems when calculating the inverse. When the determinant is zero the matrix does not have an inverse and the system has either no solution or infinitely many solutions. In such cases we must use an alternative method to solve the system such as Gaussian elimination.

8. Eigenvalues and eigenvectors of a $2 \times 2$ matrix
Eigenvalues and eigenvectors have many important applications in science and engineering including solving systems of differential equations, stability analysis, vibration analysis and modelling population dynamics.
Let $A$ be a $n \times n$ matrix. An eigenvalue of $A$ is a scalar $\lambda$ (real or complex) such that
$A\boldsymbol{x} = \lambda \boldsymbol{x}$(I)
for some nonzero vector $\boldsymbol{x}$. In this case, we call the vector $\boldsymbol{x}$ an eigenvector of $A$ corresponding to $\lambda$. Geometrically Eq. (I) means that the vectors $A\boldsymbol{x}$ and $\boldsymbol{x}$ are parallel. The value of $\lambda$ determines what happens to $\boldsymbol{x}$ when it is multiplied by $A$, i.e. whether it is shrunk or stretched or if its direction is unchanged or reversed.
Now watch the following:
📹 What are Eigenvalues and Eigenvectors?
📹 Introduction to Eigenvalues and Eigenvectors  Part 1
Example 30
If $A = \pmatrix{1 & 3 \\ 4 & 2}$ and $\boldsymbol{x} = \pmatrix{3 \\ 4}$, then $A\boldsymbol{x} = \pmatrix{15 \\ 20}$ $= 5\pmatrix{3 \\ 4}$.
Here we have that $A\boldsymbol{x} = 5 \boldsymbol{x}$ and so we say that $\boldsymbol{x} = \pmatrix{3 \\ 4}$ is an eigenvector of $A$ corresponding to the eigenvalue $\lambda = 5$ .
The geometric effect in this example is that the vector $\boldsymbol{x}$ has been stretched by a factor of 5 but its direction remains unchanged as $\lambda = 5$.
Note that any scalar multiple of the vector $\boldsymbol{x} = \pmatrix{3 \\ 4}$ is an eigenvector corresponding to the eigenvalue $\lambda = 5$.
End of Example 308.1. Calculation of eigenvalues
If $A$ is a $2 \times 2$ matrix it is relatively straightforward to calculate its eigenvalues and eigenvectors by hand. So, how do we calculate them?
We know that $\boldsymbol{x} = I \boldsymbol{x}$, where $I$ is the identity matrix, so we can rewrite Eq. (I) as
$A\boldsymbol{x} = \lambda I \boldsymbol{x}$
$A\boldsymbol{x}  \lambda I \boldsymbol{x} = 0$
$(A  \lambda I)\boldsymbol{x} = 0$
If the matrix $(A  \lambda I)$ is invertible, i.e. $\text{det}(A  \lambda I) \neq 0$, then the only solution to the above equation is the zero vector, i.e. $\boldsymbol{x} = \boldsymbol{0}$. We are not interested in this case as an eigenvector must be nonzero.
The equation $(A  \lambda I)\boldsymbol{x} = \boldsymbol{0}$ can only hold for a nonzero vector $\boldsymbol{x}$ if the matrix $(A  \lambda I)$ is singular (does not have an inverse). Hence, the eigenvalues of $A$ are the numbers $\lambda$ for which the matrix $(A  \lambda I)$ does not have an inverse.
In other words the numbers $\lambda$ satisfy the equation
$\text{det}(A  \lambda I) = 0$ (II)
and they can be real or complex.
8.1.1. Real distinct eigenvalues
We firstly look at the case where an $n \times n$ matrix has $n$ distinct eigenvalues.
Example 31
Find the eigenvalues of the following matrices :
(i) $A = \pmatrix{5 & 2 \\ 7 & 4}$ (ii). $B = \pmatrix{13 & 4 \\ 4 & \;\;\;7}$(iii). $C = \pmatrix{0 & 2 \\ 2 & 0}$
Solution
(i). $A  \lambda I = \pmatrix{5 & 2 \\ 7 & 4}  \lambda \pmatrix{1 & 0 \\ 0 & 1} = \pmatrix{5  \lambda & 2 \\ \;\;7 & 4\lambda}$.
Hence, $\text{det}(A  \lambda I) = \bigg  \matrix{5  \lambda & 2 \\ \;\;7 & 4\lambda} \bigg  = (5  \lambda)(4\lambda)  (2)(7) = \lambda^2  \lambda  6$.
We call $\lambda^2  \lambda  6$ the characteristic polynomial of the matrix $A$.
The eigenvalues of $A$ are the roots of the characteristic equation $\text{det}(A  \lambda I) = 0$, i.e.
$\lambda^2  \lambda  6 = 0 \implies (\lambda  3)(\lambda + 2) = 0 \implies \lambda = 2$ and $\lambda = 3$.
Hence, $\lambda_1 = 2$ and $\lambda_2 = 3$ are the eigenvalues of the matrix $A$.
 Note: We can easily check our answer as follows:
 Let $tr(A)$ denote the trace of matrix $A$, i.e. the sum of the elements on the main diagonal.
 The sum of the eigenvalues of $A$ must equal the trace of the matrix.
 Here we have that $tr(A) = 5 + (4) = 1$ and the sum of the eigenvalues is, $2 + 3 = 1$ as required.
(ii). $B  \lambda I = \pmatrix{\;13 & 4 \\ 4 & \;\;\;7 }  \lambda \pmatrix{1 & 0 \\ 0 & 1} = \pmatrix{13\lambda & 4 \\ 4 & 7\lambda}$
Hence, $\text{det}(B  \lambda I) = \bigg  \matrix{13\lambda & 4 \\ 4 & \;7\lambda} \bigg  = (13\lambda)(7\lambda)  (4)(4) = \lambda^2  20 \lambda + 75$.
Now solve $\det(B  \lambda I) = 0$ to find the eigenvalues of $B$, i.e.
$\lambda^2  20 \lambda + 75  0 \implies (\lambda  5)(\lambda  15) = 0 \implies \lambda = 5$ and $\lambda = 15$.
Hence, $\lambda_1 = 5$ and $\lambda_2 = 15$ are the eigenvalues of the matrix $B$.
(iii). $C  \lambda I = \pmatrix{0 & 2 \\2 & 0}  \lambda \pmatrix{1 & 0 \\ 0 & 1} = \pmatrix{\lambda & \;\;2 \\ \;\;2 & \lambda}$
Hence, $\text{det}(C  \lambda I) = \bigg  \matrix{\lambda & \;\;2 \\ \;\;2 & \lambda} \bigg  = (\lambda)(\lambda)  (2)(2) = \lambda^2  4$.
The eigenvalues of $C$ satisfy $\text{det}(C  \lambda I) = 0$, i.e. $\lambda^2  4 = 0 \implies \lambda = \pm 2$.
Hence, $\lambda_1 = 2$ and $\lambda_2 = 2$ are the eigenvalues of the matrix $C$.
End of Example 31The following example demonstrates a shortcut approach that can be adopted when calculating the eigenvalues of specific types of matrices.
Example 32
Find the eigenvalues of the following matrices:
(i). $A = \pmatrix{5 & 0 \\ 0 & 8}$ (ii). $\pmatrix{3 & \;\;7 \\ 0 & 4}$ (iii). $C = \pmatrix{1 & 0 \\ 3 & 2}$.
 In this example we note that:
 matrix $A$ is a diagonal matrix (see Section 4.4) and has the property that all of its entries not on the main diagonal are $0$.
 matrix $B$ is an uppertriangular matrix (see Section 4.5) and has the property that all of its entries below the main diagonal are $0$
 matrix $C$ is a lowertriangular matrix (see Section 4.5) and has the property that all of its entries above the main diagonal are $0$.
Note that, in each case, some of the entries on the main diagonal can be zero.
Solution
 In all three cases – diagonal, uppertriangular and lower triangular  the eigenvalues are simply the entries on the main diagonal and so we can just read them off without the need for any calculations. Hence,
 The eigenvalues of matrix $A$ are: $\lambda_1 = 5,\; \lambda_2 = 8$.
 The eigenvalues of matrix $B$ are: $\lambda_1 = 3,\; \lambda_2 = 4$.
 The eigenvalues of matrix $C$ are: $\lambda_1 = 1, \; \lambda_2 = 2$.
We verify our answers using the method described earlier.
(i). Solving $\text{det}(A  \lambda I) = 0$ gives $\bigg  \matrix{5\lambda & \;\,0 \\ \;\,0 & 8\lambda} \bigg = 0 \implies (5\lambda)(8\lambda) = 0 \implies \lambda_1 = 5, \lambda_2 = 8$.
(ii). Solving $\text{det}(B  \lambda I) = 0$ gives $\bigg  \matrix{3\lambda & \;\,7 \\ \;\,0 & 4\lambda} \bigg = 0 \implies (3\lambda)(4\lambda) = 0 \implies \lambda_1 = 3, \lambda_2 = 4$.
(iii). Solving $\text{det}(C  \lambda I) = 0$ gives $\bigg  \matrix{1\lambda & \;\,0 \\ \;\,3 & 2\lambda} \bigg = 0 \implies (1\lambda)(2\lambda) = 0 \implies \lambda_1 = 1, \lambda_2 = 2$.
End of Example 328.1.2. Repeated eigenvalues
In the examples presented up to now the eigenvalues have been distinct but it is possible for a matrix to have repeated eigenvalues.
Example 33
Find the eigenvalues of the matrix, $A = \pmatrix{3 & 9 \\ 1 & \;\;\;9}$ .
Solution
To find the eigenvalues we solve
$\text{det}(A  \lambda I) = \bigg  \matrix{3\lambda & 9 \\ \;\;1 & 9\lambda} \bigg  = 0$
$(3  \lambda)(9  \lambda) + 9 = 0$
$\lambda^2  12\lambda + 36 = 0$
$(\lambda  6)(\lambda  6) + 0$
$\lambda = 6$ (repeated).
The eigenvalue $\lambda = 6$ is said to have algebraic multiplicity $2$, i.e. the number of times it is a root of the characteristic equation.
End of Example 338.1.3. Zero eigenvalues
We have previously noted that an eigenvector cannot be the zero vector, $0$, but it is possible to have an eigenvalue $\lambda = 0$ .
Example 34
Find the eigenvalues and eigenvectors of the matrix,
$A = \pmatrix{\;\;\;3 & 6 \\ 2 & \;\;\;4}$
Solution
To find the eigenvalues we need to solve
$\text{det}(A  \lambda I) = \bigg  \matrix{3\lambda & 6 \\ 2 & 4\lambda} \bigg  = 0$
$(3  \lambda)(4  \lambda)  12 = 0$
$\lambda^2  7 \lambda = 0$
$\lambda(\lambda  7) = 0$
$\lambda_1 = 0, \; \lambda_2 = 7$.
This example shows that it is possible for $0$ to be an eigenvalue of a matrix.
Note that if $0$ is an eigenvalue of a matrix then the matrix is not invertible. Hence, the matrix $A$ in this example cannot be inverted.
End of Example 348.1.4. Complex eigenvalues of real matrices
It is possible for a realvalued matrix to have complex eigenvalues (and eigenvectors) as illustrated by the following example.
Example 35
Find the eigenvalues of the matrices:
(i). $A = \pmatrix{0 & 1 \\ 1 & \;\;\;0}$ (ii). $B = \pmatrix{4 & 3 \\ 6 & 2}$.
Solution
(i). $\text{det}(A  \lambda I) = \bigg  \matrix{\lambda & 1 \\ 1 & \lambda} \bigg  = 0$
$\lambda^2 + 1 = 0$.
$\lambda_1 = j, \; \lambda_2 = j$.
(ii). $\text{det}(B  \lambda I) = \bigg  \matrix{4\lambda & 3 \\ 6 & 2\lambda} \bigg  = \lambda^2  2\lambda + 10 = 0$
Solve using the quadratic formula, or by completing the square, to obtain,
$\lambda_1 = 1 + 3j, \; \lambda_2 = 1  3j$.
Note: For a matrix with real entries its complex eigenvalues always occur in complex conjugate pairs.
End of Example 358.2. Calculation of eigenvectors
Once we have calculated the eigenvalues we can find the eigenvectors by solving the matrix equation
$A\boldsymbol{x} = \lambda \boldsymbol{x}$ (III)
or equivalently, as we saw above,
$(A  \lambda I)\boldsymbol{x} = \boldsymbol{0}$
for each eigenvalue in turn.
Now watch the following:
📹 Find Eigenvalues and Eigenvectors of a $2 \times 2$ Matrix
📹 Linear Algebra: Ch 3  Eigenvalues and Eigenvectors (4 of 35)
📹 Linear Algebra: Ch 3  Eigenvalues and Eigenvectors (5 of 35)
📹 Linear Algebra: Ch 3  Eigenvalues and Eigenvectors (6 of 35)
Example 36
Find the eigenvalues and eigenvectors of the matrix, $A = \pmatrix{\;\;\;2 & \;\;\;7 \\ 1 & 6}$.
Solution
First we find the eigenvalues by solving:
$\text{det}(A  \lambda I) = \bigg  \matrix{2\lambda & \;7 \\ 1 & 6\lambda} \bigg  = 0$
$(2  \lambda)(6  \lambda) + 7 = 0$
$\lambda^2 + 4 \lambda  5 = 0$
$(\lambda + 5)(\lambda  1) = 0$
$\lambda_1 = 5, \; \lambda_2 = 1$.
We now calculate the eigenvectors corresponding to the eigenvalues by solving Eq. (III).
Case 1: To find an eigenvector $\boldsymbol{x}_1$ corresponding to eigenvalue $\lambda_1 = 5$ we solve,
$A\;\boldsymbol{x}_1 = \lambda_1\;\boldsymbol{x}_1$.
$\pmatrix{\;\;\;2 & \;\;\;7 \\ 1 & 6}\pmatrix{x_1 \\ x_2} = 5 \pmatrix{x_1 \\ x_2}$
$\bigg \{ \array{2x_1 + 7x_2 = 5x_1 \\ x_1  6x_2 = 5x_2}$
$\bigg \{ \array{7x_1 + 7x_2 = 0 \; ........ \;(1) \\ x_1  x_2 = 0 \; ......... \;(2) }$
These are simultaneous equations and we note here that one equation will always be a multiple of the other  if not then you have made a mistake! Here Eq. (1) is $7$ times Eq. (2).
Both equations give $x_1 = x_2$. If we let $x_2 = \alpha$, say, for some nonzero real number $\alpha$, then $x_1 =  \alpha$ and we find the first eigenvector to be of the form
$\boldsymbol{x}_1 = \pmatrix{\alpha \\ \;\;\; \alpha} = \pmatrix{1 \\ \;\;\;1} \alpha$.
Note that there are infinitely many nonzero eigenvectors depending on the value chosen for $\alpha$. Setting $\alpha = 1$ gives an eigenvector corresponding to the eigenvalue $\lambda = 5$ as $\boldsymbol{x}_1 = \pmatrix{1 \\ \;\;\;1}$.
We can check our answer by showing that $A\;\boldsymbol{x}_1 = 5\;\boldsymbol{x}_1$.
$A \;\boldsymbol{x}_1 = \pmatrix{\;\;\;2 & \;\;\; 7 \\ 1 & 6}\pmatrix{1 \\ \;\;\; 1} = \pmatrix{\;\;\;5 \\ 5}$ and $\lambda_1\;\boldsymbol{x}_1 = 5 \pmatrix{1 \\ \;\;\;1} = \pmatrix{\;\;\;5 \\ 5}$.
Hence, $A\;\boldsymbol{x}_1 = \lambda_1 \; \boldsymbol{x}_1$ as required.
Case 2: To find an eigenvector $\boldsymbol{x}_2$ corresponding to eigenvalue $\lambda_2 = 1$ we solve,
$A\;\boldsymbol{x}_2 = \lambda_2\;\boldsymbol{x}_2$.
$\pmatrix{\;\;\;2 & \;\;\;7 \\ 1 & 6}\pmatrix{x_1 \\ x_2} = \pmatrix{x_1 \\ x_2}$
$\bigg \{ \array{2x_1 + 7x_2 = x_1 \\ x_1  6x_2 = x_2}$
$\bigg \{ \array{x_1 + 7x_2 = 0 \\ x_1  7x_2 = 0}$
Both these equations give $x_1 = 7x_2$. Let $x_2 = \alpha$, say, for some nonzero real number $\alpha$, then $x_1 = 7\alpha$ and so
$\boldsymbol{x}_2 = \pmatrix{7\alpha \\ \;\;\;\alpha} = \pmatrix{7 \\ \;\;\;1}\alpha$.
Setting $\alpha = 1$ gives $\boldsymbol{x}_2 = \pmatrix{7 \\ \;\;\;1}$. It is straightforward to check that $A\;\boldsymbol{x}_2 = 1\;\boldsymbol{x}_2$.
In summary, we therefore have the eigenvalue/eigenvector pairs,
$\lambda_1 = 5, \; \boldsymbol{x}_1 = \pmatrix{1 \\ \;\;\;1}$; $\lambda_2 = 1, \; \boldsymbol{x}_2 = \pmatrix{7 \\ \;\;\;1}$.
End of Example 36Example 37
Find the eigenvalues and eigenvectors of the matrix, $B = \pmatrix{\;13 & 4 \\ 4 & \;\;\; 7}$.
Solution
In Example 31 part (ii) we found the eigenvalues of $B$ to be $\lambda_1 = 5$ and $\lambda_2 = 15$.
We now calculate the eigenvectors corresponding to these eigenvalues by solving the eigenvector equation, $A\; \boldsymbol{x} = \lambda \; \boldsymbol{x}$.
Case 1: To find an eigenvector $\boldsymbol{x}_1$ corresponding to eigenvalue $\lambda_1 = 5$ we solve,
$A \;\boldsymbol{x}_1 = \lambda_1 \; \boldsymbol{x}_1$
$\pmatrix{\;13 & 4 \\ 4 & \;\;\;7}\pmatrix{x_1 \\ x_2} = 5\pmatrix{x_1 \\ x_2}$
$\bigg \{ \array{13x_1  4x_2 = 5x_1 \\ 4x_1 + 7x_2 = 5x_2}$
$\bigg \{ \array{8x_1  4x_2 = 0 \\ 4x_1 + 2x_2 = 0}$
Both these equations give $x_2 = 2x_1$.
Note that for a $2 \times 2$ system we do not actually need to introduce the parameter $\alpha$ as we did in the previous example. We can simply choose a convenient numerical value for either of the components $x_1$ or $x_2$ of the eigenvector. So here we can let $x_1 = 1$, say, giving $x_2 = 2$.
Thus an eigenvector corresponding to the eigenvalue $\lambda_1 = 5$ is $\boldsymbol{x}_1 = \pmatrix{1 \\ 2}$.
Case 2: To find an eigenvector $\boldsymbol{x}_2$ corresponding to eigenvalue $\lambda_2 = 15$ we solve,
$A \;\boldsymbol{x}_2 = \lambda_2 \; \boldsymbol{x}_2$
$\pmatrix{\;13 & 4 \\ 4 & \;\;\;7}\pmatrix{x_1 \\ x_2} = 15\pmatrix{x_1 \\ x_2}$
$\bigg \{ \array{13x_1  4x_2 = 15x_1 \\ 4x_1 + 7x_2 = 15x_2}$
$\bigg \{ \array{2x_1  4x_2 = 0 \\ 4x_1  8x_2 = 0}$
Both these equations give $x_1 = 2x_2$. Let $x_2 = 1$, say, giving $x_1 = 2$.
Then an eigenvector corresponding to the eigenvalue $\lambda_2 = 15$ is $\boldsymbol{x}_2 = \pmatrix{2 \\ 1}$.
In summary, we therefore have the eigenvalue/eigenvector pairs,
$\lambda_1 = 5, \; \boldsymbol{x}_1 = \pmatrix{1 \\ 2}$; $\lambda_2 = 15, \; \boldsymbol{x}_2 = \pmatrix{2 \\ \;\;\;1}$.
End of Example 37Example 38
Find the eigenvalues and eigenvectors of the matrix, $A = \pmatrix{\;\;\;3 & 6 \\ 2 & \;\;\;4}$.
Solution
To find the eigenvalues we need to solve
$\text{det}(A  \lambda I) = \bigg  \matrix{3  \lambda & 6 \\ 2 & 4  \lambda} \bigg  = 0$
$(3  \lambda)(4  \lambda)  12 = 0$
$\lambda^2  7\lambda = 0$
$\lambda(\lambda  7) = 0$
$\lambda_1 = 0, \; \lambda_2 = 7$
We now find the eigenvectors:
Case 1: To find an eigenvector $\boldsymbol{x}_1$ corresponding to eigenvalue $\lambda_1 = 0$ we solve, $A\,\boldsymbol{x}_1 = 0\,\boldsymbol{x}_1$.
$\pmatrix{\;\;\;3 & 6 \\ 2 & \;\;\; 4}\pmatrix{x_1 \\ x_2} = \pmatrix{0 \\ 0}$
$\bigg \{ \array{3x_1  6x_2 = 0 \\ 2x_1 + 4x_2 = 0}$.
Both these equations give $x_1 = 2x_2$. Let $x_2 = 1$, say, giving $x_1 = 2$.
Hence, an eigenvector corresponding to the eigenvalue $\lambda_1 = 0$ is $\boldsymbol{x}_1 = \pmatrix{2 \\ 1}$.
Case 2: To find an eigenvector $\boldsymbol{x}_2$ corresponding to eigenvalue $\lambda_2 = 7$, solve $A\,\boldsymbol{x}_2 = 7\,\boldsymbol{x}_2 $.
$\pmatrix{\;\;\;3 & 6 \\ 2 & \;\;\; 4}\pmatrix{x_1 \\ x_2} = 7\pmatrix{x_1 \\ x_2}$
$\bigg \{ \array{3x_1  6x_2 = 7x_1 \\ 2x_1 + 4x_2 = 7x_2}$.
$\bigg \{ \array{4x_1  6x_2 = 0 \\ 2x_1  3x_2 = 0}$.
Both these equations give $x_1 =  {\large\frac{3}{2}}x_2$. Let $x_2 = 2$, say, giving $x_1 =  3$.
Hence, an eigenvector corresponding to the eigenvalue $\lambda_2 = 7$ is $\boldsymbol{x}_2 = \pmatrix{3 \\ \;\;\;2}$.
To summarise we have:
$\lambda_1 = 0, \; \boldsymbol{x}_1 = \pmatrix{2 \\ 1}$; $\lambda_2 = 7, \; \boldsymbol{x}_2 = \pmatrix{3 \\ \;\;\;2}$.
End of Example 38Example 39
Find the eigenvectors of the matrix, $A = \pmatrix{0 & 1 \\ 1 & \;\;\;0}$.
Solution
In Example 35(i) we found that $A$ had complex eigenvalues, $\lambda_1 = j$ and $\lambda_2 =  j$.
If a matrix $A$ with real entries has a complex eigenvalue $\lambda$ then we know that its complex conjugate $\overline{\lambda}$ is also an eigenvalue of $A$. Furthermore, it can be shown that if $\boldsymbol{x}$ is an eigenvector corresponding to $\lambda$ then its complex conjugate $\overline{\boldsymbol{x}}$, formed by taking the complex conjugates of the entries of $\boldsymbol{x}$, is an eigenvector corresponding to $\overline{\lambda}$. We now use this result to find the eigenvectors of the matrix $A$.
Case 1: To find an eigenvector $\boldsymbol{x}_1$ corresponding to eigenvalue $\lambda_1 = j$ we solve
$A\,\boldsymbol{x}_1 = \lambda_1\,\boldsymbol{x}_1$.
$\pmatrix{0 & 1 \\ 1 & \;\;\; 0}\pmatrix{x_1 \\ x_2} = j\pmatrix{x_1 \\ x_2}$
$\bigg \{ \array{x_2 = j\,x_1 \\\;\; x_1 = j\,x_2}$.
If, for example, we multiply the first equation by $j$ both equations give $x_1 = j\,x_2$.
Let $x_2 = 1$, say, then $x_1 = j$.
An eigenvector corresponding to the eigenvalue $\lambda_1 = j$ will then be $\boldsymbol{x}_1 = \pmatrix{j \\ 1}$.
Case 2: To find an eigenvector $x_2$ corresponding to eigenvalue $\lambda_2 =  j$ simply take the complex conjugates of the entries of $\boldsymbol{x}_1$ giving, $\boldsymbol{x}_2 = \pmatrix{j \\ \;\;\;1}$.
To summarise we have:
$\lambda_1 = j, \; \boldsymbol{x}_1 = \pmatrix{j \\ 1}$; $\lambda_2 = j, \; \boldsymbol{x}_2 = \pmatrix{j \\ \;\;\;1}$.
End of Example 39 
9. Eigenvalues and eigenvectors of a $3 \times 3$ matrix
We now extend the methods presented in the previous section to calculation of eigenvalues and eigenvectors of $3 \times 3$ matrices. We shall only consider the case of real distinct eigenvalues but note that, as for $2 \times 2$ matrices, we can have eigenvalues that are repeated or complex.
Example 40
Determine the eigenvalues and eigenvectors of the matrix, $A = \pmatrix{\;\;\;1 & 0 & 2 \\ 7 & 2 & 4 \\ \;\;\;8 & 0 & 1}$
Solution
To calculate the eigenvalues we need to solve
\begin{align} \text{det}(A  \lambda I) = \left \begin{matrix} 1\lambda & 0 & 2 \\ 7 & 2\lambda & 4 \\ 8 & 0 & 1\lambda \end{matrix} \right = 0 \end{align}.
Here we will expand down Column 2 as it is the row/column with most zeroes.
$(2  \lambda) \bigg  \matrix{1\lambda & 2 \\ 8 & 1\lambda} \bigg  = 0$
$(2  \lambda)[(1  \lambda)(1\lambda)16] = 0$
$(2\lambda)[\lambda^2  2\lambda  15] = 0$
$(2  \lambda)(\lambda  5)(\lambda + 3) = 0$
Hence, $\lambda_1 = 2, \; \lambda_2 = 5$ and $\lambda_3 = 3$ are the eigenvalues of the matrix $A$.
Check: Sum of eigenvalues: $\lambda_1 + \lambda_2 + \lambda_3 = 2 + 5 + (3) = 4$.
Trace of matrix $A: \;\;tr(A) = 1 + 2 + 1 = 4$ as required.
We now calculate the eigenvectors corresponding to the eigenvalues.
Case 1: For an eigenvector $\boldsymbol{x}_1$, corresponding to eigenvalue $\lambda_1 = 2$, we solve $A\, \boldsymbol{x}_1 = 2\,\boldsymbol{x}_1$, i.e.
$\pmatrix{\;\;\;1 & 0 & 2 \\ 7 & 2 & 4 \\ \;\;\;8 & 0 & 1}\pmatrix{x_1 \\ x_2 \\ x_3} = 2 \pmatrix{x_1 \\ x_2 \\ x_3}$
$\Bigg \{ \matrix{\;x_1 \;\;\;\;\;\; &+& 2x_3 = 2x_1 \\ 7x_1 + 2x_2 &+& 4x_3 = 2x_2 \\ 8x_1 \;\;\;\;\;\; &+& \;\;x_3 = 2x_3}$
$\Bigg \{ \matrix{\;x_1\;\;\; & + & 2x_3 = 0 \\ 7x_1 & + & 4x_3 = 0 \\ \;\;\,8x_1 &  & \;\;x_3 = 0}$.
From the three equations the only possibility is that $x_1 = x_3 = 0$ . We can choose $x_2$ to have any value, $\alpha \neq 0$. Hence, an eigenvector corresponding to the eigenvalue $\lambda_1 = 2$ is of the form $ \boldsymbol{x}_1 = (0, \; \alpha, \; 0)^T $. For example, letting $\alpha = 1$ gives $\boldsymbol{x}_1 = (0, \; 1, \; 0)^T$.
Case 2: For an eigenvector $\boldsymbol{x}_2$, corresponding to eigenvalue $\lambda_2 = 5$, we solve $A\,\boldsymbol{x}_2 = 5\,\boldsymbol{x}_2$, i.e.
$\pmatrix{\;\;\;1 & 0 & 2 \\ 7 & 2 & 4 \\ \;\;\;8 & 0 & 1}\pmatrix{x_1 \\ x_2 \\ x_3} = 5 \pmatrix{x_1 \\ x_2 \\ x_3}$
$\Bigg \{ \matrix{\;x_1 \;\;\;\;\;\; &+& 2x_3 = 5x_1 \\ 7x_1 + 2x_2 &+& 4x_3 = 5x_2 \\ 8x_1 \;\;\;\;\;\; &+& \;\;x_3 = 5x_3}$
$\Bigg \{ \matrix{4x_1 \;\;\;\;\;\;\;\;\;\;& + & 2x_3 = 0 \;.........(1) \\ 7x_1  3x_2 & + & 4x_3 = 0\; .........(2) \\ \;\;\;8x_1 \;\;\;\;\;\;\;\;\;\; &  & 4x_3 = 0 \; ..........(3)}$.
Equations (1) and (3) both say that $x_3 = 2x_1$. Set $x_1 = \alpha \;\,(\alpha \neq 0)$ to obtain $x_3 = 2\alpha$. Substituting these values in Eq. (2) gives, $7\alpha  3x_2 + 8\alpha = 0 \Rightarrow 3x_2 = \alpha \Rightarrow x_2 = \alpha / 3$. Hence, an eigenvector corresponding to the eigenvalue $\lambda_2 = 5$ is of the form $\boldsymbol{x}_2 = (\alpha, \; \alpha/3, \; 2\alpha)^T$. Choosing $\alpha = 3$ gives $\boldsymbol{x}_2 = (3, \; 1, \; 6)^T$.
Case 3: For an eigenvector $\boldsymbol{x}_3$, corresponding to eigenvalue $\lambda_3 =  3$, solve $A\,\boldsymbol{x}_3 =  3\, \boldsymbol{x}_3$, i.e.
$\pmatrix{\;\;\;1 & 0 & 2 \\ 7 & 2 & 4 \\ \;\;\;8 & 0 & 1}\pmatrix{x_1 \\ x_2 \\ x_3} = 3 \pmatrix{x_1 \\ x_2 \\ x_3}$
$\Bigg \{ \matrix{\;x_1 \;\;\;\;\;\; &+& 2x_3 = 3x_1 \\ 7x_1 + 2x_2 &+& 4x_3 = 3x_2 \\ 8x_1 \;\;\;\;\;\; &+& \;\;x_3 = 3x_3}$
$\Bigg \{ \matrix{4x_1\;\;\;\;\;\;\; & + & 2x_3 = 0 \; .........(1) \\ 7x_1 + 5x_2 & + & 4x_3 = 0\; .........(2) \\ 8x_1 \;\;\;\;\;\;\;& + & 4x_3 = 0\; .........(3)}$.
Equations (1) and (3) both say that $x_3 = 2x_1$. Set $x_1 = \alpha \;\, (\alpha \neq 0)$ to obtain $x_3 = 2\alpha$. Substituting these values in Eq. (2) gives, $7\alpha + 5x_2  8\alpha = 0 \Rightarrow 5x_2 = 15\alpha \Rightarrow x_2 = 3\alpha$. Hence, an eigenvector corresponding to the eigenvalue $\lambda_3 = 3$ is of the form $\boldsymbol{x}_3 = (\alpha, \; 3\alpha, \; 2\alpha)^T$. Choosing $\alpha = 1$ gives $\boldsymbol{x}_3 = (1, \; 3, \; 2)^T$.
In summary, we therefore have,
$\lambda_1 = 2, \; \boldsymbol{x}_1 = \pmatrix{0 \\ 1 \\ 0}$; $\lambda_2 = 5, \; \boldsymbol{x}_2 = \pmatrix{3 \\ 1 \\ 6}$;$\lambda_3 = 3, \; \boldsymbol{x}_3 = \pmatrix{\;\;\;1 \\ \;\;\;3 \\ 2}$.
End of Example 40 
10. Some properties of eigenvalues and eigenvectors
 Let $A$ be a real $n \times n$ matrix.
 $A$ will have exactly $n$ eigenvalues which may be repeated and will be real or occur in complex conjugate pairs.
 An eigenvalue can be zero but an eigenvector cannot be the zero vector, $\mathbf{0}$.
 The sum of the eigenvalues of $A$ equals the sum of the main diagonal entries of $A$, i.e. the trace of $A$.
 The product of the eigenvalues of $A$ equals the determinant of $A$.
 If $0$ is an eigenvalue of $A$ then $A$ is not invertible.
 If $\lambda$ is an eigenvalue of an invertible matrix $A$, with $\boldsymbol{x}$ as a corresponding eigenvector, then ${\Large\frac{1}{\lambda}}$ is an eigenvalue of $A^{1}$, again with $\boldsymbol{x}$ as a corresponding eigenvector.
 If $\lambda$ is an eigenvalue of $A$, with $\boldsymbol{x}$ as a corresponding eigenvector, then $\lambda^k$ is an eigenvalue of $A^k$, again with $\boldsymbol{x}$ as a corresponding eigenvector, for any positive integer $k$.
 The matrix $A$ and its transpose, $A^T$, have the same eigenvalues but there is no simple relationship between their eigenvectors.
Procedure for calculating eigenvalues and eigenvectors
To calculate the eigenvalues and eigenvectors of a $n \times n$ matrix $A$ we proceed as follows:
1. Calculate the determinant of the matrix $A  \lambda I$, it will be a polynomial in $\lambda$ of degree $n$.
2. Find the roots of the polynomial by solving $\text{det}(A  \lambda I) = 0$. The $n$ roots of the polynomial are the eigenvalues of the matrix $A$.
3. For each eigenvalue, $\lambda$, solve $A \boldsymbol{x} = \lambda\boldsymbol{x}$ to find an eigenvector $\boldsymbol{x}$.

Summary
 On completion of this unit you should be able to:
 perform basic matrix arithmetic including addition, subtraction and scalar multiplication.
 determine whether matrices are conformable for matrix multiplication and carry out matrix multiplication where appropriate.
 calculate the determinant and inverse (where it exists) for $2 \times 2$ and $3 \times 3$ matrices.
 apply matrix methods to solve systems of linear equations.
 calculate eigenvalues and eigenvectors for $2 \times 2$ and $3 \times 3$ matrices.