You are on page 1of 51

Matrices and Matrix

Operations
Wahyuni. S.Si., M.Sc.

Prodi Teknik Pertambangan Fakultas Teknik


Universitas Bosowa Makassar

1 1
References
Boas M. L., 2006., Mathematical Methods In The Physical Sciences., Third Edition., John Wiley & Sons, Inc.
Dyke J. V., dkk., 2007., Fundamentals of Mathematics, Ninth Edition., Thomson Higher Education.
RILEY K. F., dkk., 2006., Mathematical Methods for Physics and Engineering., Third Edition., Cambridge
University Press.
Anton H., Rorres C., Elementary Linear Algebra, Applications Version, 9th Edition,
Lay D.C., Lay S.R., McDonald J.J., Linear Algebra and Its Applications., 5th Edition, Pearson.
Nicholson W.K., 2013, Linear Algebra with Applications, 7th edition, McGraw-Hill Ryerson Limited,

1 2
MATRIX OPERATIONS
✓ If A is an m x n matrix, that is, a matrix with m rows and n columns
✓ The scalar entry in the ith row and jth column of A is denoted by aij and is called the (I ; j)-entry of A.

See Figure 1. For instance, entry is the number a32 in the third row, second column. Each column of A
is a list of m real numbers, which identifies a vector in Rm. Often, these columns are denoted by a1, . . .
. an, and the matrix A is written as

𝐴 = 𝑎1 𝑎2 … 𝑎𝑛

1 3
MATRIX TYPE
➢ The diagonal entries in an m x n matrix A = [ aij ]are a11;
a22; a33;… ; and they form the main diagonal of A.
➢ A diagonal matrix is a square n x n matrix whose
nondiagonal entries are zero.
➢ An example is the n x n identity matrix, In. An m x n
matrix whose entries are all zero is a zero matrix and is
written as 0. The size of a zero matrix is usually clear
from the context.

1 4
Sums and Scalar Multiples
• The arithmetic for vectors described earlier has a natural extension to matrices. We say that two matrices are
equal if they have the same size (i.e., the same number of rows and the same number of columns) and if their
corresponding columns are equal, which amounts to saying that their corresponding entries are equal.
• If A and B are m x n matrices, then the sum A + B is the m x n matrix whose columns are the sums of the
corresponding columns in A and B. Since vector addition of the columns is done entrywise, each entry in A + B
is the sum of the corresponding entries in A and B. The sum A + B is defined only when A and B are the same
size.
• Example 1: Let

but A + C is not defined because A and C have different sizes.

If r is a scalar and A is a matrix, then the scalar multiple rA is the matrix whose columns are r times the
corresponding columns in A. As with vectors, -A stands for (-1) A, and A - B is the same as A + (-1)B.

1 5
Example 2: If A and B are the matrices in Example 1, then

It was unnecessary in Example 2 to compute A - 2B as A + (-1)2B because the usual rules


of algebra apply to sums and scalar multiples of matrices, as the following theorem shows.

Theorem 1

1 6
Matrix Multiplication
When a matrix B multiplies a vector x, it transforms x into the vector Bx. If this vector is then multiplied in turn by a
matrix A, the resulting vector is A(Bx). See Figure 2.

Thus A(Bx) is produced from x by a composition of mappings. Our goal is to represent this composite mapping as
multiplication by a single matrix, denoted by AB, so that
A(Bx) = (AB)x

Multiplication of matrices corresponds to composition of linear transformations.


1 7
Exercise

Calculate AB ?

1 8
Matrix Products as Linear Combinations
Row and column matrices provide an alternative way of thinking about matrix multiplication. For example, suppose
that

Then

1 9
EXAMPLE 3 Linear Combinations
The matrix product

Can be written as the linear combination of column matrices

The matrix product

can be written as the linear combination of row matrices

1 10
2 3 4 3 6
Example 4: Compute AB, where 𝐴 = 1 −5
𝑎𝑛𝑑 𝐵 =
1 −2 3
SOLUTION Write 𝐴 = 𝑏1 𝑏2 𝑏3 , and compute:

Notice that since the first column of AB is Ab1; this column is a linear combination of the columns of A using the
entries in b1 as weights. A similar statement is true for each column of AB.

Each column of AB is a linear combination of the columns of A using weights


from the corresponding column of B.

