3.4 Matrix Operations

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,2+3=5, and we do not dwell on the underlying meaning of this equation. But in the case of matrices we must begin with precise definitions of what the familiar language of algebra is to mean when it is applied to matrices rather than to numbers.

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=BA=B to denote equality of the two matrices A and B.

Example 1

If

A=[3456],B=[3457],andC=[347568],
A=[3546],B=[3547],andC=[354678],

then ABAB because a22=6,a22=6, whereas b22=7,b22=7, and ACAC because the matrices A and C are not of the same size.

The next two definitions are further examples of “doing it elementwise.”

Example 2

If

A=[301275],B=[436902],andC=[3216],
A=[320715],B=[493062],andC=[3126],

then

A+B=[7351173],
A+B=[7113753],

but the sum A+CA+C is not defined because the matrices A and C are not of the same size.

Using multiplication of a matrix by a scalar, we define the negative AA of the matrix A and the difference ABAB of the two matrices A and B by writing

A=(1)AandAB=A+(B).
A=(1)AandAB=A+(B).

Example 3

If A and B are the 2×32×3 matrices of Example 2, then

3A=[90362115],B=[436902],
3A=[96021315],B=[493062],

and

3AB=[53932117].
3AB=[53321917].

Vectors

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×1n×1 matrix, one having a single column. We normally use boldface lowercase letters, rather than lightface uppercase letters, to denote vectors. If

a=[625]andb=[234],
a=625andb=234,

then we can form such combinations as

3a+2b=[18615]+[468]=[1407].
3a+2b=18615+468=1407.

Largely for typographical reasons, we sometimes write

a=[a1a2an]=(a1,a2,,an).
a=a1a2an=(a1,a2,,an).
(3)

That is, (a1,a2,,an)(a1,a2,,an) is simply another notation for the column vector with elements a1,a2,,an.a1,a2,,an. It should not be confused with the row vector

[a1a2an].
[a1a2an].
(4)

A row vector is a 1×n1×n (rather than n×1n×1) matrix having a single row, and

(3, 2, 1)=[321][321]
(3, 2, 1)=321[321]

because the two matrices here have different sizes (even though they have the same elements).

Now consider the linear system

a11x1+a12x2+a13x3++a1nxn=b1a21x1+a22x2+a23x3++a2nxn=b2am1x1+am2x2+am3x3++amnxn=bm
a11x1a21x1am1x1+++a12x2a22x2am2x2+++a13x3a23x3am3x3++++++a1nxna2nxnamnxn===b1b2bm
(5)

of m equations in n variables. We may regard a solution of this system as a vector

x=[x1x2x3xn]=(x1,x2,x3,,xn)
x=x1x2x3xn=(x1,x2,x3,,xn)
(6)

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.

Example 4

Consider the homogeneous system

x1+3x215x3+7x4=0x1+4x219x3+10x4=02x1+5x226x3+11x4=0.
x1x12x1+++3x24x25x215x319x326x3+++7x410x411x4===000.
(7)

We find readily that the reduced echelon form of the augmented coefficient matrix of this system is

[103200143000000].
100010340230000.

Hence x1x1 and x2x2 are leading variables and x3x3 and x4x4 are free variables. In the manner of Sections 3.2 and 3.3, we therefore see that the infinite solution set of the system in (7) is described by the equations

x4=t,x3=s,x2=4s3t,x1=3s+2t
x4x3x2x1====t,s,4s3t,3s+2t
(8)

in terms of the arbitrary parameters s and t.

Now let us write the solution x=(x1,x2,x3,x4)x=(x1,x2,x3,x4) in vector notation. The equations in (8) yield

x=[x1x2x3x4]=[3s+2t4s3tst],
x=x1x2x3x4=3s+2t4s3tst,

and “separating” the s and t parts gives

x=[3s4ss0]+[2t3t0t]=s[3410]+t[2301]
x=3s4ss0+2t3t0t=s3410+t2301

—that is,

x=s(3,4,1,0)+t(2,3,0,1)=sx1+tx2.
x=s(3,4,1,0)+t(2,3,0,1)=sx1+tx2.
(9)

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)x1=(3,4,1,0) and x2=(2,3,0,1).x2=(2,3,0,1). The parameters s and t are simply the coefficients in this “sum of multiples.”

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.

Matrix Multiplication

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

A=[aij],x=[x1x2xn],andb=[b1b2bm],
A=[aij],x=x1x2xn,andb=b1b2bm,
(10)

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 AxAx in such a way that the entire system of linear equations reduces to the single matrix equation

Ax=b.
Ax=b.
(11)

The first step is to define the product of a row vector a and a column vector b,

a=[a1a2an]andb=[b1b2bn],
a=[a1a2an]andb=b1b2bn,

each having n elements. In this case, the product ab is defined to be

