8.1 Matrix Algebra
INTRODUCTION
In the last section of Chapter 7 we saw that a vector in Rn is an ordered n-tuple (x1, x2, . . ., xn). Vectors are also written as a horizontal or vertical array with no commas:
(1)
Each array in (1) is called a matrix. Our objective in this section is to consider the algebra of such arrays.
A Definition
The arrays in (1) are just special cases of (2) in the definition that follows.
DEFINITION 8.1.1 Matrix
A matrix is any rectangular array of numbers or functions:
(2)
The numbers or functions in the array (2) are called entries or elements of the matrix. If a matrix has m rows and n columns we say that its size is m by n (written m × n). An n × n matrix is called a square matrix or a matrix of order n. A 1 × 1 matrix is simply a constant or a single function. For example, A = is a 2 × 3 matrix, whereas
(3)
is a 4 × 4 square matrix or a matrix of order 4. Throughout this text we shall denote a matrix by a capital boldfaced letter such as A, B, C, or X.
The entry in the ith row and jth column of an m × n matrix A is written aij. An m × n matrix A is then abbreviated as A = (aij)m×n. For an n × n square matrix, the entries a11, a22, . . ., ann are called the main diagonal entries. The main diagonal entries for the matrix B in (3) are 9, −2, −1, and −4.
DEFINITION 8.1.2 Column and Row Vectors
An n × 1 matrix,
is called a column vector. A 1 × n matrix,
(a1 a2 . . . an),
is called a row vector.
DEFINITION 8.1.3 Equality of Matrices
Two m × n matrices A and B are equal if aij = bij for each i and j.
In other words, two matrices are equal if and only if they have the same size and their corresponding entries are equal.
EXAMPLE 1 Equality
(a) The matrices and are not equal, since the size of the first matrix is 2 × 2 and the size of the second matrix is 2 × 3.
(b) The matrices and are not equal, since the corresponding entries in the second rows of the matrices are not the same. ≡
Matrix Addition
When two matrices A and B are of the same size we can add them by adding their corresponding entries.
DEFINITION 8.1.4 Matrix Addition
If A and B are m × n matrices, then their sum is
A + B = (aij + bij)m×n.
EXAMPLE 2 Addition of Two Matrices
(a) The sum of A = and B = is
A + B = = .
(b) The sum of A = and B = is not defined, since A and B are of different sizes. ≡
DEFINITION 8.1.5 Scalar Multiple of a Matrix
If k is a real number, then the scalar multiple of a matrix A is
In other words, to compute kA, we simply multiply each entry of A by k. For example, from Definition 8.1.5,
5 = = .
We note in passing that for any matrix A the scalar multiple kA is the same as Ak.
The difference of two m × n matrices is defined in the usual manner: A − B = A + (−B) where −B = (−1)B.
The following theorem summarizes some of the properties of matrix addition and scalar multiplication. Each of the six parts of the theorem can be proved using Definitions 8.1.4 and 8.1.5.
THEOREM 8.1.1 Properties of Matrix Addition and Scalar Multiplication
Suppose A, B, and C are m × n matrices and k1 and k2 are scalars. Then
Matrix Multiplication
We have just seen that any matrix A can be multiplied by a scalar. But can two matrices be multiplied together? The next definition gives the answer.
DEFINITION 8.1.6 Matrix Multiplication
Let A be a matrix having m rows and p columns, and let B be a matrix having p rows and n columns. The product AB is the m × n matrix
Definition 8.1.6 states that the product C = AB is defined only when the number of columns in the matrix A is the same as the number of rows in B. The dimension of the product can be determined from
The number of columns of A must equal the number of rows of B.
Also, you might recognize that the entries in, say, the ith row of the final matrix C = AB are formed by using the component definition of the inner or dot product of the ith row (vector) of A with each of the columns (vectors) of B.
EXAMPLE 3 Matrix Multiplication
Find the product AB for the following matrices:
(a) A = , B = (b) A = , B = .
SOLUTION
From Definition 8.1.6 we have
(a) AB =
(b) AB = ≡
Unlike matrix addition, matrix multiplication is, in general, not commutative. That is, BA ≠ AB. Observe that in part (a) of Example 3, BA = , whereas in part (b) the product BA is not defined because the first matrix (in this case, B) does not have the same number of columns as the second matrix has rows.
The product of an m × n matrix with an n × 1 column vector is an m × 1 column vector. For example,
(4)
It is often convenient to write a column vector as a sum of two or more column vectors. In view of Definitions 8.1.4 and 8.1.5, the result in (4) can be written
Associative Law
Although we shall not prove it, matrix multiplication is associative. If A is an m × p matrix, B a p × r matrix, and C an r × n matrix, then the product
A(BC) = (AB)C
is an m × n matrix.
Distributive Law
If B and C are both r × n matrices and A is an m × r matrix, then the distributive law is
A(B + C) = AB + AC.
Furthermore, if the product (B + C)A is defined, then
(B + C)A = BA + CA.
DEFINITION 8.1.7 Transpose of a Matrix
The transpose of the m × n matrix (2) is the n × m matrix AT given by
In other words, the rows of a matrix A become the columns of its transpose AT.
EXAMPLE 4 Using Definition 8.1.7
(a) If A = then AT = .
(b) If B = , then BT = .
(c) If C = (7 2), then CT = . ≡
In the next theorem we give some important properties of the transpose.
THEOREM 8.1.2 Properties of Transpose
Suppose A and B are matrices and k a scalar. Then
Of course, in properties (ii) and (iii) of Theorem 8.1.2 we assume that the sum and product of A and B are defined. Note carefully that part (iii) of the theorem indicates that the transpose of the product is the product of the transposes in reverse order. Moreover, (ii) and (iii) extend to any finite sum or product of matrices. For example, in the case of three matrices we have
(A + B + C)T = AT + BT + CT and (ABC)T = CTBTAT.
Special Matrices
In matrix theory there are many special kinds of matrices that are important because they possess certain properties. The following is a list of some of these matrices:
- A matrix that consists of all zero entries is called a zero matrix and is denoted by 0. For example,
are zero matrices. If A and 0 are m × n matrices, then
A + 0 = A. (5)
In addition, A + (−A) = 0. (6)
- An n × n matrix A is said to be a triangular matrix if all its entries above the main diagonal are zeros or if all its entries below the main diagonal are zeros. In other words, a square matrix A = (aij)n×n is triangular if aij = 0 whenever i > j or aij = 0 whenever i > j. More specifically, in the first case the matrix is called lower triangular, and in the second the matrix is called upper triangular. The following two matrices are triangular:
- An n × n matrix A is said to be a diagonal matrix if all its entries not on the main diagonal are zeros. In terms of the symbolism A = (aij)n×n, A is a diagonal matrix if aij = 0 for i ≠ j. The following is a diagonal matrix:
- When the entries aii of a diagonal matrix A are all equal, it is called a scalar matrix. For example, is a scalar matrix. An n × n scalar matrix is simply a scalar multiple of a diagonal matrix in which the main diagonal entries are all equal to 1. For example, = 5 . In general, the n × n matrix
is denoted by the symbol I (or In when there is a need to emphasize the order of the matrix). For any m × n matrix A it is readily verified that Im A = A In = A. Because this last property is analogous to 1 · a = a · 1 = a, for any real number a, the matrix I is called the identity matrix.
- An n × n matrix A is said to be symmetric if AT = A; that is, A is symmetric if aij = aji for all i and j. This means that the entries in a symmetric matrix are symmetric with respect to the main diagonal of the matrix. For example, a quick inspection of the matrix
shows that it is symmetric. In addition, by taking the transpose of A we see that
AT = = A.
REMARKS
Suppose the symbol Mm,n denotes the set of all m × n matrices on which the operations of matrix addition and scalar multiplication are defined. Then
A + B is in Mm,n and kA is in Mm,n (7)
for every A and B in Mm,n and for every scalar k. That is to say, Mm,n is closed under matrix addition and scalar multiplication. When we combine (7) with properties (5) and (6) and the properties listed in Theorem 8.1.1, it follows immediately that Mm,n is a vector space. For practical purposes, the vector spaces M1,n (row vectors) and Mn,1 (column vectors) are indistinguishable from the vector space Rn.
8.1 Exercises Answers to selected odd-numbered problems begin on page ANS-18.
In Problems 1–6, state the size of the given matrix.
In Problems 7–10, determine whether the given matrices are equal.
In Problems 11 and 12, determine the values of x and y for which the matrices are equal.
In Problems 13 and 14, find the entries c23 and c12 for the matrix C = 2A − 3B.
- A = , B =
- A = , B =
- If A = and B = , find (a) A + B, (b) B − A, (c) 2A + 3B.
- If A = and B = , find (a) A − B, (b) B − A, (c) 2(A + B).
- If A = and B = , find (a) AB, (b) BA, (c) A2 = AA, (d) B2 = BB.
- If A = and B = , find (a) AB, (b) BA.
- If A = , B = , and C = , find (a) BC, (b) A(BC), (c) C(BA), (d) A(B + C).
- If A = , B = , and C =, find (a) AB, (b) BA, (c) (BA)C, (d) (AB)C.
- If A = and B = , find (a) ATA, (b) BT B, (c) A + BT.
- If A = and B = , find (a) A + BT, (b) 2AT − BT, (c) AT(A − B).
- If A = and B = , find (a) (AB)T, (b) BTAT.
- If A = and B = , find (a) AT + B, (b) 2A + BT.
In Problems 25–28, write the given sum as a single-column matrix.
In Problems 29 and 30, determine the size of the matrix A such that the given product is defined.
In Problems 31–34, suppose A = and B = . Verify the given property by computing the left and right members of the given equality.
- (AT)T = A
- (A + B)T = AT + BT
- (AB)T = BTAT
- (6A)T = 6AT
- Suppose A = . Verify that the matrix B = AAT is symmetric.
- Show that if A is an m × n matrix, then AAT is symmetric.
- In matrix theory, many of the familiar properties of the real number system are not valid. If a and b are real numbers, then ab = 0 implies that a = 0 or b = 0. Find two matrices such that AB = 0 but A ≠ 0 and B ≠ 0.
- If a, b, and c are real numbers and c ≠ 0, then ac =bc implies a = b. For matrices, AC = BC, C ≠ 0, does not necessarily imply A = B. Verify this for
and C = .
In Problems 39 and 40, let A and B be n × n matrices. Explain why, in general, the given formula is not valid.
- (A + B)2 = A2 + 2AB + B2
- (A + B)(A − B) = A2 − B2
- Write without matrices.
- Write the system of equations
as a matrix equation AX = B, where X and B are column vectors.
- Verify that the quadratic form ax2 + bxy + cy2 is the same as
- Verify that the curl of the vector field F = Pi + Qj + Rk can be written
curl F =
(Readers who are not familiar with the concept of the curl of a vector field should see Section 9.7.)
If a vector in is rotated counterclockwise about the origin through an angle then the components of the resulting vector are given by , where
The matrix M is called a rotation matrix. See FIGURE 8.1.1. In Problems 45–48, find the resulting vector b if the given vector is rotated through the indicated angle.
In Problems 49 and 50, let Find a matrix M so that represents a reflection of the vector in the given axis.
- y-axis
- x-axis
- As shown in FIGURE 8.1.2(a), a spacecraft can perform rotations called pitch, roll, and yaw about three distinct axes. To describe the coordinates of a point P we use two coordinate systems: a fixed three-dimensional Cartesian coordinate system in which the coordinates of P are (x, y, z) and a spacecraft coordinate system that moves with the particular rotation. In Figure 8.1.2(b) we have illustrated a yaw—that is, a rotation around the z-axis (which is perpendicular to the plane of the paper). The coordinates (xY, yY, zY) of the point P in the spacecraft system after the yaw are related to the coordinates (x, y, z) of P in the fixed coordinate system by the equations
where γ is the angle of rotation.
- Verify that the foregoing system of equations can be written as the matrix equation
where
- When the spacecraft performs a pitch, roll, and yaw in sequence through the angles α, β, and γ, respectively, the final coordinates of the point P in the spacecraft system (xS, yS, zS) are obtained from the sequence of transformations
Write this sequence of transformations as a matrix equation
.
The matrix MY is the same as in part (a). Identify the matrices MR and MP.
- Suppose the coordinates of a point are (1, 1, 1) in the fixed coordinate system. Determine the coordinates of the point in the spacecraft system if the spacecraft performs a pitch, roll, and yaw in sequence through the angles α = 30°, β = 45°, and γ = 60°.
- Verify that the foregoing system of equations can be written as the matrix equation
- Project
- A matrix A can be partitioned into submatrices. For example, the 3 × 5 and 5 × 2 matrices
can be written
where A11 is the upper left-hand block, or submatrix, indicated in blue in A, A12 is the upper right-hand block, and so on. Compute the product AB using the partitioned matrices.
- Investigate how partitioned matrices can be useful when using a computer to perform matrix calculations involving large matrices.
- A matrix A can be partitioned into submatrices. For example, the 3 × 5 and 5 × 2 matrices