As yet, we have used matrices only to simplify our record keeping in the solution of linear systems. But it turns out that matrices can be added and multiplied in ways similar to the ways in which numbers are added and multiplied and that these operations with matrices have far-reaching applications.
At the level of this text everyone “knows” that 2+3=5,
Two matrices A and B of the same size—the same number of rows and the same number of columns—are called equal provided that each element of A is equal to the corresponding element of B. Thus two matrices of the same size are equal provided they are elementwise equal, and we write A=B
If
then A≠B
The next two definitions are further examples of “doing it elementwise.”
If
then
but the sum A+C
Using multiplication of a matrix by a scalar, we define the negative −A
If A and B are the 2×3
and
Our first application of these matrix operations is to vectors. As mentioned in Section 3.2, a column vector (or simply vector) is merely an n×1
then we can form such combinations as
Largely for typographical reasons, we sometimes write
That is, (a1,a2,…,an)
A row vector is a 1×n
because the two matrices here have different sizes (even though they have the same elements).
Now consider the linear system
of m equations in n variables. We may regard a solution of this system as a vector
whose elements satisfy each of the equations in (5). If we want to refer explicitly to the number of elements, we may call x an n-vector.
Consider the homogeneous system
We find readily that the reduced echelon form of the augmented coefficient matrix of this system is
Hence x1
in terms of the arbitrary parameters s and t.
Now let us write the solution x=(x1,x2,x3,x4)
and “separating” the s and t parts gives
—that is,
Equation (9) expresses in vector form the general solution of the linear system in (7). It says that the vector x is a solution if and only if x is a linear combination—a sum of multiples—of the particular solutions x1=(3,4,1,0)
In the same manner as that in which we derived Eq. (9) from the equations in (8), the general solution of every homogeneous linear system can be expressed as a linear combination of particular solution vectors. For this reason (as well as others), linear combinations of vectors will play a central role in succeeding chapters.
The first surprise is that matrices are not multiplied elementwise. The initial purpose of matrix multiplication is to simplify the notation for systems of linear equations. If we write
then A, x, and b are, respectively, the coefficient matrix, the unknown vector, and the constant vector for the linear system in (5). We want to define the matrix product Ax
The first step is to define the product of a row vector a and a column vector b,
each having n elements. In this case, the product ab is defined to be
Thus ab is the sum of products of corresponding elements of a and b. For instance,
and
Note that if
then
Hence the single equation
reduces to the equation
which is a step toward the objective expressed in Eq. (11). This observation is the underlying motivation for the following definition.
That is, if the ith row of A is
and the jth column of B is
then the element in the ith row and jth column of the product AB is
If
then m=p=n=2,
Thus
For your first practice with matrix multiplication, you should compute
Note that AB≠BA.
The definition of the matrix product bears careful examination to see how it fits together. First, the fact that A is m×p
If the inside dimensions are not equal, then the product AB is not defined.
If A is a 3×2
To emphasize the fact that the ijth element of AB is the product of the ith row of A and the jth column of B, we can write
where a1,a2,…,am
in terms of the rows of A and the columns of B, then
Therefore, as mentioned earlier, the ijth element aibj
That is,
One can visualize “pouring the ith row of A down the jth column of B” until elements match in pairs, then forming the sum of the products of these pairs, to obtain the element cij
The key to accuracy and confidence in computing matrix products lies in doing it systematically. Always perform your computations in the same order. First calculate the elements of the first row of AB by multiplying the first row of A by the successive columns of B; second, calculate the elements of the second row of AB by multiplying the second row of A by the successive columns of B; and so forth.
Computing systems often are used for the calculation of products of “large” matrices. If the matrices A and B, with appropriate sizes, have been entered—as illustrated in the 3.2 Application—then the Maple command
with(linalg) : C := multiply(A,B),
or the Mathematica command
C = A.B,
or the Matlab command
C = A*B
immediately yield the product matrix C=AB
If A=[aij]
We therefore see that
if and only if x=(x1,x2,…,xn)
The system
of three equations in four unknowns is equivalent to the single matrix equation
The definitions of matrix addition and multiplication can be used to establish the rules of matrix algebra listed in the following theorem.
The only verification that is not entirely routine is that of the associative law of multiplication; see Problem 44 for an outline. Each of the others follows quickly from the corresponding law for the ordinary arithmetic of real numbers. As an illustration, we prove the first distributive law. Suppose that A=[aij]
so by (16) the ijth element of the m×n
The ijth element of the m×n
But the distributive law for real numbers, a(b+c)=ab+ac,
If a and b are real numbers, then rules such as
are even easier to verify. What all these rules amount to is this: In matrix manipulations, pairs of parentheses can be inserted or deleted in the same ways as in the ordinary algebra of real numbers.
But not all of the rules of “ordinary” algebra carry over to matrix algebra. In Example 5 we saw that multiplication of matrices is not commutative—in general, AB≠BA.
We ordinarily denote a zero matrix (whatever its size) by 0. It should be clear that for any matrix A,
where in each case 0 is a zero matrix of appropriate size. Thus zero matrices appear to play a role in the arithmetic of matrices similar to the role of the real number 0 in ordinary arithmetic.
For real numbers, the following two rules are familiar:
If ab=ac
(the “cancellation law”).
If ad=0,
The following example shows that matrices do not obey either of these rules.
If
then B≠C,
Thus the cancellation law does not generally hold for matrices. If
then
despite the fact that neither A nor D is a zero matrix. See Problems 31–38 for additional ways in which the algebra of matrices differs significantly from the familiar algebra of real numbers.
Recall that an identity matrix is a square matrix I that has ones on its principal diagonal and zeros elsewhere. Identity matrices play a role in matrix arithmetic which is strongly analogous to that of the real number 1, for which a·1=1·a=a
Similarly, if
then AI=IA=A.
If a is a nonzero real number and b=a−1,
In Problems 1–4, two matrices A and B and two numbers c and d are given. Compute the matrix cA+dB
A=[3−527],B=[−103−4],c=3,d=4
A=[20−3−156],B=[−231715],c=5,d=−3
A=[50073−1],B=[−453274],c=−2,d=4
A=[2−1040−35−27],B=[6−3−452−1079],c=7,d=5
In Problems 5–12, two matrices A and B are given. Calculate whichever of the matrices AB and BA is defined.
A=[2−132],B=[−4213]
A=[10−33242−35],B=[7−4315−2039]
A=[123],B=[345]
A=[1032−54],B=[30−1465]
A=[3−2],B=[0−231−45]
A=[2143],B=[−1043−25]
A=[3−5],B=[2756−1423]
A=[103−2],B=[2−753910]
In Problems 13–16, three matrices A, B, and C are given. Verify by computation of both sides the associative law A(BC)=(AB)C
A=[31−14],B=[25−31],C=[0123]
A=[2−1],B=[25−31],C=[6−5]
A=[32],B=[1−12],C=[200314]
A=[200314],B=[1−13−2],C=[10−123201]
In Problems 17–22, first write each given homogeneous system in the matrix form Ax=0.
x1−5x3+4x4=0x2+2x3−7x4=0
x1−3x2+6x4=0x3+9x4=0
x1+3x4−x5=0x2−2x4+6x5=0x3+x4−8x5=0
x1−3x2+7x5=0x3−2x5=0x4−10x5=0
x1−x3+2x4+7x5=0x2+2x3−3x4+4x5=0
x1−x2+7x4+3x5=0x3−x4−2x5=0
Problems 23 through 26 introduce the idea—developed more fully in the next section—of a multiplicative inverse of a square matrix.
Let
and
Find B so that AB=I=BA as follows: First equate entries on the two sides of the equation AB=I. Then solve the resulting four equations for a, b, c, and d. Finally verify that BA=I as well.
Repeat Problem 23, but with A replaced by the matrix
Repeat Problem 23, but with A replaced by the matrix
Use the technique of Problem 23 to show that if
then there does not exist a matrix B such that AB=I. Suggestion: Show that the system of four equations in a, b, c, and d is inconsistent.
A diagonal matrix is a square matrix of the form
in which every element off the main diagonal is zero. Show that the product AB of two n×n diagonal matrices A and B is again a diagonal matrix. State a concise rule for quickly computing AB. Is it clear that AB=BA? Explain.
Problems 28 through 30 develop a method of computing powers of a square matrix.
The positive integral powers of a square matrix A are defined as follows:
Suppose that r and s are positive integers. Prove that ArAs=Ar+s and that (Ar)s=Ars (in close analogy with the laws of exponents for real numbers).
If A=[abcd], then show that
where I denotes the 2×2 identity matrix. Thus every 2×2 matrix A satisfies the equation
where detA=ad−bc denotes the determinant of the matrix A, and trace A denotes the sum of its diagonal elements. This result is the 2-dimensional case of the Cayley-Hamilton theorem of Section 6.3.
The formula in Problem 29 can be used to compute A2 without an explicit matrix multiplication. It follows that
without an explicit matrix multiplication,
and so on. Use this method to compute A2, A3, A4, and A5 given
Problems 31–38 illustrate ways in which the algebra of matrices is not analogous to the algebra of real numbers.
Suppose that A and B are the matrices of Example 5. Show that (A+B)(A−B)≠A2−B2.
Suppose that A and B are square matrices with the property that AB=BA. Show that (A+B)(A−B)=A2−B2.
Suppose that A and B are the matrices of Example 5. Show that (A+B)2≠A2+2AB+B2.
Suppose that A and B are square matrices such that AB=BA. Show that (A+B)2=A2+2AB+B2.
Find four different 2×2 matrices A, with each main diagonal element either +1 or −1, such that A2=I.
Find a 2×2 matrix A with each element +1 or −1 such that A2=0. The formula of Problem 29 may be helpful.
Use the formula of Problem 29 to find a 2×2 matrix A such that A≠0 and A≠I but such that A2=A.
Find a 2×2 matrix A with each main diagonal element zero such that A2=I.
Find a 2×2 matrix A with each main diagonal element zero such that A2=−I.
This is a continuation of the previous two problems. Find two nonzero 2×2 matrices A and B such that A2+B2=0.
Use matrix multiplication to show that if x1 and x2 are two solutions of the homogeneous system Ax=0 and c1 and c2 are real numbers, then c1x1+c2x2 is also a solution.
Use matrix multiplication to show that if x0 is a solution of the homogeneous system Ax=0 and x1 is a solution of the nonhomogeneous system Ax=b, then x0+x1 is also a solution of the nonhomogeneous system.
Suppose that x1 and x2 are solutions of the nonhomogeneous system of part (a). Show that x1−x2 is a solution of the homogeneous system Ax=0.
This is a continuation of Problem 32. Show that if A and B are square matrices such that AB=BA, then
and
Let
Show that N2≠0 but N3=0.
Use the binomial formulas of Problem 41 to compute
and
Consider the 3×3 matrix
First verify by direct computation that A2=3A. Then conclude that An+1=3nA for every positive integer n.
Let A=[ahi], B=[bij], and C=[cjk] be matrices of sizes m×n, n×p, and p×q, respectively. To establish the associative law A(BC)=(AB)C, proceed as follows. By Equation (16) the hjth element of AB is
By another application of Equation (16), the hkth element of (AB)C is
Show similarly that the double sum on the right is also equal to the hkth element of A(BC). Hence the m×q matrices (AB)C and A(BC) are equal.
3.129.39.152