ab=a1b1+a2b2++anbn.
ab=a1b1+a2b2++anbn.
(12)

Thus ab is the sum of products of corresponding elements of a and b. For instance,

[23][35]=(2)(3)+(3)(5)=9
[23][35]=(2)(3)+(3)(5)=9

and

[3017][5234]=35+02+(1)(3)+74=46.
[3017]5234=35+02+(1)(3)+74=46.

Note that if

a=[a1a2an]andx=[x1x2xn],
a=[a1a2an]andx=x1x2xn,

then

ax=a1x1+a2x2++anxn.
ax=a1x1+a2x2++anxn.

Hence the single equation

a1x1+a2x2++anxn=b
a1x1+a2x2++anxn=b
(13)

reduces to the equation

ax=b,
ax=b,
(14)

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

[ai1ai2ai3aip]
[ai1ai2ai3aip]

and the jth column of B is

[b1jb2jb3jbpj],
b1jb2jb3jbpj,

then the element in the ith row and jth column of the product AB is

ai1b1j+ai2b2j+ai3b3j++aipbpj.
ai1b1j+ai2b2j+ai3b3j++aipbpj.

Example 5

If

A=[2143]andB=[1537],
A=[2413]andB=[1357],

then m=p=n=2,m=p=n=2, so AB will also be a 2×22×2 matrix. To find AB, we calculate sums of products as follows:

AB, row 1, column 1:(2)(1)+(1)(3)=1;AB, row 1, column 2:(2)(5)+(1)(7)=3;AB, row 2, column 1:(4)(1)+(3)(3)=5;AB, row 2, column 2:(4)(5)+(3)(7)=1.
AB, row 1, column 1:AB, row 1, column 2:AB, row 2, column 1:AB, row 2, column 2:(2)(1)+(1)(3)(2)(5)+(1)(7)(4)(1)+(3)(3)(4)(5)+(3)(7)====1;3;5;1.

Thus

AB=[1351].
AB=[1531].

For your first practice with matrix multiplication, you should compute

BA=[1537][2143]=[18142218].
BA=[1357][2413]=[18221418].

Note that ABBA.ABBA. This shows that multiplication of matrices is not commutative! We must therefore be careful about the order in which we write the matrices in a matrix product.

The definition of the matrix product bears careful examination to see how it fits together. First, the fact that A is m×pm×p and B is p×np×n implies that the number of columns of A is equal to the number of rows of B. If so, then the size of the product AB is obtained by a sort of cancellation of the “inside” dimensions:

If the inside dimensions are not equal, then the product AB is not defined.

Example 6

If A is a 3×23×2 matrix and B is a 2×32×3 matrix, then AB will be a 3×33×3 matrix, whereas BA will be a 2×22×2 matrix. If C is a 3×53×5 matrix and D is a 5×75×7 matrix, then CD will be a 3×73×7 matrix, but DC is undefined.

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,,ama1,a2,,am denote the m row vectors of A and b1,b2,,bnb1,b2,,bn denote the n column vectors of B. More briefly, if

A=[a1a2am]andB=[b1b2bn]
A=a1a2amandB=[b1b2bn]

in terms of the rows of A and the columns of B, then

AB=[aibj].
AB=[aibj].
(15)

Therefore, as mentioned earlier, the ijth element aibjaibj of AB is given in terms of elements of A and B by

aibj=[ai1ai2aip][b1jb2jbpj]=ai1b1j+ai2b2j++aipbpj.
aibj=[ai1ai2aip]b1jb2jbpj=ai1b1j+ai2b2j++aipbpj.

That is,

aibj=pk=1aikbkj.
aibj=k=1paikbkj.
(16)

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 cijcij of the matrix C=ABC=AB.

Suggestion

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=ABC=AB.

Matrix Equations

If A=[aij]A=[aij] is an m×nm×n coefficient matrix and x=(x1,x2,,xn)x=(x1,x2,,xn) is an n×1n×1 variable (column) matrix, then the product Ax is the m×1m×1 matrix

Ax=[a11a12a1na21a22a2nam1am2amn][x1x2xn]=[a11x1+a12x2++a1nxna21x1+a22x2++a2nxnam1x1+am2x2++amnxn](?)=[b1b2bm]=b.
Ax==a11a21am1a12a22am2a1na2namnx1x2xna11x1a21x1am1x1+++a12x2a22x2am2x2++++++a1nxna2nxnamnxn=(?)b1b2bm=b.

We therefore see that

Ax=b
Ax=b
(17)

if and only if x=(x1,x2,,xn)x=(x1,x2,,xn) is a solution of the linear system in (5). Thus, matrix multiplication enables us to “boil down” a system of m scalar equations in n unknowns to the single matrix equation in (17), which is analogous in notation to the single scalar equation ax=bax=b in a single variable x.

