You are on page 1of 41

Chapter 2.

Matrix Algebra

ThienNV

February 28, 2021

ThienNV Chapter 2. Matrix Algebra February 28, 2021 1 / 41


Matrix Addition, Scalar Multiplication, Transposition

Definition
An m × n matrix A is an array of m row and n column:
 
a11 a12 · · · a1n
 a21 a22 · · · a2n 
A= .
 
.. .. 
 .. . ··· . 
am1 am2 · · · amn

The (i, j)-entry of A is the number lying simultaneously in row i and


column j.

Example
 
1 2 3 4 This is a 3 × 4 matrix.
A = 5 6 7 8  The (2, 3)-entry of A is 7.
9 10 11 12

ThienNV Chapter 2. Matrix Algebra February 28, 2021 2 / 41


Matrix Addition, Scalar Multiplication, Transposition

Definition
An m × m matrix is called a square matrix of size m.
The zero matrix of size m × n, denoted by 0m×n is the matrix that its
all entries are 0.
If A = [aij ] is an m × n matrix then −A the negative matrix of A and
defined by −A = [−aij ].

Definition
An identity matrix In is a square matrix with 1s on the main diagonal and
zeros elsewhere.

For example,
 
  1 0 0
1 0
I2 = I3 = 0 1 0
0 1
0 0 1

ThienNV Chapter 2. Matrix Algebra February 28, 2021 3 / 41


Matrix Addition, Scalar Multiplication, Transposition

Let A = [aij ], B = [bij ] be two m × n matrices and k be a real numbers.


Definition
Addition A + B = [aij + bij ]m×n .
Scalar multiplication kA = [kaij ]m×n .

Example
     
−2 3 5 1 0 −2 −5 6 12
2 0 4 2 − −2 1 1 = 2 7 3
1 −1 6 4 −1 3 −2 −1 9

ThienNV Chapter 2. Matrix Algebra February 28, 2021 4 / 41


Matrix Addition, Scalar Multiplication, Transposition

Properties

For all m × n matrices A, B, C and all k, h ∈ R,


A+B =B +A
A + (−A) = 0 (zero matrix of size m × n)
(A + B) + C = A + (B + C )
k(hA) = (kh)A
(k + h)A = kA + hA
k(A + B) = kA + kB

ThienNV Chapter 2. Matrix Algebra February 28, 2021 5 / 41


Matrix Addition, Scalar Multiplication, Transposition

Definition
Let A be m × n matrix. The transpose of A, written AT = [aji ] is an
n × m matrix.

Example
 
 T 1 4
1 2 3
= 2 5
4 5 6
3 6

Properties:
T
AT =A
(A + B)T = AT + B T
(kA)T = kAT

ThienNV Chapter 2. Matrix Algebra February 28, 2021 6 / 41


Matrix Addition, Scalar Multiplication, Transposition

Example
Find the (2, 1)-entry of the matrix A that satisfies
  T  
T 1 0 1 2
2A − 3 = 4A − 7
−2 2 −2 0

Answer: We have

  
3 −6 7 14
2A − = 4A −
0 6 −14 0

Hence  
4 20
2A =
−14 −6
Thus, (2, 1)-entry of A is −14/2 = −7.

ThienNV Chapter 2. Matrix Algebra February 28, 2021 7 / 41


Matrix Addition, Scalar Multiplication, Transposition

Symmetric matrix

Definition
A matrix A is symmetric if AT = A (it means that (i, j)-entry of A =
(j, i)-entry of A)

Example
 
2 3 1  
3 −1 5 is symmetric. 1 2
is not symmetric.
−2 4
1 5 6

Properties
Am×m and Bm×m are symmetric ⇒ kA + hB is symmetric, for all k, h ∈ R.

ThienNV Chapter 2. Matrix Algebra February 28, 2021 8 / 41


Matrix Addition, Scalar Multiplication, Transposition

Example
Determine a and b such that the following matrix is symmetric.
 
−3 a + b 8
7 5 −1
8 a − b ab

Answer: Find a, b such that