1 11
Determining Whether a Product Is Defined
Suppose that A, B, and C are matrices with the following sizes:

Then by 3, AB is defined and is a 3 x 7 matrix; BC is defined and is a 4 x 3 matrix; and CA is defined and is a 7 x 4
matrix. The products AC, CB, and BA are all undefined.

In general, if A = [aij] is an m x r matrix and B = [bij] is an r x n matrix, then, as illustrated by the shading in below

The entry (AB) ij in row I and column j of AB is given by

1 12
EXAMPLE 5 If A is a 3 x 5 matrix and B is a 5 x 2 matrix, what are the sizes of AB and BA, if they are defined?
SOLUTION Since A has 5 columns and B has 5 rows, the product AB is defined and is a 3 x 2 matrix:

The product BA is not defined because the 2 columns of B do not match the 3 rows of A.

ROW--COLUMN RULE FOR COMPUTING AB


If the product AB is defined, then the entry in row i and column j of AB is the sum of the products of corresponding
entries from row i of A and column j of B. If (AB)ij denotes the (i, j)-entry in AB, and if A is an m x n matrix, then
(AB)ij = ai1b1j + ai2b2j + . . . + ainbnj
1 13
EXAMPLE 6:
Use the row–column rule to compute two of the entries in AB for the matrices in Example 4. An inspection of the
numbers involved will make it clear how the two methods for calculating AB produce the same matrix.

SOLUTION
To find the entry in row 1 and column 3 of AB, consider row 1 of A and column 3 of B. Multiply corresponding
entries and add the results, as shown below:

1 14
EXAMPLE 7: Find the entries in the second row of AB, where

SOLUTION:
By the row–column rule, the entries of the second row of AB come from row 2 of A (and the columns of B):

Notice that since Example 7 requested only the second row


of AB, we could have written just the second row of A to
the left of B and computed

This observation about rows of AB is true in general and follows from the row–column rule. Let rowi(A) denote the i th
row of a matrix A. Then,

1 15
PROPERTIES OF MATRIX MULTIPLICATION

The following theorem lists the


standard properties of matrix
multiplication. Recall that Im
represents the m x m identity matrix
and Imx = x for all x in m.

1 16
THEOREM 2

Show that these matrices do not commute. That is, verify that
EXAMPLE 8 Let A =
AB  BA.
SOLUTION

Example 8 illustrates the first of the following list


of important differences between matrix algebra
and the ordinary algebra of real numbers.

1 17
Powers of a Matrix
If A is an n x n matrix and if k is a positive integer, then Ak denotes the product of k copies of A:

If A is nonzero and if x is in Rn; then Akx is the result of left-multiplying x by A repeatedly k times.
If k = 0; then A0x should be x itself. Thus A0 is interpreted as the identity matrix.

Matrix powers are useful in both theory and applications (Sections 2.6, 4.9, and later in the text).
1 18
The Transpose of a Matrix
Given an m x n matrix A, the transpose of A is the n x m matrix, denoted by AT , whose columns are formed from
the corresponding rows of A.
EXAMPLE 9: Let

Then

Theorem 3

1 19
Trace of a Matrix
If A is a square matrix, then the trace of A, denoted by tr(A), is defined to be the sum of the entries on the main
diagonal of A. the trace of A undefined if A is not a square matrix.

The following are examples of matrices and their traces.

1 20
Latihan
Karena vektor dalam Rn dapat dianggap sebagai matriks n x 1, sifat-sifat transpos pada Teorema 3 juga berlaku
1 untuk vector, maka:
1 −3 5
𝐴= 𝑑𝑎𝑛 𝑥 =
−2 4 3
Hitunglah: (Ax)T , x T A T , xx T , dan x T x. Apakah A T x T dapat ditentukan ?

2 𝐴=
2 5
𝑑𝑎𝑛 𝐵 =
4 −5
. Tentukan nilai k jika ada, dan buatlah AB = BA ?
−3 1 3 𝑘

1 1 1 2 0 0
3 𝐴= 1 2 3 𝑑𝑎𝑛 𝐷 = 0 3 0
1 4 5 0 0 5
Hitunglah AD dan DA. Jelaskan bagaimana kolom dan baris pada matriks A berubah Ketika A dikalikan dengan
D pada sisi kanan atau kiri. Tentukan sebuah matriks B 3 x 3 (Bukan matriks Identitas atau matriks nol), sehingga
AB = BA.

