Matrix Multiplication
In matrix algebra, there are two kinds of matrix multiplication:
multiplication of a matrix by a number and multiplication of a
matrix by another matrix.
How to Multiply a Matrix by a Number
When you multiply a matrix by a number, you multiply every element in the matrix
by the same number. This operation produces a new matrix, which is called
a scalar multiple.
For example, if x is 5, and the matrix A is:
Then, xA = 5A and
5A = 

5 * 100 
5 * 200 

5 * 300 
5 * 400 

In the example above, every element of A is multiplied
by 5 to produce the scalar multiple, B.
Note: Some texts refer to this operation as multiplying a matrix by a
scalar. (A scalar is a real number or a symbol representing a real number.)
How to Multiply a Matrix by a Matrix
The matrix product AB is defined only
when the number of columns in A is equal to the
number of rows in B. Similarly,
the matrix product BA is defined only
when the number of columns in B is equal to the
number of rows in A.
Suppose that A is an i x j matrix, and
B is a j x k matrix. Then, the matrix
product AB results in a matrix
C, which has i rows and k columns; and
each element in C can be computed according to the
following formula.
C_{i}_{k} =
Σ_{j}
A_{i}_{j}B_{j}_{k}
where
C_{i}_{k} = the element in row i and
column k from matrix C
A_{i}_{j} = the element in row i and
column j from matrix A
B_{j}_{k} =
the element in row j and column k
from matrix B
Σ_{j} = summation sign, which indicates that the
a_{i}_{j}b_{j}_{k} terms should be
summed over j
Let's work through an example to show how the above formula works.
Suppose we want to compute
AB, given the matrices below.
Let AB = C.
Because A has 2 rows, we know that C will
have two rows; and because B has 2 columns, we know that
C will have 2 columns.
To compute the value of every element in the 2 x 2 matrix C,
we use the formula
C_{i}_{k} =
Σ_{j} A_{i}_{j}B_{j}_{k},
as shown below.
 C_{1}_{1} = Σ A_{1}_{j}B_{j}_{1}
= 0*6 + 1*8 +2*10 = 0 + 8 + 20 = 28
 C_{1}_{2} = Σ A_{1}_{j}B_{j}_{2}
= 0*7 + 1*9 +2*11 = 0 + 9 + 22 = 31
 C_{2}_{1} = Σ A_{2}_{j}B_{j}_{1}
= 3*6 + 4*8 +5*10 = = 18 + 32 + 50 = 100
 C_{2}_{2} = Σ A_{2}_{j}B_{j}_{2}
= 3*7 + 4*9 +5*11 = 21 + 36 +55 = 112
Based on the above calculations, we can say
What we did to compute Matrix C was not
complicated. All we did was to multiply row elements in
Matrix A by corresponding column elements in
Matrix B.
Multiplication Order
As we have already mentioned, in some cases, matrix multiplication is
defined for AB, but not for
BA; and vice versa. However,
even when matrix multiplication is possible in both directions,
results may be different. That is,
AB is not always equal to
BA.
Because order is important, matrix algebra jargon has evolved to
clearly indicate the order in which matrices are multiplied.
 To describe the matrix product AB,
we can say A is postmultiplied
by B; or we can say that B is
premultiplied by A.
 Similarly, to describe the matrix product
BA,
we can say B is postmultiplied
by A; or we can say that A is
premultiplied by B.
The bottom line: when you multiply two matrices, order matters.
Identity Matrix
The identity matrix is an
n x n
diagonal matrix
with 1's in the diagonal and zeros everywhere else. The identity matrix
is denoted by I or I_{n}.
Two identity matrices appear below.
The identity matrix has a unique talent. Any matrix that can be
premultiplied or postmultiplied by I remains the
same; that is:
AI = IA =
A
Test Your Understanding
Problem 1
Consider the matrices shown below  A, B,
and C
Assume that AB = C.
Which of the following statements are true?
(A) w = a*e + b*h
(B) x = a*f + b*h
(C) y = c*g + d*h
(D) All of the above
(E) None of the above
Solution
The correct answer is (B). To compute the value of any element in
matrix C, we use the formula
C_{i}_{k} = Σ_{j} A_{i}_{j}B_{j}_{k}.
In matrix C, x is the element in row 1 and column 2,
which is represented in the formula by C_{1}_{2}.
Therefore, to find x, we use the formula to calculate
C_{1}_{2}, as shown below.
x = C_{1}_{2}
= Σ_{j} A_{1}_{j}B_{j}_{2}
= A_{1}_{1}B_{1}_{2}
+ A_{1}_{2}B_{2}_{2}
= a*f + b*h
All of the other answers are incorrect.