You are on page 1of 12

7 Matrices

7.1 Introduction
Definition. A m × n matrix is a rectangular array of numbers having m
rows and n columns.
 
a11 a12 . . . a1n
 a21 a22 . . . a2n 
 
 a31 a32 . . . a3n 
A=
 .

 . . . 

 . . . . 
am1 am2 . . . amn

The element aij represents the entry in the ith row and jth column. We
sometimes denote A by (aij )m×n .

7.2 Matrix Operations


Addition
We can only add two matrices of the same dimension i.e. same number of
rows and columns. We then add element-wise.

Example.      
2 1 4 3 6 4
+ = .
1 3 5 6 6 9

Scalar Multiplication
If c is a real number and A = (aij )m×n is a matrix then cA = (caij )m×n .

Example.    
2 1 10 5
5 = .
1 3 5 15

Matrix Multiplication
Given a matrix A = (aij )m×n and a matrix B = (bij )r×s , we can only multiply
them if n = r. In such a case the multiplication is defined to be the matrix
C = (cij )m×s as follows:
n
X
cij = aik bkj .
k=1

We may view the cij th element as the dot product of the ith row of the
matrix A and jth column of the matrix B.

Example. 1.
    
2 1 4 3 (2)(4) + (1)(5) (2)(3) + (1)(6)
=
1 3 5 6 (1)(4) + (3)(5) (1)(3) + (3)(6)
 
13 12
= .
19 21
    
1 2 3 2 0 0 4 12 4
2.  2 1 0   1 3 2  =  5 3 2 
0 3 1 0 2 0 3 11 6
7.3 Special matrices
(a) A matrix is called a square matrix if the number of rows is equal to the
number of columns.

(b) The transpose of a square matrix A = (aij ) is the matrix AT = (aji ).


The rows of A become the columns of AT .
 
1 2 3
Example. The transpose of A =  2 1 0  is
0 3 1
 
1 2 0
AT =  2 1 3  .
3 0 1

(c) A square matrix is said to be symmetric if A = AT , i.e. aij = aji , ∀i, j.

(d) A square matrix is said to be a diagonal matrix, if all the non-diagonal


elements in the matrix are zero.
 
3 0 0
e.g.  0 −4 0  .
0 0 1

(e) A square matrix is said to be the identity matrix, if it is a diagonal


matrix and all the non-zero elements are 1.
 
1 0 0
e.g.  0 1 0  .
0 0 1

The identity marix has the property that

AI = A = IA

for all square matrices A.


7.4 Determinants
Definition. The determinant of a 2 × 2 matrix is defined as follows:

a b
c d = ad − bc.

Definition. The determinant of a 3 × 3 matrix is defined as follows:



a11 a12 a13
a21 a22 a23 = a11 a22 a23 − a12 a21 a23 + a13 a21 a22

a32 a33 a31 a33 a31 a33
a31 a32 a33
= a11 (a22 a33 − a32 a23 ) − a12 (a21 a33 − a31 a23 ) + a13 (a21 a32 − a31 a22 )

Definition. The definition of determinants can be generalized for a square


matrix of any size. Let A = (aij ) be a square n × n matrix. Fix a row i.
Then the determinant is defined to be,
n
X
det (A) = (−1)i+j aij det (Aij ),
j=1

where Aij is the minor matrix obtained by deleting row i and column j. It is
called the ij Cof actor of A. T

Example. Find the determinant of


 
1 1 0 −1
 0 −1 1 4 
A=  0 0
.
2 2 
1 0 1 2
Choose row i = 1.
 
−1 1 4
A11 =  0 2 2 
0 1 2
det (A11 ) = −2
 
0 1 4
A12 = 0 2 2 
1 1 2
det (A11 ) = −6
 
0 −1 4
A13 = 0 0 2 
1 0 2
det (A11 ) = −2
 
0 −1 1
A14 = 0 0 2 
1 0 1
det (A11 ) = − 2
X n
det (A) = (−1)1+j a1j det (A1j )
j=1

