Lecture 3
Matrices, Matrix Operations,
and Matrix Inverse
Team
Dr. Inas Taymour
Dr. Ahmed Abdel-Naby
Dr. Mohamed Wafa
Lecture Outline
• Matrices.
• Matrix operations and their properties.
• Matrix Inverse:
• What is the inverse of a matrix?
• Why and how do we use it?
• When does it exist?
Reference: Anton and Rorres, “Elementary Linear Algebra,”
Sections 1.3, and 1.4.
MTH0001 Algebra 2
Matrices
• A matrix is a rectangular array of real numbers (entries).
• A matrix 𝑨𝒎×𝒏 has 𝒎 rows and 𝒏 columns.
• The entry in row 𝒊 and column 𝒋 is denoted 𝒂𝒊𝒋
• Compact notation:
MTH0001 Algebra 3
𝑨𝒎×𝒏 : special sizes
Row matrix: Column matrix:
Square matrix:
MTH0001 Algebra 4
Matrix Operations
1. Matrix Equality: Two matrices 𝑨 and 𝑩 are equal if:
1. They have the same size (both are 𝒎 × 𝒏).
2. Their corresponding entries are equal: 𝒂𝒊𝒋 = 𝒃𝒊𝒋 for all 𝑖 and 𝑗.
𝟏 𝟐 𝟏 𝟐 𝟏 𝟐 𝟑
Ex: 𝑨 = ,𝑩 = ,𝑪 =
𝟒 𝒙 𝟒 𝟓 𝟒 𝟓 𝟔
MTH0001 Algebra 5
2. Matrix Addition and Subtraction
If two matrices 𝑨 and 𝑩 have the same size, then:
• The sum 𝑪 = 𝑨 + 𝑩: 𝒄𝒊𝒋 = 𝒂𝒊𝒋 + 𝒃𝒊𝒋 for all 𝒊 and 𝒋.
• The difference 𝑫 = 𝑨 − 𝑩: 𝒅𝒊𝒋 = 𝒂𝒊𝒋 − 𝒃𝒊𝒋 for all 𝒊 and 𝒋.
Matrices of different sizes cannot be added or subtracted (i.e., 𝑨 + 𝑩
and 𝑨 − 𝑩 are undefined).
MTH0001 Algebra 6
2. Matrix Addition and Subtraction (cont.)
𝟏 𝟐 𝟑 𝟏 𝟎 𝟒 𝟏 𝟓
Ex: 𝑨 = ,𝑩 = ,𝑪 =
𝟒 𝟓 𝟔 𝟔 −𝟓 𝟐 𝟒 𝟎
𝟏 𝟐 𝟑 𝟏 𝟎 𝟒
𝑨+𝑩= + =
𝟒 𝟓 𝟔 𝟔 −𝟓 𝟐
𝟏 𝟐 𝟑 𝟏 𝟎 𝟒
𝑨−𝑩= − =
𝟒 𝟓 𝟔 𝟔 −𝟓 𝟐
𝑨 + 𝑪, 𝑨 − 𝑪, 𝑩 + 𝑪, and 𝑩 − 𝑪 are undefined.
MTH0001 Algebra 7
Properties of Matrix Addition
• Commutative: 𝑨 + 𝑩 = 𝑩 + 𝑨
• Associative: 𝑨 + (𝑩 + 𝑪) = (𝑨 + 𝑩) + 𝑪
• Zero Matrix 𝑶:
• 𝑶𝒎×𝒏 = [𝒐𝒊𝒋 ], where 𝒐𝒊𝒋 = 𝟎 for all 𝒊 and 𝒋.
• For any matrix 𝑨𝒎×𝒏 : 𝑨 + 𝑶 = 𝑨, 𝑨 − 𝑶 = 𝑨, and 𝑨 − 𝑨 = 𝑶
MTH0001 Algebra 8
3. Scalar Multiplication
• Any matrix 𝑨𝒎×𝒏 can be multiplied by a scalar (constant) 𝒓.
• The product 𝑪𝒎×𝒏 = 𝒓𝑨𝒎×𝒏 : 𝒄𝒊𝒋 = 𝒓 𝒂𝒊𝒋 .
𝟏 𝟏 𝟐 𝟑
Ex: Find 𝑨 if 𝑨 = .
𝟐 𝟒 𝟓 𝟔
MTH0001 Algebra 9
Properties of Scalar Multiplication
Given two matrices 𝑨𝒎×𝒏 and 𝑩𝒎×𝒏 , and two scalars 𝒓 and 𝒔:
• 𝒓𝑨 + 𝒔𝑨 = 𝒓 + 𝒔 𝑨
• 𝒓𝑨 + 𝒓𝑩 = 𝒓 𝑨 + 𝑩
• 𝒓 𝒔𝑨 = 𝒔 𝒓𝑨 = 𝒓𝒔 𝑨
MTH0001 Algebra 10
4. Matrix Multiplication
• The product 𝑪 = 𝑨𝑩 is defined only if the number of columns of 𝑨 is
equal to the number of rows of 𝑩 (the inside numbers).
• The outside numbers give the size of the product.
MTH0001 Algebra 11
4. Matrix Multiplication (cont.)
• To compute an entry in the product 𝑪𝒎×𝒏 = 𝑨𝒎×𝒓 𝑩𝒓×𝒏 :
𝒄𝒊𝒋 = 𝐫𝐨𝐰𝐢 𝑨 𝐜𝐨𝐥𝐣 (𝑩)
MTH0001 Algebra 12
4. Matrix Multiplication (cont.)
𝟏 −𝟐 𝟑 𝟏 𝟒
Ex: If 𝑨 = 𝟒 𝟐 𝟏 , 𝑩 = 𝟑 −𝟏 , and 𝑪 = 𝑨𝑩, find 𝒄𝟑𝟐 .
𝟎 𝟏 −𝟐 −𝟐 𝟐
MTH0001 Algebra 13
4. Matrix Multiplication (cont.)
𝟏 −𝟐 𝟑 𝟏 𝟒
Ex: If 𝑨 = 𝟒 𝟐 𝟏 , 𝑩 = 𝟑 −𝟏 , and 𝑪 = 𝑨𝑩, find 𝑪.
𝟎 𝟏 −𝟐 −𝟐 𝟐
𝟏 −𝟐 𝟑 𝟏 𝟒
𝑪= 𝟒 𝟐 𝟏 𝟑 −𝟏 =
𝟎 𝟏 −𝟐 −𝟐 𝟐
MTH0001 Algebra 14
Properties of Matrix Multiplication
• Not commutative: if 𝑨𝑩 is defined, then 𝑩𝑨 is not necessarily
defined or equal to 𝑨𝑩.
Proof: Use a counterexample
Ex 1: 𝑨𝟐×𝟑 and 𝑩𝟑×𝟓 . Ex 2: 𝑨𝟐×𝟑 and 𝑩𝟑×𝟐 .
MTH0001 Algebra 15
Properties of Matrix Multiplication (cont.)
• Not commutative: if 𝑨𝑩 is defined, then 𝑩𝑨 is not necessarily
defined or equal to 𝑨𝑩.
𝟏 𝟐 𝟏 −𝟏
Ex 3: 𝑨 = and 𝑩 = .
𝟑 𝟒 𝟎 𝟐
MTH0001 Algebra 16
Properties of Matrix Multiplication (cont.)
• Associative:
(𝑨𝑩)𝑪 = 𝑨(𝑩𝑪)
• Distributive:
𝑫 𝑨 + 𝑩 = 𝑫𝑨 + 𝑫𝑩 (Left distributive law)
𝑨 + 𝑩 𝑭 = 𝑨𝑭 + 𝑩𝑭 (Right distributive law)
MTH0001 Algebra 17
The Identity Matrix, 𝑰
• 𝑰 is a square (𝒏 × 𝒏) matrix, typically denoted 𝑰𝒏 .
• 𝑰 contains ones on the main diagonal and zeros elsewhere.
• The role of 𝑰:
MTH0001 Algebra 18
Application to Linear Systems
𝒂𝟏𝟏 𝒙𝟏 + 𝒂𝟏𝟐 𝒙𝟐 + ⋯ + 𝒂𝟏𝒏 𝒙𝒏 = 𝒃𝟏
𝒂𝟐𝟏 𝒙𝟏 + 𝒂𝟐𝟐 𝒙𝟐 + ⋯ + 𝒂𝟐𝒏 𝒙𝒏 = 𝒃𝟐
• 𝒎 equations in 𝒏 unknowns:
⋯
𝒂𝒎𝟏 𝒙𝟏 + 𝒂𝒎𝟐 𝒙𝟐 + ⋯ + 𝒂𝒎𝒏 𝒙𝒏 = 𝒃𝒎
𝒙𝟏
𝒂𝟏𝟏 𝒂𝟏𝟐 ⋯ 𝒂𝟏𝒏 𝒙𝟐 𝒃𝟏
𝒂𝟐𝟏 𝒂𝟐𝟐 ⋯ 𝒂𝟐𝒏 𝒃𝟐
• Define: 𝑨 = ⋮ ⋮ ⋱ ⋮ , 𝑿 = , and 𝑩 =
⋮ ⋮
𝒂𝒎𝟏 𝒂𝒎𝟐 ⋯ 𝒂𝒎𝒏 𝒃𝒎
𝒙𝒏
MTH0001 Algebra 19
Application to Linear Systems (cont.)
• Calculate 𝑨𝑿:
𝒙𝟏
𝒂𝟏𝟏 𝒂𝟏𝟐 ⋯ 𝒂𝟏𝒏 𝒙𝟐
𝒂𝟐𝟏 𝒂𝟐𝟐 ⋯ 𝒂𝟐𝒏
⋮ ⋮ ⋱ ⋮ =
⋮
𝒂𝒎𝟏 𝒂𝒎𝟐 ⋯ 𝒂𝒎𝒏
𝒙𝒏
• We can write a linear system as:
• The augmented matrix is:
MTH0001 Algebra 20
5. Matrix Transpose
• The transpose of 𝑨𝒎×𝒏 is denoted by 𝑨𝑻 .
• 𝑨𝑻 is obtained by interchanging the rows and columns of 𝑨.
• Therefore, 𝑨𝑻 is 𝒏 × 𝒎.
𝟐
𝟏 𝟐 −𝟐
Ex: Find 𝑨𝑻 if 𝑨 = . Ex: Find 𝑩𝑻 if 𝑩 = −𝟏 .
𝟒 𝟎 𝟑
𝟏
MTH0001 Algebra 21
Properties of Matrix Transpose
𝑻
• 𝑨𝑻 =𝑨 • 𝑨+𝑩 𝑻 = 𝑨𝑻 + 𝑩𝑻
• 𝒓𝑨 𝑻 = 𝒓𝑨𝑻 • 𝑨𝑩 𝑻 = 𝑩𝑻 𝑨𝑻
𝟒
Ex: Solve 𝑿 + 𝑨 𝑻
= 𝑩, given 𝑨 = 𝟏 𝟐 𝟑 and 𝑩 = 𝟓 .
𝟔
MTH0001 Algebra 22
Nonsingular Matrices
Definition:
A square (𝒏 × 𝒏) matrix 𝑨 is said to be nonsingular (or invertible) if it
has an inverse, 𝑨−𝟏 , such that:
𝑨𝑨−𝟏 = 𝑨−𝟏 𝑨 = 𝑰𝒏 (𝑨−𝟏 is also 𝒏 × 𝒏)
Otherwise, 𝑨 is said to be singular (or non-invertible).
• Nonsingular: غير منفردة, Singular: منفردة, Inverse: المعكوس الضربي
MTH0001 Algebra 23
Nonsingular Matrices (cont.)
𝟑 −𝟏 𝟏 𝟏
Example: Verify that 𝑨−𝟏 = is the inverse of 𝑨 = .
−𝟐 𝟏 𝟐 𝟑
𝟏 𝟏 𝟑 −𝟏
𝑨𝑨−𝟏 = =
𝟐 𝟑 −𝟐 𝟏
𝟑 −𝟏 𝟏 𝟏
𝑨−𝟏 𝑨 = =
−𝟐 𝟏 𝟐 𝟑
MTH0001 Algebra 24
The Role of the Inverse of a Matrix
Real numbers: If 𝒂, 𝒃 ∈ ℝ, 𝒂 ≠ 𝟎, and 𝒂𝒙 = 𝒃, find 𝒙?
Matrices: If 𝑨 is nonsingular and 𝑨𝑿 = 𝑩. Find 𝑿?
MTH0001 Algebra 25
The Role of the Inverse (cont.)
𝟐 −𝟏 𝟐 −𝟏 −𝟏 𝟑 𝟎
Ex: Solve 𝑪𝑨𝑿 = 𝑩, if 𝑩 = ,𝑨 = ,𝑪 = .
𝟐 𝟒 𝟑 𝟒 𝟏
MTH0001 Algebra 26
The Properties of the Inverse of a Matrix
If 𝑨, 𝑩, and 𝑪 are 𝒏 × 𝒏 nonsingular matrices, then:
−𝟏 −𝟏
• 𝑨 =𝑨
• 𝑨𝑩𝑪 −𝟏 = 𝑪−𝟏 𝑩−𝟏 𝑨−𝟏
𝑻 −𝟏 −𝟏 𝑻
• 𝑨 = 𝑨
MTH0001 Algebra 27
The Determinant of a Square Matrix
• The determinant ( )المحددof a square matrix 𝑨 is a real number
associated with 𝑨, referred to as |𝑨|. (Section 2.1)
• If |𝑨| ≠ 𝟎, then 𝑨 is nonsingular.
𝒂 𝒃
The determinant of the 𝟐 × 𝟐 matrix 𝑨 = :
𝒄 𝒅
MTH0001 Algebra 28
The Determinant of a 𝟑 × 𝟑 Matrix
𝟏 𝟑 𝟐
Example: Find the determinant of 𝑨 = 𝟐 𝟓 𝟒?
𝟏 𝟐 𝟑
MTH0001 Algebra 29
The Inverse of a 𝟐 × 𝟐 Matrix
𝒂 𝒃 −𝟏 𝟏 𝒅 −𝒃
• If 𝑨 = , and |𝑨| ≠ 𝟎, then 𝑨 = .
𝒄 𝒅 |𝑨| −𝒄 𝒂
• Recall that if 𝑨 = 𝟎, then 𝑨 has no inverse.
𝟏 𝟏
Example: Find the inverse of 𝑨 = ?
𝟐 𝟑
• We will not use determinants to compute the inverse of a matrix.
MTH0001 Algebra 30
Summary
• Matrices, and matrix operations and their properties.
• Express a linear system as 𝑨𝑿 = 𝑩. The augmented matrix is: 𝑨|𝑩 .
• Matrix inverse:
• 𝑨𝒏×𝒏 is nonsingular if it has an inverse, 𝑨−𝟏 , such that: 𝑨𝑨−𝟏 = 𝑰𝒏 .
• Role and properties.
• 𝑨𝒏×𝒏 is nonsingular if 𝑨 ≠ 𝟎.
MTH0001 Algebra 31