Download as pdf or txt
Download as pdf or txt
You are on page 1of 52

Linear Algebra

Chapter 2: Matrix Algebra

Nguyen Thi Minh Tam

March 8, 2020
1 2.1 Matrix Addition, Scalar Multiplication, and Transposition

2 2.2 Equations, Matrices, and Transformations

3 2.3 Matrix Multiplication

4 2.4 Matrix Inverses

5 2.6 Linear Transformations


2.1 Matrix Addition, Scalar Multiplication, and Transposition
2.2 Equations, Matrices, and Transformations
2.3 Matrix Multiplication
2.4 Matrix Inverses
2.6 Linear Transformations

Matrix Addition, Scalar Multiplication, and Transposition

Matrix
A matrix of size m × n is rectangular array of numbers with m
rows, n columns.
The (i, j)-entry of a matrix is the number lying in row i and
column j.
If A is an m × n matrix and the (i, j)-entry of A is aij , then A
is written as follow:
 
a11 a12 . . . a1n
 a21 a22 . . . a2n 
 
A=  .. ..  or A = [aij ]m×n
.. 
 . . . 
am1 am2 . . . amn

3/52
Square Matrix, Zero Matrix, Negative Matrix
A matrix of size n × n is called a square matrix of order n.
The m × n matrix in which every entry is zero is called the
zero matrix, denoted as 0.
If A = [aij ]m×n , then the negative matrix of A ( written –A) is
defined by
−A = [−aij ]m×n
Equality of Matrices
Two matrices A and B are called equal ( written A = B ) if
(1) they have the same size,
(2) corresponding entries are equal.

Example 1.
" # " #
a b 1 −2
= ⇔ a = 1, b = −2, c = 3, d = 4.
c d 3 4
Matrix Addition and Subtraction
If A = [aij ]m×n , B = [bij ]m×n , then
the sum of A and B, denoted A + B, is defined by

A + B = [aij + bij ]m×n

the difference of A and B, denoted A − B, is defined by

A − B = A + (−B) = [aij − bij ]m×n

Example 2.
" # " #
1 2 −3 2 −1 3
Let A = , B= .
0 4 −1 5 2 −2

Compute A + B, A − B.
Properties of Matrix Addition
If A, B, C are any matrices of the same size, then
(1) A + B = B + A (commutative law)
(2) A + (B + C ) = (A + B) + C (associative law)
(3) 0 + A = A
(4) A + (−A) = 0
Scalar Multiplication
If A = [aij ]m×n and k is any number, then the scalar multiple kA is
defined by
kA = [kaij ]m×n

Example 3. Find the entries in the second row of matrix B if


2A − B = 3C with
   
−2 1 0 1 −2 0
A =  3 2 −1 , C = 0 −1 2
   
4 2 0 1 0 1
Properties of Scalar Multiplication
If A, B are any matrices of the same size and k, p are any real
numbers, then
(1) k(A + B) = kA + kB
(2) (k + p)A = kA + pA
(3) (kp)A = k(pA)
(4) 1A = A
Transpose of a Matrix
If A is an m × n matrix, the transpose of A, written AT , is the
n × m matrix whose rows are just the columns of A in the same
order.
In other words, if A = [aij ]m×n , then AT = [aji ]n×m .

Example 4. Write down the transpose of the matrix


" #
1 2 3
A=
4 5 6
Properties of Transposition
If A, B are matrices of the same size and k is a scalar, then
(1) (AT )T = A
(2) (kA)T = kAT
(3) (A + B)T = AT + B T

Example 5. Find the matrix A such that


 " #T " #
T
2A − 5 1 0  = 4A − 9 1 1
−1 2 −1 0
Symmetric Matrix
A matrix A is called symmetric if A = AT .
A symmetric matrix is necessarily square.

Example 6. Determine all s and t such that the following matrix


is symmetric.
 
s 2s st
A = t −1 s 
 
