One of the biggest impediments that some people have in
learning about matrices for the first time is trying to take everything that
they know about arithmetic of real numbers and translate that over to
matrices. As you will eventually see
much of what you know about arithmetic of real numbers will also be true here,
but there are also a few ideas/facts that will no longer hold here. To make matters worse there are some rules of
arithmetic of real numbers that will work occasionally with matrices but won’t
work in general. So, keep this in mind
as you go through the next couple of sections and don’t be too surprised when
something doesn’t quite work out as you expect it to.
This section is devoted mostly to developing the arithmetic
of matrices as well as introducing a couple of operations on matrices that
don’t really have an equivalent operation in real numbers. We will see some of the differences between
arithmetic of real numbers and matrices mentioned above in this section. We will also see more of them in the next
section when we delve into the properties of matrix arithmetic in more detail.
Okay, let’s start off matrix arithmetic by defining just
what we mean when we say that two matrices are equal.
|
Definition 1 If A and B are both  matrices then we say that A = B provided corresponding entries from each matrix are equal. Or in other words, A = B provided  for all i
and j.
Matrices of different sizes cannot be equal.
|
Next we need to move on to addition and subtraction of two
matrices.


























We now need to move into multiplication involving
matrices. However, there are actually two
kinds of multiplication to look at : Scalar Multiplication and Matrix
Multiplication. Let’s start with scalar
multiplication.
|
Definition 3 If A is any matrix and c is any number then the product (or scalar multiple), cA, is a new matrix of
the same size as A and it’s entries
are found by multiplying the original entries of A by c. In other words  for all i
and j.
|
Note that in the field of Linear Algebra a number is often
called a scalar and hence the name
scalar multiple since we are multiplying a matrix by a scalar (number). From this point on we will generally call
numbers scalars.
Before doing an example we need to get another quick
definition out of the way. If 
are all matrices of the same size and 
are scalars then the linear combination of 
with coefficients

is,
This may seem like a silly thing to define but we’ll be
using linear combination in quite a few places in this class and so we need to
get used to seeing them.
|
Example 3 Given
the matrices

compute  .
Solution
So, we’re really being asked to compute a linear
combination here. We’ll do that by
first computing the scalar multiplies and the performing the addition and
subtraction. Note as well that in the
case of the third scalar multiple we are going to consider the scalar to be a
positive  and leave the minus sign out in front of the
matrix. Here is the work for this
problem.

|
We now need to move into matrix multiplication, however
before we do the general case let’s look at a special case first since this
will help with the general case.
Suppose that we have the following two matrices,
So, a is a row
matrix and b is a column matrix and
they have the same number of entries.
Then the product of a and b is defined to be,
It is important to note that this product can only be done
if a and b have the same number of entries.
If they have a different number of entries then this product is not
defined.
|
Example 4 Compute
ab given that,

Solution
There is not really a whole lot to do here other than use
the definition given above.

|
Now let’s move onto general matrix multiplication.
So, just like with addition and subtraction, we need to be
careful with the sizes of the two matrices we’re dealing with. However, with multiplication we need to be a
little more careful. This definition
tells us that the product AB is only
defined if A (i.e. the first matrix listed in the product) has the same number of
columns as B (i.e. the second matrix listed in the product) has rows. If the number of columns of the first matrix
listed is not the same as the number of rows of the second matrix listed then
the product is not defined.
An easy way to check that a product is defined is to write
down the two matrices in the order that we want to multiply them and underneath
them write down the sizes as shown below.
If the two inner numbers are equal then the product is
defined and the size of the product will be given by the outside numbers.
|
Example 5 Compute
 and  for the following two matrices, if possible.

Solution
Okay, let’s first do  . Here are the sizes for A and C.

So, the two inner numbers (4 and 4) are the same and so
the multiplication can be done and we can see that the new size of the matrix
is  . Now, let’s actually do the
multiplication. We’ll go through the
first couple of entries in the product in detail and then do the remaining
entries a little quicker.
To get the number in the first row and first column of AC we’ll multiply the first row of A by the first column of B as follows,

If we next want the entry in the first row and second
column of AC we’ll multiply the
first row of A by the second column
of B as follows,

Okay, at this point, let’s stop and insert these into the
product so we can make sure that we’ve got our bearings. Here’s the product so far,

As we can see we’ve got four entries left to compute. For these we’ll give the row and column
multiplications but leave it to you to make sure we used the correct
row/column and put the result in the correct place. Here’s the remaining work.

Here is the completed product.

Now let’s do CA. Here are the sizes for this product.

Okay, in this case the two inner numbers (3 and 2) are NOT
the same and so this product can’t be done.
|
























So, with this example we’ve now run across the first real
difference between real number arithmetic and matrix arithmetic. When dealing with real numbers the order in
which we write a product doesn’t affect the actual result. For instance (2)(3)=6 and (3)(2)=6. We can flip the order and we get the same
answer. With matrices however, we will
have to be very careful and pay attention to the order in which the product is
written down. As this example has shown
the product AC could be computed
while the product CA in not defined.
Now, do not take the previous example and assume that all
products will work that way. It is
possible for both AC and CA to be defined as we’ll see in the
next example.
|
Example 6 Compute
BD and DB for the given matrices, if possible.