= (−1)2 (1)det (A11 ) + (−1)3 (1)det (A12 ) + (−1)4 (0)det (A13 ) + (−1)5 (−1)det (A14 )
= (1)(1)(−2) + (−1)(1)(−6) + (1)(0)(−2) + (−1)(−1)(−2)
=2
7.5 Inverses
Definition. A matrix I which has 1’s on the diagonal and 0’s everywhere
else is called the identity matrix. This matrix has the property that AI = A.
 
1 0
Example. 1. A 2 × 2 identity matrix has the form I = .
0 1
 
1 0 0
2. A 3 × 3 identity matrix has the form I =  0 1 0 .
0 0 1
Definition. Let A = (aij ) be a square matrix. A matrix B = (bij ) is called
the inverse of A if
AB = BA = I.
Remark. A matrix A has an inverse if and only if det(A) 6= 0.

Inverse of a 2 × 2 matrix
 
a b
Definition. The inverse of a 2 × 2 matrix, A = is given by,
c d
 
−1 1 d −b
A = .
−c a
ad − bc
 
1 1
Example. Find the inverse of the matrix A = .
1 2
Solution: We first check that the inverse of A exists!
det(A) = (1)(2) − (1)(1) = 1 6= 0.
Hence the inverse of A must exist and is given by
 
−1 1 2 −1
A = .
1 −1 1
We check that this is correct by multiplying A−1 A to see if we get the
identity matrix.
    
2 −1 1 1 (2)(1) + (−1)(1) (1)(1) + (−1)(2)
=
−1 1 1 2 (−1)(1) + (1)(2) (−1)(1) + (1)(2)
 
1 0
= .
0 1
We can find the inverse in another way: Write as (A|I2 )
 
1 1 1 0
.
1 2 0 1

Then use matrix row operations to get it into the form (I2 |B).
 
1 0 a b
.
0 1 c d

You will find that B = A−1 .


     
1 1 1 0 R2 =R2 −R1 1 1 1 0 R1 =R1 −R2 1 0 2 −1
→ →
1 2 0 1 0 1 −1 1 0 1 −1 1

Observe that the matrix obtained


   
a b 2 −1
=
c d −1 1

is the inverse of A.

Inverse of a 3 × 3 matrix
The method is the same as in the 2 × 2 case:
• Check determinant A is non-zero.

• Rewrite as (A|I3 ).

• Use row operations to put in the form (I3 |A−1 ).


 
1 −1 1
Example. Let A =  0 −2 1 . Find A−1 .
−2 −3 0
1. Check that det(A) 6= 0.

det(A) = 1(0 − (−3)(1)) − (−1)(0 − (−2)(1)) + 1(0 − (−2)(−2))


= 3+2−4
= 1 6= 0

Therefore the inverse exists.


2. Rewrite as (A|I3 ).  
1 −1 1 1 0 0
 0 −2 1 0 1 0  .
−2 −3 0 0 0 1

3. Use row operations to put in the form (I3 |A−1 ).


   
1 −1 1 1 0 0 1 −1 1 1 0 0
 0 −2 1 0 1 0  R3 =R→ 3 +2R1
 0 −2 1 0 1 0 
−2 −3 0 0 0 1 0 −5 2 2 0 1
 
−1
R2 = 2 R2
1 −1 1 1 0 0
→  0 1 −1/2 0 −1/2 0 
0 −5 2 2 0 1
 
1 −1 1 1 0 0
R3 =R3 +5R2
→  0 1 −1/2 0 −1/2 0 
0 0 −1/2 2 −5/2 1
 
1 −1 1 1 0 0
R3 =−2R3
→  0 1 −1/2 0 −1/2 0 
0 0 1 −4 5 −2
 
R2 =R2 + 12 R3
1 −1 1 1 0 0
→  0 1 0 −2 2 −1 
0 0 1 −4 5 −2
 
1 −1 0 5 −5 2
R1 =R1 −R3
→  0 1 0 −2 2 −1 
0 0 1 −4 5 −2
 