t s2 s
2.1 Matrix Addition, Scalar Multiplication, and Transposition
2.2 Equations, Matrices, and Transformations
2.3 Matrix Multiplication
2.4 Matrix Inverses
2.6 Linear Transformations

Equations, Matrices, and Transformations

Vectors
An ordered sequence (a1 , a2 , . . . , an ) of real numbers is called
an ordered n-tuple.
Rn denotes the set of all ordered n-tuples of real numbers.
a = (a1 , a2 , . . . , an ) ∈ Rn is called a vector (or an n-vector)
and is also written as
 
a1
 a2 
 
a=  .. 

.
an

13/52
The Dot Product
The dot
  product of a row R = [r1 r2 . . . rn ] and a column
c1
c2 
 
C = ..  is the number r1 c1 + r2 c2 + . . . + rn cn .

 .
cn
Matrix-Vector Products
Let A be an m × n matrix and let x be an n-vector. Then the
product Ax is an m-vector whose ith entry is the dot product of
the ith row of A with x.

Example 7.
 
 2

2 −1 3 5
1
 
Let A =  0 2 −3 1 , x =   . Compute Ax.
 
0
−3 4 1 2
−2
Matrix Form of a System of Linear Equations
Consider the system of linear equations

a11 x1 + a12 x2 + . . . + a1n xn = b1


a21 x1 + a22 x2 + . . . + a2n xn = b2
(1)
...
am1 x1 + am2 x2 + . . . + amn xn = bm

     
a11 a12 ... a1n x1 b1
 a21 a22 ... a2n   x2   b2 
     
If A = 
 .. ..  , X =  ..  , and b =  ..  ,
..     
 . . .   .  . 
am1 am2 . . . amn xn bm

then the system (1) can be written in matrix form

AX = b
Example 8. Solve the homogeneous system AX = 0, where
 
1 −1 −1 3
A = 2 −1 −3 4
 
1 0 −2 1

The general solution is

x1 = 2s − t, x2 = s + 2t, x3 = s, x4 = t,

where s and t are arbitrary parameters.


The general solution can be written
           
x1 2s − t 2s −t 2 −1
x s + 2t s 2t 1 2
           
X =  2 =   =   +   = s   + t   = sX1 + tX2
         
x3   s   s   0  1 0
x4 t 0 t 0 1
   
2 −1
1 2
   
where X1 =   , X2 =   is particular solutions.
1 0
0 1

The solutions X1 , X2 in Example 8 are called basic solutions to


the homogeneous system.
A solution of the form sX1 + tX2 is called a linear combination
of X1 and X2 .
Theorem 1
Let A be an m × n matrix of rank r , and consider the homogeneous
system in n variables with A as coefficient matrix. Then:
1) The system has exactly n − r basic solutions, one for each
parameter.
2) Every solution is a linear combination of these basic solutions.

Example 9. For the following homogeneous system, find a set of


basic solutions and express the general solution as a linear
combination of these basic solutions.

x1 + 2x2 − x3 + 2x4 + x5 = 0
x1 + 2x2 + 2x3 + x5 = 0
2x1 + 4x2 − 2x3 + 3x4 + x5 = 0
Solution:
The reduction of the augmented matrix to reduced row-echelon
form is
   
1 2 −1 2 1 0 1 2 −1 2 1 0

 R2 → R2 − R1 

 1 2 2 0 1 0   0 0 3 −2 0 0 
 
R3 → R3 − 2R1
2 4 −2 3 1 0 −− −−−−−−−−→ 0 0 0 −1 −1 0

 
1 2 −1 2 1 0

R2 → 13 R2   R1 → R1 − 2R3
 0 0 1 −2/3 0 0 

R3 → −R3 R → R2 + 32 R3
−−−−−−−→ 0 0 0 1 1 0 −−2−−−−−

−−−−→

   
1 2 −1 0 −1 0 1 2 0 0 −1/3 0

 0 0 1 0 2/3 0  R1 → R1 + R2  0 0 1 0 2/3 0 
   
−−−−−−−−−−→
0 0 0 1 1 0 0 0 0 1 1 0