Example 7

The system

3x14x2+x3+7x4=104x15x3+2x4=0x1+9x2+2x36x4=5
3x14x1x1+4x29x2++x35x32x3++7x42x46x4===1005

of three equations in four unknowns is equivalent to the single matrix equation

[341740521926][x1x2x3x4]=[1005].
341409152726x1x2x3x4=1005.

Matrix Algebra

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]A=[aij] is an m×pm×p matrix and that B=[bij]B=[bij] and C=[cij]C=[cij] are p×np×n matrices. Then

B+C=[bij+cij],
B+C=[bij+cij],

so by (16) the ijth element of the m×nm×n matrix A(B+C)A(B+C) is

pk=1aik(bkj+ckj).
k=1paik(bkj+ckj).
(18)

The ijth element of the m×nm×n matrix AB+ACAB+AC is

pk=1aikbkj+pk=1aikckj=pk=1(aikbkj+aikckj).
k=1paikbkj+k=1paikckj=k=1p(aikbkj+aikckj).
(19)

But the distributive law for real numbers, a(b+c)=ab+ac,a(b+c)=ab+ac, tells us that corresponding terms of the sums in (18) and (19) are equal. Hence, the ijth terms of the two m×nm×n matrices A(B+C)A(B+C) and AB+ACAB+AC are equal, and so these matrices are equal: A(B+C)=AB+ACA(B+C)=AB+AC.

If a and b are real numbers, then rules such as

(a+b)C=aC+bC,(ab)C=a(bC),a(BC)=(aB)C
(a+b)C=aC+bC,(ab)C=a(bC),a(BC)=(aB)C

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, ABBA.ABBA. Other exceptions are associated with zero matrices. A zero matrix is one whose elements are all zero, such as

[0000],[000000],[000000],[00].
[0000],[000000],000000,[00].

We ordinarily denote a zero matrix (whatever its size) by 0. It should be clear that for any matrix A,

0+A=A=A+0,A0=0,and0A=0,
0+A=A=A+0,A0=0,and0A=0,

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=acab=ac and a0,a0, then b=cb=c

    (the “cancellation law”).

  • If ad=0,ad=0, then either a=0a=0 or d=0d=0.

The following example shows that matrices do not obey either of these rules.

Example 8

If

A=[41273115],B=[15312423],andC=[34212313],
A=[43112175],B=13225143,andC=32214133,

then BC,BC, but

AB=[2510185]=AC.(Check this!)
AB=[2518105]=AC.(Check this!)

Thus the cancellation law does not generally hold for matrices. If

D=BC=[21120110],
D=BC=21011210,

then

AD=[0000]=0,
AD=[0000]=0,

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=aa1=1a=a for all values of the real number a. For instance, you can check that

[abcd][1001]=[1001][abcd]=[abcd].
[acbd][1001]=[1001][acbd]=[acbd].

Similarly, if

A=[a11a12a13a21a22a23a31a32a33]andI=[100010001],
A=a11a21a31a12a22a32a13a23a33andI=100010001,

then AI=IA=A.AI=IA=A. For instance, the element in the second row and third column of AI is

(a21)(0)+(a22)(0)+(a23)(1)=a23.
(a21)(0)+(a22)(0)+(a23)(1)=a23.

If a is a nonzero real number and b=a1,b=a1, then ab=ba=1.ab=ba=1. Given a nonzero square matrix A, the question as to whether there exists an inverse matrix B, one such that AB=BA=I,AB=BA=I, is more complicated and is investigated in Section 3.5.

3.4 Problems

In Problems 1–4, two matrices A and B and two numbers c and d are given. Compute the matrix cA+dBcA+dB.

  1. A=[3527],B=[1034],c=3,d=4A=[3257],B=[1304],c=3,d=4

     

  2. A=[203156],B=[231715],c=5,d=3A=[210536],B=[273115],c=5,d=3

     

  3. A=[500731],B=[453274],c=2,d=4A=503071,B=437524,c=2,d=4

     

  4. A=[210403527],B=[634521079],c=7,d=5A=245102037,B=650327419,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.

  1. A=[2132],B=[4213]A=[2312],B=[4123]

     

  2. A=[103324235],B=[743152039]A=132023345,B=710453329

     

  3. A=[123],B=[345]A=[123],B=345

     

  4. A=[103254],B=[301465]A=[120534],B=316045

     

  5. A=[32],B=[023145]A=[32],B=034215

     

  6. A=[2143],B=[104325]A=[2413],B=[130245]

     

  7. A=[35],B=[27561423]A=[35],B=[21745263]

     

  8. A=[1032],B=[2753910]A=[1032],B=[2379510]