1 21
THE INVERSE OF A MATRIX
This section investigates the matrix analogue of the reciprocal, or multiplicative inverse, of a nonzero number.
Recall that the multiplicative inverse of a number such as 5 is 1/5 or 5-1. This inverse satisfies the equations

5-1 . 5 = I and 5 . 5-1 = I


The matrix generalization requires both equations and avoids the slanted-line notation (for division) because matrix
multiplication is not commutative. Furthermore, a full generalization is possible only if the matrices involved are square

An n x n matrix A is said to be invertible if there is an n x n matrix C such that CA = I and AC = I

where I = In; the n x n identity matrix. In this


case, C is an inverse of A. In fact, C is
uniquely determined by A, because if B were A matrix that is not invertible is
another inverse of A, then B = BI = B(AC) =
(BA)C = IC = C: This unique inverse is
sometimes called a singular matrix, and
denoted by A-1, so that an invertible matrix is called a
nonsingular matrix.
A-1 A = I and A A-1 = I

1 22
Example 1:

Thus C = A-1

1 23
Theorem 4

The quantity ad - bc is called the determinant of A, and we write:

det A = ad - bc

Theorem 4 says that a 2 x 2 matrix A is invertible if and only if det A  0

1 24
3 4
Example 2: Find the inverse of 𝐴 =
5 6
SOLUTION
Since detA = 3(6) – 4(5) = -2  0, A is invertible, and

Example 3: Use the inverse of the matrix A in Example 2 to solve the system
3x1 + 4x2 = 3
5x1 + 6x2 = 7

SOLUTION This system is equivalent to Ax = b, so

The next theorem


1 provides three useful
25 facts about invertible matrices
Theorem 5

PROOF Take any b in Rn. A solution exists because if A-1b is substituted for x, then Ax = A(A-1b) = (A A-1 )b = Ib =
b. So A-1b is a solution. To prove that the solution is unique, show that if u is any solution, then u; in fact, must be
A-1b. Indeed, if Au = b, we can multiply both sides by A-1 and obtain
A-1Au = A-1b; Iu = A-1b; and u = A-1b

Theorem 6

1 26
Elementary Matrices
An elementary matrix is one that is obtained by performing a single elementary row operation on an identity matrix.
The next example illustrates the three kinds of elementary matrices.
Example 4:

Compute E1A, E2A, and E3A, and describe how these products can be
obtained by elementary row operations on A.

SOLUTION Verify that


Addition of -4 times row 1 of A An interchange of rows 1 and 2 of and multiplication of
to row 3 produces E1A. (This is a A produces E2A, row 3 of A by 5 produces E3A.
row replacement operation.)

1 27
Table. Inverse Operations

Row Operations and Inverse Row Operations

In each of the following, an elementary row operation


is applied to the 2 × 2 identity matrix to obtain an
elementary matrix E, then E is restored to the identity
matrix by applying the inverse row operation.

1 28
An Algorithm for Finding A–1
If we place A and I side by side to form an augmented matrix [ A I ], then row operations on this matrix produce
identical operations on A and on I. By Theorem 7, either there are row operations that transform A to In and In to A-1 or
else A is not invertible.
ALGORITHM FOR FINDING A-1
Row reduce the augmented matrix [ A I ]. If A is row equivalent to I, then [ A I ] is row
equivalent to [ I A-1 ]. Otherwise, A does not have an inverse.

Example 5 Find the inverse of the matrix 𝐴 =


1 2 3 1 2 3 1 0 0 We added -2 times the first row to the second and
2 5 3 , if it exists. Solution => 𝐴 𝐼 = 2 5 3 0 1 0 -1 times the first row to the third
1 0 8 1 0 8 0 0 1

1 2 3 1 0 0 We added 2 times the second row to the third


~ 0 1 −3 −2 1 0
0 −2 5 −1 0 1

1 2 3 1 0 0 We multiplied the third row by -1


~ 0 1 −3 −2 1 0
0 0 −1 −5 2 1

1 29
ALGORITHM FOR FINDING A-1
Row reduce the augmented matrix [ A I ]. If A is row equivalent to I, then [ A I ] is row equivalent to [ I A-1 ]
otherwise, A does not have an inverse.