Solution
First, notice that both of these matrices are  matrices and so both BD and DB are
defined. Again, it’s worth pointing
out that this example differs from the previous example in that both the
products are defined in this example rather than only one being defined as in
the previous example. Also note that
in both cases the product will be a new  matrix.
In this example we’re going to leave the work of verifying
the products to you. It is good
practice so you should try and verify at least one of the following products.

|








This example leads us to yet another difference (although
it’s related to the first) between real number arithmetic and matrix
arithmetic. In this example both BD and DB were defined. Notice
however that the products were definitely not the same. There is nothing wrong with this so don’t get
excited about it when it does happen.
Note however that this doesn’t mean that the two products will never be
the same. It is possible for them to be
the same and we’ll see at least one case where the two products are the same in
a couple of sections.
For the sake of completeness if A is an 
matrix and B is a 
matrix then the entry in the ith row and jth column of AB is given by the following formula,
This formula can be useful on occasion, but is really used
mostly in proofs and computer programs that compute the product of matrices.
On occasion it can be convenient to know a single row or a
single column from a product and not the whole product itself. The following theorem tells us how to get our
hands on just that.
|
Theorem 1 Assuming
that A and B are appropriately sized so that AB is defined then,
- The ith row of AB is given by the matrix product
: [ith row of A]B.
- The jth column of AB is given by the matrix product
: A[jth column of B].
|
|
Example 7 Compute
the second row and third column of AC
given the following matrices.

Solution
These are the matrices from Example 5 and so we can verify
the results of using this fact once we’re done.
Let’s find the second row first. So, according to the fact this means we
need to multiply the second row of A
by C. Here is that work.

Sure enough, this is the correct second row of the product
AC.
Next, let’s use the fact to get the third column. This means that we’ll need to multiply A by the third column of C.
Here is that work.

And sure enough, this also gives us the correct answer.
|
We can use this fact about how to get individual rows or
columns of a product as well as the idea of a partitioned matrix that we saw in
the previous sections to derive a couple of new ways to find the product of two
matrices.
Let’s start by assuming we’ve got two matrices A (size 
) and B (size 
) so we know the product AB is defined.
Now, for the first new way of finding the product let’s
partition A into its row matrices as
follows,
Now, from the fact we know that the ith row of AB
is [ith row of A]B,
or 
. Using this idea the product AB can then be written as a new
partitioned matrix as follows.
For the second new way of finding the product we’ll
partition B into its column matrices
as,
We can then use the fact that t he jth column of AB
is given by A[jth column of B]
and so the product AB can be written
as a new partitioned matrix as follows.
|
Example 8 Use
both of the new methods for computing products to find AC for the following matrices.

Solution
So, once again we know the answer to this so we can use it
to check our results against the answer from Example 5.
First, let’s use the row matrices of A. Here are the two row
matrices of A.

and here are the rows of the product.

Putting these together gives,

and this is the correct answer.
Now let’s compute the product using columns. Here are the three column matrices for C.

Here are the columns of the product.



Putting all this together as follows gives the correct
answer.

|
We can also write certain kinds of
matrix products as a linear combination of column matrices. Consider A
an 
matrix and x a 
column matrix.
We can easily compute this product directly as follows,
Now, using matrix addition we can write the resultant 
matrix as follows,
Now, each of the p
column matrices on the right above can also be rewritten as a scalar multiple
as follows.
Finally, the column matrices that are multiplied by the 
’s are nothing more than the column
matrices of A. So, putting all this together gives us,
where 
are the column matrices of A.
Written in this matter we can see that 
can be written as the linear combination of
the column matrices of A, 
,
with the entries of 
,

,
as coefficients.
|
Example 9 Compute
 directly and as a linear combination for the
following matrices.

Solution
We’ll leave it to you to verify that the direct
computation of the product gives,

Here is the linear combination method of computing the
product.

This is the same result that we got by the direct
computation.
|
Matrix multiplication also gives us a very nice and compact
way of writing systems of equations. In
fact we even saw most of it as we introduced the above idea. Let’s start out with a general system of n
equations and m unknowns.
Now, instead of thinking of these as a set of equations
let’s think of each side as a vector of size 
as follows,
In the work above we saw that the left side of this can be
written as the following matrix product,
If we now denote the coefficient matrix by A, the column matrix containing the
unknowns by x and the column matrix
containing the 
’s by b. we can write the system in the following matrix form,
In many of the section to follow we’ll write general systems
of equations as 
given its compact nature in order to save
space.
Now that we’ve gotten the basics of matrix arithmetic out of
the way we need to introduce a couple of matrix operations that don’t really
have any equivalent operations with real numbers.
On occasion you’ll see the transpose defined as follows,
Notice the difference in the subscripts. Under this definition, the entry in the ith row and jth column of A will be in the jth row and ith
column of 
.
Notice that these two definitions are really the same
definition, they just don’t look like they are the same at first glance.
|
Definition 6 If A is a square matrix of size  then the trace of A, denoted by
tr(A), is the sum of the entries on
main diagonal. Or,

If A is not square then the trace is not
defined.
|
|
Example 10 Determine
the transpose and trace (if it is defined) for each of the following
matrices.

Solution
There really isn’t all that much to do here other than to
go through the definitions. Note as
well that the trace will only not be defined for A and C since these
matrices are not square.





|
In the previous example note that 
and that 
. In these cases the matrix is called symmetric. So, in the previous example D and E are symmetric while A, B, and C, are not symmetric.