In Problems 13–16, three matrices A, B, and C are given. Verify by computation of both sides the associative law A(BC)=(AB)CA(BC)=(AB)C.

  1. A=[3114],B=[2531],C=[0123]A=[3114],B=[2351],C=[0213]

     

  2. A=[21],B=[2531],C=[65]A=[21],B=[2351],C=[65]

     

  3. A=[32],B=[112],C=[200314]A=[32],B=[112],C=201034

     

  4. A=[200314],B=[1132],C=[10123201]A=201034,B=[1312],C=[13021021]

In Problems 17–22, first write each given homogeneous system in the matrix form Ax=0.Ax=0. Then find the solution in vector form, as in Eq. (9).

  1. x15x3+4x4=0x2+2x37x4=0x1x2+5x32x3+4x47x4==00

     

  2. x13x2+6x4=0x3+9x4=0x13x2x3++6x49x4==00

     

  3. x1+3x4x5=0x22x4+6x5=0x3+x48x5=0x1x2x3++3x42x4x4+x56x58x5===000

     

  4. x13x2+7x5=0x32x5=0x410x5=0x13x2x3x4+7x52x510x5===000

     

  5. x1x3+2x4+7x5=0x2+2x33x4+4x5=0x1x2+x32x3+2x43x4++7x54x5==00

     

  6. x1x2+7x4+3x5=0x3x42x5=0

Problems 23 through 26 introduce the idea—developed more fully in the next section—of a multiplicative inverse of a square matrix.

  1. Let

    A=[2132],B=[abcd],

    and

    I=[1001].

    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.

  2. Repeat Problem 23, but with A replaced by the matrix

    A=[3457].
  3. Repeat Problem 23, but with A replaced by the matrix

    A=[5723].
  4. Use the technique of Problem 23 to show that if

    A=[1224],

    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.

  5. A diagonal matrix is a square matrix of the form

    [a10000a20000a30000an],

    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.

  1. The positive integral powers of a square matrix A are defined as follows:

    A1=A,A2=AA,A3=AA2,A4=AA3,,An+1=AAn,.

    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).

  2. If A=[abcd], then show that

    A2=(a+d)A(adbc)I,

    where I denotes the 2×2 identity matrix. Thus every 2×2 matrix A satisfies the equation

    A2(trace A)A+(det A)I=0

    where detA=adbc 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.

  3. The formula in Problem 29 can be used to compute A2 without an explicit matrix multiplication. It follows that

    A3=(a+d)A2(adbc)A

    without an explicit matrix multiplication,

    A4=(a+d)A3(adbc)A2,

    and so on. Use this method to compute A2, A3, A4, and A5 given

    A=[2112].

Problems 31–38 illustrate ways in which the algebra of matrices is not analogous to the algebra of real numbers.

    1. Suppose that A and B are the matrices of Example 5. Show that (A+B)(AB)A2B2.

    2. Suppose that A and B are square matrices with the property that AB=BA. Show that (A+B)(AB)=A2B2.

    1. Suppose that A and B are the matrices of Example 5. Show that (A+B)2A2+2AB+B2.

    2. Suppose that A and B are square matrices such that AB=BA. Show that (A+B)2=A2+2AB+B2.

  1. Find four different 2×2 matrices A, with each main diagonal element either +1 or 1, such that A2=I.

  2. Find a 2×2 matrix A with each element +1 or 1 such that A2=0. The formula of Problem 29 may be helpful.

  3. Use the formula of Problem 29 to find a 2×2 matrix A such that A0 and AI but such that A2=A.

  4. Find a 2×2 matrix A with each main diagonal element zero such that A2=I.

  5. Find a 2×2 matrix A with each main diagonal element zero such that A2=I.

  6. This is a continuation of the previous two problems. Find two nonzero 2×2 matrices A and B such that A2+B2=0.

  7. 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.

    1. 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.

    2. Suppose that x1 and x2 are solutions of the nonhomogeneous system of part (a). Show that x1x2 is a solution of the homogeneous system Ax=0.

  8. This is a continuation of Problem 32. Show that if A and B are square matrices such that AB=BA, then

    (A+B)3=A3+3A2B+3AB2+B3

    and

    (A+B)4=A4+4A3B+6A2B2+4AB3+B4.
  9. Let

    A=[120012001]=[100010001]+[020002000]=I+N.
    1. Show that N20 but N3=0.

    2. Use the binomial formulas of Problem 41 to compute

      A2=(I+N)2=I+2N+N2,A3=(I+N)3=I+3N+3N2,

      and

      A4=(I+N)4=I+4N+6N2.
  10. Consider the 3×3 matrix

    A=[211121112].

    First verify by direct computation that A2=3A. Then conclude that An+1=3nA for every positive integer n.

  11. 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

    ni=1ahibij.

    By another application of Equation (16), the hkth element of (AB)C is

    pj=1(ni=1ahibij)cjk=ni=1pj=1ahibijcjk.

    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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.14.247.117