1 0 0 3 −3 1
R1 =R1 +R2
→  0 1 0 −2 2 −1 
0 0 1 −4 5 −2

4.  
3 −3 1
A−1 =  −2 2 −1  .
−4 5 −2
8 Eigenvalues and Eigenvectors and Diago-
nalization
8.1 Introduction
Definition. Suppose that A is an n × n square matrix. Suppose also that
~x is a non-zero vector in Rn and that λ is a scalar so that,
A~x = λ~x.
We then call ~x an eigenvector of A and λ an eigenvalue of A.
 
4 2
Example. Suppose A = .
  1 3
2
Then is an eigenvector associated to the eigenvalue 5 because
1
    
4 2 2 2
A~x = =5 = 5~x.
1 3 1 1
 
−1
Also is an eigenvector associated to the eigenvalue 2 because
1
    
4 2 −1 −1
A~x = =2 = 2~x.
1 3 1 1
In this chapter we will learn how to find these eigenvalues and eigenvec-
tors.

8.2 Method to find eigenvalues and eigenvectors


We start with A~x = λ~x and rewrite it as follows,
A~x = λI~x
λI~x − A~x = 0
(λI − A)~x = 0

Theorem λ is an eigenvalue of A if and only if λI − A is not invertible if


and only if det (λI − A) = 0.
Steps to find eigenvalues and eigenvectors:
1. Form the characteristic equation
det(λI − A) = 0.

2. To find all the eigenvalues of A, solve the characteristic equation.


3. For each eigenvalue λ, to find the corresponding set of eigenvectors,
solve the linear system of equations
(λI − A)~x = 0
 
4 2
Example. 1. A = . Find the eigenvalues and eigenvectors of A.
1 3
Solution: • We will find the characteristic equation of A. We will
first find the matrix λI − A.
   
1 0 4 2
λI − A = λ −
0 1 1 3
   
λ 0 4 2
= −
0 λ 1 3
 
λ−4 2
=
1 λ−3
The determinant of this matrix gives us the characteristic polyno-
mial.
det(λI − A) = 0

λ−4 2
= 0
1 λ−3
(λ − 4)(λ − 3) − 2 = 0
λ2 − 7λ + 12 − 2 = 0
λ2 − 7λ + 10 = 0

• To find all the eigenvalues of A, solve the characteristic equation.


λ2 − 7λ + 10 = 0
(λ − 5)(λ − 2) = 0
So we have two eigenvalues λ1 = 2, λ2 = 5.
• For each eigenvalue λ, to find the corresponding set of eigenvectors,
we simply solve the linear system of equations given by,
(λI − A)~x = 0.
case(i) λ1 = 2.
(2I − A)~x = 0
    
2 − 4 −2 x1 0
=
−1 2 − 3 x2 0
    
−2 −2 x1 0
=
−1 −1 x2 0
   
−2x1 − 2x2 0
=
−x1 − x2 0
We get two equations:
2x1 + 2x2 = 0
x1 + x2 = 0
Both equations give the relation x1 = −x2 . Therefore the set of
eigenvectors corresponding to λ = 2 is given by:
 
x1
{ |x1 = −x2 }
x2
 
−x2
{ }
x2
 
−1
{ x2 |x2 is a real number.}
1
 
−1
An eigenvector corresponding to λ1 = 2 is .
1
case(i) λ2 = 5.
(5I − A)~x = 0
    
5 − 4 −2 x1 0
=
−1 5 − 3 x2 0
    
1 −2 x1 0
=
−1 2 x2 0
   
x1 − 2x2 0
=
−x1 + 2x2 0
We get two equations:

x1 − 2x2 = 0
−x1 + 2x2 = 0

Both equations give the relation x1 = 2x2 . Therefore a general


eigenvector corresponding to λ2 = 2 is,
 
x1
{ |x1 = 2x2 }
x2
 
2x2
{ }
x2
 
2
{ x2 |x2 is a real number.}
1
 
2
An eigenvector corresponding to λ2 = 5 is .
1

You might also like