leading variables: x1 , x3 , x4
nonleading variables:
 x2 , x5 Let x2 = s, x5= t.
1 1
x1 + 2x2 − 3 x5 = 0 x1 = −2s + 3 t

 

 
The system ⇔ 2 ⇔ 2
x3 + x5 = 0 x3 = − t


 3 


 x = −t 3
 x4 + x5 = 0 4

The general solution to the system is


1 2
x1 = −2s + t, x2 = s, x3 = − t, x4 = −t, x5 = t; s, t are free.
3 3
In matrix form, the general solution is
1 1 1
     
     
x1 −2s + 3 t  −2s  3t  −2  3 
x2   s   s   0  1  0 
           
X = x3  =  − 2 t  =  0 +− 2 t  = s  0 +t − 2 
           
x4  
   3   0   3 
        3
0  
 −t  −t   −1 
x5 0 0

t t 1
therefore, basic solutions are
1
 
 
−2  3 
1  0 
   
X1 =  0  , X2 = − 2 
   
 3
0
 
 
 −1 
0
1

and the general solution X = sX1 + tX2 .


Transformations
A transformation T : Rn → Rm is a rule that assigns to every
vector x in Rn a uniquely determined vector T (x) in Rm .
T is called the matrix transformation induced by A if

T (x) = Ax, ∀x ∈ Rn .
Example 10. Let T : R2 → R2 be the reflection in the x axis.

" # " #
a1 a1
T is defined by T = .
a2 −a2
T is the matrix transformation induced by
" #
1 0
A=
0 −1
Example 11. Let Rθ : R2 → R2 denote counterclockwise rotation
about the origin through the angle θ.

Rθ is defined by
" # " #
a a cos θ − b sin θ
Rθ =
b a sin θ + b cos θ

Rθ is the matrix transformation induced by


" #
cos θ − sin θ
A=
sin θ cos θ

Rπ/2 is the matrix transformation induced by


" #
0 −1
A=
1 0
Example 12. Consider the matrix transformation T : R2 → R2
induced by the matrix
" #
a 0
A=
0 1

" # " #
x ax
T is defined by T = .
y y
If a > 1, T is called an x-expansion of R2 .
If 0 < a < 1, T is called an x-compression of R2 .
Example 13. Let w be a fixed column in Rn , define the
transformation Tw : Rn → Rn by

Tw (x) = x + w , ∀x ∈ Rn .

Tw is called translation by w .
2.1 Matrix Addition, Scalar Multiplication, and Transposition
2.2 Equations, Matrices, and Transformations
2.3 Matrix Multiplication
2.4 Matrix Inverses
2.6 Linear Transformations

Matrix Multiplication
Let A and B be matrices of sizes m × n and n × k, respectively.
The product AB is an m × k matrix whose (i, j)-entry is the dot
product of the row i of A with column j of B.

28/52
Example 14.
 
" # 2 3 1
1 −1 2
Let A = , B =  1 9 7
 
2 0 4
−1 0 2

Compute the (1, 3)- and (2, 2)-entries of AB. Then compute AB.
Example 15. (25, page 68)
An autoparts manufacturer makes fenders, doors, and hoods. Each
requires assembly and packaging carried out at factories: Plant 1,
Plant 2, and Plant 3. Matrix A below gives the number of hours for
assembly and packaging, and matrix B gives the hourly rates at the
three plants. Explain the meaning of the (3, 2)-entry in the matrix
AB. Which plant is the most economical to operate? Give reasons.
Example 16.
" # " #
1 2 4 −1 6
Let A = ,B =
0 1 −1 1 0

Compute A2 , AB, BA, and B 2 when they are defined.

Note
AB is defined only if the number of columns of A equals the
number of rows of B.
In general, AB 6= BA.
If AB = BA then A and B are said to commute.
Properties of Matrix Multiplication
Assume that k is an arbitrary scalar and A, B, C are matrices of
sizes such that the indicated operations can be performed.
1) A(BC ) = (AB)C
2) A(B + C ) = AB + AC , A(B–C ) = AB–AC
3) (B + C )A = BA + CA, (B–C )A = BA–CA
4) k(AB) = (kA)B = A(kB)
5) (AB)T = B T AT
Block Multiplication
If matrices A and B are partitioned compatibly into blocks, the
product AB can be computed by matrix multiplication using blocks
as entries.