We multiplied the third row by -1

1 2 3 1 0 0 We added 3 times the third row to the second and -3 times


𝐴 𝐼 ~ 0 1 −3 −2 the third row to the first
1 0
0 0 1 5 −2 −1

1 2 0 −14 6 3 We added -2 times the second row to the first


~ 0 1 0 13 −5 −3
0 0 1 5 −2 −1

1 0 0 −40 16 9
~ 0 1 0 13 −5 −3
0 0 1 5 −2 −1 −40 16 9
So, we got A-1 = 13 −5 −3
5 −2 −1

1 30
Example 6
1

SOLUTION

since A  I, that A is
invertible, and

1 31
Characterizations Of Invertible Matrices
This section provides a review of most of the concepts introduced in Linear equations, in relation to systems of n
linear equations in n unknowns and to square matrices. The main result is Theorem 8

THEOREM 8

Let A and B be square


matrices. If AB = I , then
A and B are both
invertible,
with B = A-1 and A = B-1

1 32
Example 7
Use the Invertible Matrix Theorem to decide if A is invertible:

1 0 −2
𝐴= 3 1 −2
−5 −1 9
Solution,
1 0 −2 1 0 −2
𝐴= 0 1 4  0 1 4
0 −1 −1 0 1 3

So A has three pivot positions and hence is invertible, by the Invertible Matrix Theorem,
statement (c) → A has n pivot positions..

1 33
The quantity ad − bc in Theorem 1.4.5 is called the determinant
of the 2 × 2 matrix A and is denoted by:

det(A) = ad − bc
or alternatively by
𝑎 𝑏
= 𝑎𝑑 − 𝑏𝑐
𝑐 𝑑

𝑎 𝑏
det 𝐴 = = 𝑎𝑑 − 𝑏𝑐
𝑐 𝑑

1 34
EXAMPLE 8
Calculating The Inverse of A 2 × 2 Matrix

In each part, determine whether the matrix is invertible. If so, find its inverse.

Solution
(a) The determinant of A is det(A) = (6)(2) − (1)(5) = 7, which is nonzero. Thus, A is invertible, and its inverse is

(b) The matrix is not invertible since det(A) = (−1)(−6) − (2)(3) = 0.

1 35
Solution of a Linear System by Matrix Inversion
A problem that arises in many applications is to solve a pair of equations of the form
u = ax + by
v = cx + dy

for x and y in terms of u and v. One approach is to treat this as a linear system of two equations in the unknowns x
and y and use Gauss–Jordan elimination to solve for x and y. However, because the coefficients of the unknowns
are literal rather than numerical, this procedure is a little clumsy. As an alternative approach, let us replace the
two equations by the single matrix equation

which we can rewrite as

If we assume that the 2 × 2 matrix is invertible (i.e., ad − bc = 0),


then we can multiply through on the left by the inverse and rewrite
the equation as

1 36
=1

which simplifies to

Using Theorem 1.4.5, we can rewrite this equation as

from which we obtain

1 37
Example 9 The Inverse of a Product

Consider the matrices

We leave it for you to show that

Thus, (AB)-1 = B-1A-1

and also that

1 38
Example 10 Properties of Exponents
Let A and A-1 be the matrices in Example 9; that is,

Then

Also,

so, as expected from Theorem

1 39
Example 11 A Matrix Polynomial
Find p(A) for

Remark
Solution It follows from the fact that
ArAs = Ar+s = As+r = AsAr
that powers of a square matrix
commute, and since a matrix
polynomial in A is built up from
powers of A, any two matrix
polynomials in A also commute;
that is, for any polynomials p1 and
p2 we have

p1(A)p2(A) = p2(A)p1(A)
or more briefly, p(A) = 0.

1 40
Latihan
1 Gunakan determinan untuk menentukan apakah matriks berikut ini keterbalikan (Invertible)
1 0 0 1 0 0 1 0 0
a. 0 1 0 𝑏. 0 1 0 𝑐. 0 1 0
0 0 1 0 0 1 0 0 1

1 −2 −1 1 6 4
2 Temukan invers dari matriks 𝐴 = −1 5 6 , dan 𝐵 = 2 4 −1 , Jika itu ada.
5 −4 5 −1 2 5

