Matrix Operations and Properties
Matrix Operations and Properties
Matrices
Prerequisites: Adding, subtracting, multiplying and dividing numbers;
elementary row operations.
Basic Definitions
Definition:
Definition:
The element in row i and column j of a matrix is written as aij and called
th
the (i, j) entry of A.
In this course, we will deal almost exclusively with matrices that have
orders 2 × 2 and 3 × 3.
Definition:
The main diagonal (aka leading diagonal) of any matrix is the set of
entries aij where i = j.
Definition:
(a 11
a12 … a1(n −1) a1n )
A column matrix is a m × 1 matrix and is written as,
a11
a21
a(m −1)1
am 1
Definition:
Definition:
1 0 … 0
0 1 … 0
def
Im =
0 0 1
Definition:
0 0 0 … 0
def 0 0 0 … 0
Om × n = 0 0 0 … 0
0 0 0 0
Matrix Algebra
Definition:
def
(a + b )ij = aij + bij
def
(a − b )ij = aij − bij
Note that matrix addition and subtraction only makes sense if A and B
both have the same order.
Example 1
0 −3 13 1
Add the matrices A = and B = .
5 2 −4 5
0 −3 13 1
A + B = +
5 2 −4 5
0 + 13 −3 + 1
=
5 + ( −4) 2 + 5
13 −2
=
1 7
Example 2
4 −2 0
Find the difference P − Q where P = and
1 0 37
−4 −2 2
Q = .
−8 3 6
4 −2 0 −4 −2 2
P − Q = −
1 0 37 −8 3 6
8 0 −2
=
9 −3 31
Definition:
def
(ka )ij = kaij
Example 3
4 −4 0
If A = 5 6 1 , calculate 1
2
A.
8 9 −1
4 −4 0
1
2
A = 1
2 5 6 1
8 9 −1
4 / 2 −4 / 2 0 / 2
= 5 / 2 6 / 2 1 / 2
8 / 2 9 / 2 −1 / 2
2 −2 0
= 52 3 1
2
4 9 − 1
2 2
Matrix Multiplication
Definition:
∑ab
def
(ab )ij = ik kj
k =1
( 1 ≤ i ≤ m and 1 ≤ j ≤ p )
Note that the number of columns of A must equal the number of rows of
B. To see how to use the horrible prescription, split up A into rows and B
into columns; then taking the ‘ scalar product ’ of the i th row of A with
the j th column of B gives the (i, j ) th entry of AB.
Example 4
1 −2 0 3 0
Calculate AB when A = 8 0 1 and B = 1 2 .
−2 4 6 −3 4
1 −2 0 3 0
AB = 8 0 1 1 2
−2 4 6 −3 4
1 −4
= 21 4
−20 32
Example 5
0 −3 1 0
Show that AB ≠ BA for the matrices A = and B = .
5 2 0 2
First AB,
0 −3 1 0
AB =
5 2 0 2
0 −6
AB =
5 4
Next BA,
1 0 0 −3
BA =
0 2 5 2
0 −3
BA =
10 4
Definition:
Definition:
def
(aT )ij = a ji
Example 6
3 −7 0
Find the transpose of P = .
5 9 46
3 5
T
P = −7 9
0 46
Definition:
def
n
A = A × A × A × … × A
n times
• A + B = B + A
• (A + B) + C = A + (B + C)
• k (A + B ) = kA + kB
T
• (A + B )T = AT + B
• (A T )T = A
• (kA )T = kA T
• A ( BC ) = ( AB ) C
• A (B + C ) = AB + AC
• (AB )T = B TA T
m n
• A A = A m +n = A n
A m
There are 3 important properties that are worth singling out separately.
• A + O = O + A = A
• AI = AI = A
• AO = AO = O
Thus, the identity and zero matrices behave like the numbers 1 and 0
respectively in ordinary arithmetic and algebra.
Example 7
2 5 2
For the matrix A = , show that A = pA + qI 2 , stating the
1 16
values of the integers p and q. Hence write A 3 in the form gA + hI 2 ,
stating the values of g and h.
2
2 5 2 5
A =
1 16 1 16
2
9 90
A =
18 261
Next,
2 5 1 0
pA + qI 2 = p + q
1 16 0 1
2p + q 5p
pA + qI 2 =
p 16 p + q
2p + q 5p 9 90
=
p 16 p + q 18 261
This immediately gives p = 18; substituting this into one of the other
equations involving q gives q = − 27. Thus,
2
A = 18A − 27 I 2
3
A = A 2A
= (18A − 27 I 2 ) A
2
= 18 A − 27A
= 18 (18A − 27 I 2 ) − 27A
= 297A − 486 I 2
Example 8
(kABC )T = k (ABC )T
= k ((AB )C )T
T
= kC (AB )T
T
= kC (B T A T )
T
= kC B TA T
Example 9
1 0 0 0
Calculate AB for the matrices A = and B = .
2 0 3 4
1 0 0 0
AB =
2 0 3 4
0 + 0 0 + 0
=
0 + 0 0 + 0
0 0
=
0 0
Definition:
AT = A
Example 10
1 −2 4
Show that the matrix A = −2 0 17 is symmetric.
4 17 6
T
1 −2 4
AT = −2 0 17
4 17 6
1 −2 4
T
A = −2 0 17
4 17 6
AT = A
Hence, as A T = A, A is symmetric.
Definition:
A T = −A
Note that a skew-symmetric matrix must be square and have all diagonal
entries equal to 0.
Example 11
T
(A + B )T = AT + B
(A + B )T = ( −A ) + ( −B )
(A + B )T = − (A + B)
Orthogonal Matrices
Definition:
A T A = In
Example 12
cos θ sin θ
Show that R = is an orthogonal matrix.
− sin θ cos θ
1 0
=
0 1
= I2
Determinants
ax = b
is,
b
x =
a
assuming a ≠ 0.
ax + by = e
cx + dy = f
is,
de − bf
x =
ad − bc
af − ce
y =
ad − bc
assuming ad − bc ≠ 0.
ax + by + cz = j
dx + ey + fz = k
gx + hy + iz = l
Definition:
Definition:
Example 13
σ
For the case n = 3, the permutation (1, 2, 3) → (2, 1, 3) is odd, as
the result of σ involves only 1 switch (1 ↔ 2) between consecutive
numbers of (1, 2, 3). The sign of this permutation is − 1 .
Example 14
σ
Again, for the case n = 3, the permutation (1, 2, 3) → (3, 1, 2) is
even, as the result of σ involves 4 switches between consecutive numbers
of (1, 2, 3). The switches are (1, 2, 3) → (2, 1, 3) → (2, 3, 1) → (3, 2, 1)
→ (3, 1, 2). For this permutation, sign σ = + 1 .
Definition:
n
∑
def
det (A ) ≡ A =
σ
(sign σ )
∏
i =1
ai σ (i )
Definition:
Definition:
def
Cij = ( − 1)i + j Mij
It can be shown that the Leibniz formula for determinants can be written
using cofactors in the form given in the following theorem.
Theorem:
det (A ) = ∑a C
j =1
ij ij
(i = 1, 2, 3, … , n)
Theorem:
A ≡ (a ) = a
Theorem:
a b
A ≡ = ad − bc
c d
Theorem:
a b c
e f d f d e
A ≡ d e f = a − b + c
g h i h i g i g h
Notice that these are precisely the expressions for the denominators for
the systems at the start of this section.
Example 15
1 −4
Calculate the determinant of the matrix B = .
2 6
1 −4
det (B ) =
2 6
= 1.6 − ( − 4).2
= 14
Example 16
1 −2 7
Calculate the determinant of the matrix F = 6 0 −1 .
−3 −10 4
1 −2 7
det (F ) = 6 0 −1
−3 −10 4
0 −1 6 −1 6 0
= 1 − ( − 2) + 7
−10 4 −3 4 −3 −10
= 1 (0 − 10) + 2 (24 − 3) + 7 ( − 60 − 0)
= − 388
Example 17
2 −4
Solve the equation = 21 for x.
3x 5
2 −4
= 21
3x 5
10 + 12x = 21
12x = 11
11
x =
12
Properties of Determinants
n
• det (kA ) = k det (A )
• det ( A T ) = det (A )
Inverse of a Matrix
Inverse Matrices
Of all the operations that have been described for matrices, that of
division has not been mentioned. The closest concept of ‘ division of
matrices ’ involves the following.
Definition:
−1
An n × n matrix A has an inverse if there is a matrix (denoted A )
such that,
A A −1 = A −1 A = In
Theorem:
Definition:
The cofactor matrix of a square matrix A is the matrix C whose (i, j )th
entry is Cij .
Definition:
def
T
adj (A ) = C
Theorem:
−1 adj (A )
A =
det (A )
Theorem:
Example 18
1 0 4
Show that A = −2 0 17 is invertible.
4 17 6
1 0 4
det (A ) = −2 0 17
4 17 6
0 17 −2 17 −2 0
= 1 − 0 + 4
17 6 4 6 4 17
= 1 (0 − 289) + 4 ( − 34 − 0)
= − 425
Example 19
k −2
Determine the values of k for which the matrix is singular.
−2 k + 5
k −2
= 0
−2 k + 5
k (k + 5) − ( − 2). ( − 2) = 0
k 2 + 5k + 4 = 0
(k + 1) (k + 4) = 0
Example 20
2
If the matrix A satisfies the equation A = 18A − 27 I 2 , show
−1 −1
(without explicitly calculating A ) that A = DA + EI2 , stating the
values of D and E.
2
A = 18A − 27 I 2
−1 2 −1
A A = A (18A − 27 I 2 )
−1
A = 18 I2 − 27 A
−1
Rearranging and solving for A gives,
−1 1 2
A = − A + I
27 3 2
1 2
Hence, D = − and E = .
27 3
Ax = b
−1 −1
A Ax = A b
−1
x = A b
Theorem:
Ax = b
−1
has a solution if A exists; the solution is then obtained by calculating,
−1
x = A b
Corollary:
Example 21
Determine the value of k for which the following system of equations has
a solution.
x + y + z = 1
2x − ky + 3z = 0
x + 4y − z = 3
1 1 1
2 k 3
1 4 −1
1 1 1
k 3 2 3 2 k
2 k 3 = 1 − 1 + 1
1 4 −1 4 −1 1 −1 1 4
= ( − k − 12) − ( − 2 − 3) + (8 − k)
= − 2k − 15
In practice, the formula for the inverse involving the adjugate is difficult
to use from scratch. Fortunately, for the cases we are interested in,
there are other approaches.
Inverse of a 2 x 2 Matrix
Theorem:
a b
The inverse of the 2 × 2 matrix is,
c d
−1 1 d − b
A =
ad − bc − c a
Example 22
7 −3
Find the inverse of the matrix .
4 2
−1
7 −3 1 2 3
=
4 2 7.2 − ( − 3).4 −4 7
−1
7 −3 1 2 3
=
4 2 26 −4 7
Example 23
2 1 x 8
= 16
−2 3 y
−1
2 1 1 3 −1
Multiplying this equation by , which equals (check !),
−2 3 8 2 2
gives,
= 1 3 −1 8
x
y
8 2 2 16
= 3 −1 1
x
y
2 2 2
Inverse of a 3 x 3 Matrix
(A b1 )
(A b2 )
(A bn )
so that the LHS of each gives the identity matrix. According to the first
way of obtaining the RHS, what is left on each RHS will be the columns of
A −1 .
Theorem:
(A In )
into,
(In
B)
−1
Then B = A .
Example 24
1 0 4
Find the inverse of N = −2 0 7 .
4 1 6
1 0 4 1 0 0
−2 0 7 0 1 0
4 1 6 0 0 1
Then use EROs to reduce this matrix so that the LHS becomes I3 ; the
−1
RHS will then be N .
R2 → R2 + 2R1
R3 → R3 − 4R1
1 0 2 0 0
1
0 0 11 2 1 0
0 1 −2 −4 0 1
1
R2 ↔ R
11 2
1 0 2 1 0 0
0 0 1 0
2 1
11 11
0 1 −2 −4 0 1
R2 ↔ R3
1 0 2 1 0 0
0 1 −2 −4 0 1
0 0 1 2 1 0
11 11
R2 → R2 + 2R3
1 0 2 1 0 0
0 1 0 − 40 11 1
2
11
0 0 1 2 1 0
11 11
R1 → R1 − 2R3
1 0 0 7
11 − 2 11 0
0 1 0 − 40 11 1
2
11
0 0 1 2 1 0
11 11
To get the inverse into a slightly slicker form, factorise out the fraction,
7 −2 0
−1 1
N = −40 2 11
11
2 1 0
• (A −1 ) T = (A T ) −1
−1 1
• det ( A ) =
det (A )
1
• (kA ) −1 = A −1
k
Transformation Matrices
Definition:
Definition:
Theorem:
x' def ax + by a b x
= =
y' cx + dy c d y
a b
The matrix is called the transformation matrix.
c d
Example 25
x' a b x
=
y' c d y
Example 26
Find the image of the point P (3, − 1) under the transformation associated
1 −2
with the matrix .
3 0
x' 1 −2 3
=
y' 3 0 −1
Invariant Points
Definition:
Tx = x
Example 27
x −1 2 x
=
y 2 3 y
Theorem:
1 0
0 −1
Theorem:
−1 0
0 1
Theorem:
0 1
1 0
Theorem:
cos θ − sin θ
sin θ cos θ
Dilatation (Scaling)
Definition:
Theorem:
k 0
(k ∈ )
0 k
Example 28
0 − 1 1 0
Tθ TR =
1 0 0 −1
0 1
=
1 0
Example 29
Find the image of the point P (1, 2) after a reflection in the line y = x
7 0
followed by the dilatation .
0 7
7 0 0 1 1
0 7 1 0 2
14
Performing this multiplication gives the vector . So, the image of P is
7
P ′ (14, 7).
Transformation of Loci
Example 30
Find the equation of the image of the curve with equation y = x 2 under
1 2
the transformation with associated matrix .
2 3
x' 1 2 x
=
y' 2 3 y
−1
x 1 2 x'
=
y 2 3 y'
x −3 2 x'
=
y 2 −1 y'
x −3x' + 2y'
=
y 2x' − y'