" # " #
A11 A12 B11 B12
A= , B=
A21 A22 B21 B22
" #
A11 B11 + A12 B21 A11 B12 + A12 B22
⇒ AB =
A21 B11 + A22 B21 A21 B12 + A22 B22
Example 17. Compute AB, using the indicated block partitioning.
 
  1 2
1 0 0 0 0  −2 4 
 0 1 0 0 0 
   
A= , B =  3 0 
 
1 9 7 9 −1
 4 −3 
   
1 2 3 4 5
5 6

Example 18. Let A = [C1 C2 . . . Cn ] be an m × n matrix with


columns C1 , C2 , . . . , Cn . If x = [x1 x2 . . . xn ]T is any column,
then
 
x1
ix2 
h 
Ax = C1 C2 . . . Cn  .  
 = x1 C1 + x2 C2 + . . . + xn Cn
 .. 
xn
2.1 Matrix Addition, Scalar Multiplication, and Transposition
2.2 Equations, Matrices, and Transformations
2.3 Matrix Multiplication
2.4 Matrix Inverses
2.6 Linear Transformations

Matrix Inverses
Identity Matrix
If A = [aij ]m×n , the elements a11 , a22 , a33 , . . . are called the
main diagonal of A.
The square matrix of order n with 1’s on the main diagonal
and zeros elsewhere is called the identity matrix of order n,
denoted In or I .

Example 19.  
" 1 0 0
#
1 0
I2 = , I3 = 0 1 0
 
0 1
0 0 1

Note: If A is an m × n matrix, then Im A = A, AIn = A.


35/52
Invertible Matrix
A square matrix A is said to be invertible if there exists a matrix B
such that
AB = I and BA = I .
In this case, B is called the inverse of A and is denoted by A−1 .

Example 20.
" #
0 −1
Let A = . Show that A3 = I and so find A−1 .
1 −1
# "
a b
The determinant detA of the matrix A = is defined by
c d

detA = ad − bc

The Inverse of a Square Matrix of Order 2


" #
a b
A= is invertible if and only if detA 6= 0, and in this case
c d
" #
−1 1 d −b
A =
detA −c a

Example 21. Find the inverse of each of the following matrices.


" # " #
1 −1 4 1
a) A = b) B =
−1 3 3 2
Inverses and Linear Systems
Suppose a system of n equations in n variables is written in matrix
form as
AX = b
If A is invertible, the system has the unique solution

X = A−1 b

Example 22.  
1 −1 3
Given A−1 = 2 0 5. Solve the system of equations
 
−1 1 0
 
1
AX = −1
 
3
Matrix Inversion Algorithm
If A is an invertible n × n matrix, there exists a sequence of
elementary row operations that carry A to In . This same series of
row operations carries In to A−1 . The algorithm can be
summarized as follows:

[A | In ] → [In | A−1 ]

Example 23. Find the inverse of the matrix


 
1 −1 2
−5 7 −11
 
−2 3 −5
Basic Properties of Matrix Inverses
All the following matrices are square matrices of the same size.
1) I −1 = I .
2) (A−1 )−1 = A.
3) (AB)−1 = B −1 A−1 .
4) (A1 A2 . . . Ak )−1 = A−1 −1 −1
k . . . A2 A1 .
5) (Ak )−1 = (A−1 )k .
1
6) (aA)−1 = A−1 , a 6= 0.
a
7) (AT )−1 = (A−1 )T .

 " #−1 " #