Jika A adalah sebuah matriks keterbalikan (Invertible), buktikan bahwa 5A adalah sebuah matriks keterbalikan
3 (Invertible)

Tunjukkan bahwa jika ad – bc = 0, kemudian persamaan Ax = 0 memiliki lebih dari satu penyelesaian. Apakah
A bukan keterbalikan (Invertible)? [Petunjuk: 1. pertimbangkan a = b = 0. dan, jika a dan b keduanya bukan
4 −𝑏
nol, tentukan vector x = ]
𝑎

1 41
Latihan
3 1
5 A = Hitunglah,
2 1
(a) A3 (b) A-3 (c) A2 – 2A + I

3 1
6 Hitunglah p(A) dengan menggunakan matriks 𝐴 = untuk polynomials berikut :
2 1
(a). p(x) = x – 2
(b). p(x) = 2x2 – x +1
(c). p(x) = x3 – 2x + 1

Buktikan apakah matriks A adalah invertible (keterbalikan) atau tidak


7 1 6 4
𝐴 = 2 4 −1
−1 2 5

1 42
Diagonal,Triangular, and
Symmetric Matrices

1 43
Diagonal Matrices
Asquare matrix in which all the entries off the main diagonal are zero is called a diagonal matrix.
Here are some examples:

A general n × n diagonal matrix D can be written as

A diagonal matrix is invertible if and only


if all of its diagonal entries are nonzero; in We can verify that this is so by
this case the inverse of (1) is multiplying (1) and (2). Powers
of diagonal matrices are easy
to compute; D is the diagonal
matrix (1) and k is a positive
integer, then

1 44
Example 1 Inverses and Powers of Diagonal Matrices

Matrix products that involve diagonal factors are especially easy to compute. For example,

1 45
Triangular Matrices
A square matrix in which all the entries above the main diagonal are zero is called lower triangular, and a square
matrix in which all the entries below the main diagonal are zero is called upper triangular. A matrix that is either
upper triangular or lower triangular is called triangular.

EXAMPLE 2 Upper and LowerTriangular Matrices

1 46
Properties of Triangular Matrices
Example 2 illustrates the following four facts about triangular matrices that we will state
without formal proof:
• A square matrix A = [aij ] is upper triangular if and only if all entries
to the left of the main diagonal are zero; that is, aij = 0 if i > j
• A square matrix A = [aij ] is lower triangular if and only if all entries
to the right of the main diagonal are zero; that is, aij = 0 if i < j
(Figure 1.7.1).
• A square matrix A = [aij ] is upper triangular if and only if the ith row
starts with at least i − 1 zeros for every i.
• A square matrix A = [aij ] is lower triangular if and only if the j th
column starts with at least j − 1 zeros for every j.

1 47
EXAMPLE 3 Computations withTriangular Matrices
Consider the upper triangular matrices

It follows from part (c) of Theorem that the matrix A is invertible but the matrix B is not. Moreover, the theorem
also tells us that A-1, AB, and BA must be upper triangular. We leave it for you to confirm these three statements
by showing that

1 48
Symmetric Matrices
DEFINITION 1 A square matrix A is said to be symmetric if A = AT .

EXAMPLE 4 Symmetric Matrices

Remark It follows from Formula that a square matrix A is


symmetric if and only if
(A)ij = (A)ji
for all values of i and j

1 49
Invertibility of Symmetric Matrices
THEOREM 1.7.4 If A is an invertible symmetric matrix, then A-1 is symmetric

Assume that A is symmetric and invertible. From the fact that A = AT , we have
which proves that A−1 is symmetric.

Products A AT and AT A are Symmetric


THEOREM 1.7.5 If A is an invertible matrix, then AAT and ATA are also invertible.
EXAMPLE 6

The Product of a
Matrix and Its
Transpose Is Observe that ATA and AAT
Symmetric are symmetric as expected

1 50
Exercise
find A2, A-2 and A-k (where k is any integer) by inspection.

1 2 02
𝐴2 = 2
0 −22
1ൗ 2 1ൗ 2
𝐴−2 = 1 0
1ൗ 2 1ൗ 2
0 −2
1ൗ 𝑘 1ൗ 𝑘
𝐴−2 = 1 0
1ൗ 𝑘 1ൗ 𝑘
0 −2

1 51

You might also like