(
a+b =7
⇒ a = 3, b = 4
a − b = −1

ThienNV Chapter 2. Matrix Algebra February 28, 2021 9 / 41


Multiplication

Definition (Dot product)



b1
  b2 
 
a1 a2 · · · am ×  .  = a1 b1 + a2 b2 + · · · + am bm
 .. 
bm

Definition
Let Am×n , Bn×p be two matrices. The multiplication of A and B

AB = [cij ]m×p ,

where cij is the dot product of i th row of A and j th column of B.

ThienNV Chapter 2. Matrix Algebra February 28, 2021 10 / 41


Multiplication

Example
 
  1 0 −1 5  
1 2 −3  −7 −10 7 20
−1 1 4 6 =
−2 3 −1 −7 −1 14 9
2 4 0 −1

Example
   
1 0 −2 2 1 1
Let A = −2 1 1  and B = 4 −3 2.
3 2 −2 0 −1 3
T
Find (2, 1)-entry of AB − B A.
Answer:
The (2, 1)-entry of AB is the dot product of the second row of A and
the first column of B and equal to −2 ∗ 2 + 1 ∗ 4 + 1 ∗ 0 = 0.
The (2, 1)-entry of B T A is the dot product of the second column of
B and the first column of A, is 1 ∗ 1 + (−3) ∗ (−2) + (−1) ∗ 3 = 4.
Hence (2, 1)-entry of AB − B T A is 0 − 4 = −4.
ThienNV Chapter 2. Matrix Algebra February 28, 2021 11 / 41
Multiplication

Example
Find the second entry of the first row of the matrix A that satisfies
 
1 3
T
AT − 1 −1 2
   
1 2 = 2 4 
3 6

Answer: We have
         
1  1 3 1 2 1 3 2 5
AT = −1 1 2 + 2 4 = −1 −2 + 2 4 = 1 2 


2 3 6 2 4 3 6 5 10

Hence the second entry of the first row of the matrix A is 1.

ThienNV Chapter 2. Matrix Algebra February 28, 2021 12 / 41


Multiplication

Properties
A(BC ) = (AB)C , for Am×n , Bn×p , Cp×q
A(B + C ) = AB + AC , for Am×n , Bn×p , Cn×p
(A + B)C = AC + BC , for Am×n , Bm×n , Cn×p
AIm = Im A = A, for Am×m
(AB)T = B T AT
In general, AB 6= BA

Example
         
1 2 −1 0 1 2 −1 0 1 2 −1 −2
= 6 = =
2 3 1 1 1 3 1 1 2 3 3 5

Definition
We say A and B are commute if AB = BA.
ThienNV Chapter 2. Matrix Algebra February 28, 2021 13 / 41
Multiplication

Quiz
Decide the following statements are True or False.
(a) If AB = 0 then either A = 0 or B = 0, (where 0 is zero matrix). F
(b) (A + B)(A − B) = A2 − B 2 . F
(c) If A2 can be formed then A must be square matrix. T
(d) If A is symmetric and square, then A2 is symmetric. T
(e) If A is square then AAT is symmetric. T
(f) If AB and BA can be formed then A and B must be square matrices.
F
(g) If A, B are symmetric matrices of the same size, then A + B is
symmetric. T
(h) If A, B are symmetric matrices of the same size, then AB is
symmetric. F
(i) Let A is 3 × 5 matrix and B is 6 × 7 matrix, and ACB can be
performed. What is the size of C ? 5 × 6
ThienNV Chapter 2. Matrix Algebra February 28, 2021 14 / 41
Multiplication

Multiplication matrix with system


A system of m linear equations and n variables:



 a11 x1 + a12 x2 + · · · + a1n xn = b1

a x + a x + · · · + a x = b
21 1 22 2 2n n 2


 · · ·

a x + a x + · · · + a x = b
m1 1 m2 2 mn n m

can be rewritten in the matrix form

AX = b,
   
x1 b1
 x2   b2 
where X = 
· · · is the variables, b = · · · and A is the coefficient
  

xn bn
matrix.
ThienNV Chapter 2. Matrix Algebra February 28, 2021 15 / 41
Multiplication

Example
The system of linear equations

2x + 3y − 5z = 9
−x − 2y + 4z = 11

can be written in the matrix form


 
  x  
2 3 −5   9
y =
−1 −2 4 11
z

ThienNV Chapter 2. Matrix Algebra February 28, 2021 16 / 41


Matrix Inverse

Let A be a square n × n matrix.


Definition
A matrix B is called an inverse of A if and only if

AB = I and BA = I

A matrix A that has an inverse is called an invertible matrix

ThienNV Chapter 2. Matrix Algebra February 28, 2021 17 / 41


Matrix Inverse

Example
 
2 1
Find the inverse matrix of A = .
0 1
 
x y
Answer: Say B = . We have
z t
      
2 1 x y 2x + z 2y + t 1 0
AB = = = I2 =
0 1 z t z t 0 1

This is equivalent to

2x + z =1 x = 1/2
2y + t =0 y = −1/2
⇔ .
z =0 z =0
t =1 t =1
 
1/2 −1/2
Hence A−1 = .
0 1
ThienNV Chapter 2. Matrix Algebra February 28, 2021 18 / 41
Matrix Inverse

Example
 
1 −2
Show that A = is not invertible.
−1 2
 
x y
Answer: Say B = . We have
z t
      
1 −2 x y x − 2z y − 2t 1 0
AB = = = I2 = .
−1 2 z t −x + 2z −y + 2t 0 1

This is equivalent to

x − 2z =1
y − 2t =0
−x + 2z =0
−y + 2t =1

This system has no solution. Hence, A is not invertible.

ThienNV Chapter 2. Matrix Algebra February 28, 2021 19 / 41


Matrix Inverse

Theorem
 
a b
Let A = . Then A is invertible if det(A) = ad − bc 6= 0 and
c d
 
−1 1 d −b
A =
ad − bc −c a

Example
 −1    
3 1 1 4 −1 0.4 −0.1
= =
2 4 10 −2 3 −0.2 0.3

ThienNV Chapter 2. Matrix Algebra February 28, 2021 20 / 41


Matrix Inverse

Properties

(AB)−1 = B −1 A−1 , for any invertible matrices A, B.


I −1 = I .
 k −1 k
A = A−1 .
(aA)−1 = 1/aA−1 .
−1 T
AT = A−1 .

ThienNV Chapter 2. Matrix Algebra February 28, 2021 21 / 41


Matrix Inverse

Find (2, 1)-entry of the matrix A such that


 
−1 −1 3 4
(2A + I ) = .
5 7

Answer: We have
 −1  
−1 3 4 1 7 −4
2A +I = = .
5 7 3 ∗ 7 − 4 ∗ 5 −5 3

Hence
     
−1 7 −4 1 0 6 −4
2A = − = .
−5 3 0 1 −5 2
 −1    
3 −2 1 1 2 −1/2 −1
⇒A= = = .
−5/2 1 3 ∗ 1 − (−2) ∗ (− 52 ) 5/2 3 −5/4 −3/2

Thus, the (2,1)-entry of A is −5/4.

ThienNV Chapter 2. Matrix Algebra February 28, 2021 22 / 41


Matrix Inverse

Find the first entry of the second row of the matrix A that satisfies:
  −1  
1 1 1 2
A = .
1 0 0 −1

Answer: We have
   −1    
1 1 1 2 1 −1 −2 1 2
A= = = .
1 0 0 −1 1 ∗ (−1) − 0 ∗ 2 0 1 0 −1

Hence,
 −1     
1 1 1 2 1 0 −1 1 2
A= =
1 0 0 −1 −1 −1 1 0 −1
  
0 1 1 2
=
1 −1 0 −1

The first entry of the second row of the matrix A is 1 ∗ 1 + (−1) ∗ 0 = 1.


ThienNV Chapter 2. Matrix Algebra February 28, 2021 23 / 41
Matrix Inverse

Matrix inverse algorithm

If A is an invertible matrix, there exists a sequence of elementary row


operations (except interchanging two rows) that

[A|I ] → [I |A−1 ]

where the row operations on A and I are carried out simultaneously.

ThienNV Chapter 2. Matrix Algebra February 28, 2021 24 / 41


Matrix Inverse

Example
   
1 2 0 1 0 0 1 2 0 1 0 0
−R1 +R3
 0 2 3 0 1 0 − −−−−→ 0 2 3 0
 1 0 
1 3 1 0 0 1 0 1 1 −1 0 1
 
1 2 0 1 0 0
1/2R2
−−−−−−−→  0 1 3/2 0 1/2 0 
−1/2R2 +R3
0 0 −1/2 −1 −1/2 1
 
1 2 0 1 0 0
−2R3
−−−−− →  0 1 0 −3 −1 3 
3R3 +R2
0 0 1 2 1 −2
   −1  
1 0 0 7 2 −6 1 2 0 7 2 −6
−2R2 +R1
−−−−−−→ 0 1 0 −3 −1 3
  ⇒ 0 2
 3 = −3 −1 3 
0 0 1 2 1 −2 1 3 1 2 1 −2

ThienNV Chapter 2. Matrix Algebra February 28, 2021 25 / 41


Linear Transformations

Matrix transformation
Definition
Let A be m × n matrix. The transformation TA : Rn × Rm defined by

TA (x) = Ax

is called the matrix transformation induced by A.

Example
 
1 2 3
Let A = . Then the matrix transformation induced by A is
2 −1 4

TA : R3 → R2 defined by
   
x   x  
1 2 3 x + 2y + 3z
TA y  = y  = .
2 −1 4 2x − y + 4z
z z
ThienNV Chapter 2. Matrix Algebra February 28, 2021 26 / 41
Linear Transformations

Example
Consider a transformation

T : R2 → R3 given by
 
  x − 3y
x
T =  5y  .
y
−x + 6y
 
1 −3
Then T is a matrix transformation induced by A =  0 5 .
−1 6

ThienNV Chapter 2. Matrix Algebra February 28, 2021 27 / 41


Linear Transformations

Definition
A transformation T : Rn → Rm is called a linear transformation if it
satisfies the following two conditions for all vectors x and y in Rn and all
scalars a ∈ R:
(1) T (x + y ) = T (x) + T (y )
(2) T (ax) = aT (x).

Note.
1. If T is a linear transformation, then T (0) = 0 ( T preserves the zero
vector).
2. The conditions (1) and (2) are equivalent to

T (ax + by ) = aT (x) + bT (y ), for all x, y ∈ Rn ; a, b ∈ R.

ThienNV Chapter 2. Matrix Algebra February 28, 2021 28 / 41


Linear Transformations

Example
T : R2 → R2 given by T (x, y ) = (x, x + y ) is a linear transformation.
Indeed,
   0 
x + x0 x + x0
   
x x
(1) T + 0 =T =
y y y + y0 x + x0 + y + y0
x0
       0 
x x x
= + 0 =T +T .
x +y x + y0 y y0
          
x ax ax x x
(2) T a =T = =a = aT .
y ay ax + ay x +y y

Example
T : R2 → R3 given by T (x, y ) = (x − y , 0, y 2 ) is not a linear
transformation since
     
     0   0 0
1 2 1
T 2 =T = 0 6= 2T = 2 0 = 0
1 2 1
4 1 2
ThienNV Chapter 2. Matrix Algebra February 28, 2021 29 / 41
Linear Transformations

Theorem
If T : Rn → Rm is a linear transformation, then for each k = 1, 2, . . . :

T (a1 x1 + a2 x2 + · · · + ak xk ) = a1 T (x1 ) + a2 T (x2 ) + · · · + ak T (xk ),

for all scalars ai and all vectors xi in Rn .

Example
Let T : R2 → R2 be a linear transformation, and assume that
         
2 2 −1 4 0
T = and T = . Find T .
3 5 1 −3 5
      (
0 2 −1 a=1
Answer: Find a, b: =a +b . Solve this system : .
5 3 1 b=2
           
0 2 −1 2 4 10
Hence T = 1T + 2T = +2 = .
5 3 1 5 −3 −1

ThienNV Chapter 2. Matrix Algebra February 28, 2021 30 / 41


Linear Transformations

Example
Let T : R2 → R be a linear transformation and u, v be vectors such that
T (u + v ) = 1 and T (u − v ) = 5. Find T (−u + 2v ).
Answer: We have
( (
T (u + v ) = T (u) + T (v ) = 1 T (u) = 3
⇒ .
T (u − v ) = T (u) − T (v ) = 5 T (v ) = −2

Hence

T (−u + 2v ) = −T (u) + 2T (v ) = −3 + 2.(−2) = −7.

ThienNV Chapter 2. Matrix Algebra February 28, 2021 31 / 41


Linear Transformations

Theorem
Let T : Rn → Rm be a transformation. Then T is linear if and only if it is
a matrix transformation induced by an m × n matrix A, given in terms of
its columns by  
A = T (e1 ) T (e2 ) · · · T (en )
where {e1 , e2 , · · · , en } is the standard basis of Rn .

Example
   
x 2x − 3y
Consider a linear transformation T : → T R2= R2 : .
y x + 4y
Then T is also a matrix transformation induced by
      
  1 0 2 −3
A = T (e1 ) T (e2 ) = T T = .
0 1 1 4
        
x x 2 −3 x 2x − 3y
We can see that T =A = = .
y y 1 4 y x + 4y
ThienNV Chapter 2. Matrix Algebra February 28, 2021 32 / 41
Linear Transformations

Rotation

Given an angle θ, let

R θ : R2 → R2

denote counterclockwise rotation of


R2 about the origin through the angle
θ.

Then Rθ is a linear transformation in-


duced by matrix
 
  cos θ − sin θ
Rθ (e1 ) Rθ (e2 ) = .
sin θ cos θ

ThienNV Chapter 2. Matrix Algebra February 28, 2021 33 / 41


Linear Transformations

Reflection

The line through the origin with slope


m has equation y = mx, and we let
Qm : R2 → R2 denote reflection in the
line y = mx.

Then Qm is a linear transformation induced by matrix

1 − m2
 
1 2m
.
1 + m2 2m m2 − 1

ThienNV Chapter 2. Matrix Algebra February 28, 2021 34 / 41


Linear Transformations

Projection

Let Pm : R2 → R2 denote projection


on the line y = mx.

Then Pm is a linear transformation with matrix


 
1 1 m
.
1 + m2 m m2

ThienNV Chapter 2. Matrix Algebra February 28, 2021 35 / 41


Linear Transformations

Composition
Given two “linked” transformations
T S
Rk −→ Rn − → Rm
x 7→ T (x) 7→ S[T (x)]

The composite of S and T :

S ◦ T : Rk → Rm

defined by
(S ◦ T )(x) = S[T (x)] for all x ∈ Rk .

Theorem
T S
Let Rk −−−→ Rn −−−→ Rm be linear transformations, and let A and B be
Bn×k Am×n
the matrices of S and T respectively. Then S ◦ T is linear with matrix AB.
ThienNV Chapter 2. Matrix Algebra February 28, 2021 36 / 41
Linear Transformations

Example
Let T and S be linear transformations given by:
   
2 2 x 2x + 3y
T: R →R , T =
y −x + 2y
 
x
S : R2 → R, S = x + 5y
y

Then S ◦ T : R2 → R defined by:


      
x x 2x + 3y
S ◦T =S T =S
y y −x + 2y
= (2x + 3y ) + 5(−x + 2y ) = −3x + 13y .

We can see that the matrices of T , S and S ◦ T respectively are


 
2 3    
B= , A = 1 5 , and AB = −3 13 .
−1 2
ThienNV Chapter 2. Matrix Algebra February 28, 2021 37 / 41
Linear Transformations

Example
π
Let T : R2 → R2 be rotation through 2 followed by reflection in the line
y = −x. Find the matrix of T .
π
1st way. The matrix of the rotation through 2 is

cos π2 − sin π2
   
0 −1
=
sin π2 cos π2 1 0

The matrix of the reflection in the line y = −x is

1 − (−1)2
   
1 2.(−1) 0 −1
=
1 + (−1)2 2.(−1) (−1)2 − 1 −1 0
    
0 −1 0 −1 −1 0
Hence, the matrix of T is = .
−1 0 1 0 0 1

ThienNV Chapter 2. Matrix Algebra February 28, 2021 38 / 41


Linear Transformations

Example
π
Let T : R2 → R2 be rotation through 2 followed by reflection in the line
y = −x. Find the matrix of T .
2nd way. We can see
     
1 rotation through π/2 0 reflection in y =−x −1
e1 = −−−−−−−−−−−−→ −−−−−−−−−−−→
0 1 0
     
0 rotation through π/2 −1 reflection in y =−x 0
e2 = −−−−−−−−−−−−→ −−−−−−−−−−−→
1 0 1

Hence, the matrix of T is


 
  −1 0
T (e1 ) T (e2 ) = .
0 1

ThienNV Chapter 2. Matrix Algebra February 28, 2021 39 / 41


Linear Transformations

Example
Let T : R2 → R 2
 be the matrixtransformation
 induced by
1 −1 −1
A= . Find (T ◦ T ) .
0 1 2
Answer: We have
       
−1 2 −1 1 −1 1 −1 −1
(T ◦ T ) =A =
2 2 0 1 0 1 2
    
1 −2 −1 −5
= = .
0 1 2 2

ThienNV Chapter 2. Matrix Algebra February 28, 2021 40 / 41


Linear Transformations

Exercises

Section 2.1 : 1ad, 2aef , 3acd, 4, 14, 15, 19 (page 45, 46)
Section 2.2 : 1, 2 (page 62)
Section 2.3 : 1adef , 2, 3, 4, 6, 7, 12, 22 (page 76 − 79)
Section 2.4 : 1bd, 2aeg , 3acd, 4, 5, 6, 9, 12 (page 91 − 93)
Section 2.6 : 1, 3, 7, 8, 9, 12 (page 115, 116)

ThienNV Chapter 2. Matrix Algebra February 28, 2021 41 / 41

You might also like