1 −1 2 3
Example 24. Find A if A  =
0 1 1 1
Theorem 2 (Inverse Theorem)
The following conditions are equivalent for an n × n matrix A:
1) A is invertible.
2) The homogeneous system AX = 0 has only the trivial solution
X = 0.
3) A can be carried to the identity matrix In by elementary row
operations.
4) The system AX = b has a unique solution for every choice of
column b.
5) There exists an n × n matrix C such that AC = In .
2.1 Matrix Addition, Scalar Multiplication, and Transposition
2.2 Equations, Matrices, and Transformations
2.3 Matrix Multiplication
2.4 Matrix Inverses
2.6 Linear Transformations

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:
T1) T (X + Y ) = T (X ) + T (Y )
T2) T (aX ) = aT (X )

42/52
Theorem 3
If T : Rn → Rm is a linear transformation, then

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 .

The vector Y = a1 X1 + a2 X2 + . . . + ak Xk is called a linear


combination of vectors X1 , X2 , . . . , Xk .

Example 25. Let T : R3 → R2 be a linear transformation.


     
8 1 " # 2 " #
2 −1
Find T 3 if T  0  = , T 1 =
     
3 0
7 −1 3
Theorem 4
1) A matrix transformation is a linear transformation.
2) Every linear transformation T : Rn → Rm is a matrix
transformation induced by a unique m × n matrix

A = [T (e1 ) T (e2 ) . . . T (en )],

where ei is the ith column of In .

The set of columns {e1 , e2 , . . . , en } is called the standard


basis of Rn .
Example 26. Let T : R3 → R2 be a linear transformation defined
by  
x1 " #
x − x
T x2  = 1 2
 
x2 + x3
x3
 
1
Find the matrix of T and find T  2 
 
−1
Composition
Let T : Rk → Rn , S : Rn → Rm be two transformations. The
composite of S and T , denoted S ◦ T , is a transformation defined
by
S ◦ T : Rk −→ Rm
X 7−→ S[T (X )]
Theorem 5
If T : Rk → Rn , S : Rn → Rm be linear transformations, and A, B
is the matrices of S and T respectively, then S ◦ T is linear with
matrix AB.

Example 27. Let T : R2 → R2


be reflection in the line y = x followed by
rotation through π/2. Find the matrix of T .
Reflection in the Line y = mx
Let Qm : R2 → R2 be reflection in the line y = mx. Then Qm is a
linear transformation with matrix
" #
1 1 − m2 2m
1 + m2 2m m2 − 1
Projection on the Line y = mx
Let Pm : R2 → R2 be projection on the line y = mx. Then Pm is a
linear transformation with matrix
" #
1 1 m
1 + m2 m m2
Inverses of Linear Transformations
Let T : Rn → Rn be a linear transformation. If there exists a linear
transformation T 0 : Rn → Rn such that

T ◦ T 0 = T 0 ◦ T = 1Rn

then T 0 is called an inverse of T , where 1Rn : Rn → Rn is the


identity transformation defined by

1Rn (X ) = X , ∀X ∈ Rn
Theorem 6
Let T : Rn → Rn be a linear transformation with matrix A. Then
1) A is invertible if and only if T has an inverse.
2) In this case, T has exactly one inverse, denoted by T −1 , and
T −1 : Rn → Rn is the linear transformation with matrix A−1 .

Example 28. Let T : R2 → R2 be a linear transformation defined


by " # " #
x x +y
T =
y x − 3y
" #
−1
Show that T has an inverse and find T −1
2
2.1 Matrix Addition, Scalar Multiplication, and Transposition
2.2 Equations, Matrices, and Transformations
2.3 Matrix Multiplication
2.4 Matrix Inverses
2.6 Linear Transformations

Exercises

2.1 1b, 14d, 15, 19 (page 40-41)


2.2 1b, 4, 7, 10-14 (page 54-56)
2.3 1bd, 2b, 6bc, 7, 8, 10-12, 13bd, 16bd, 19, 20 (page 67-68)
2.4 2bf, 4bc, 5df, 6b, 7, 9, 12, 15, 17, 24b (page 80-82)
2.6 1b, 3, 7-10, 12, 18bd (page 101-102).

52/52

You might also like