Multiplication of Matrices If A is a matrix of size m x n and B is a

M 1313
Section 2.5
1
Multiplication of Matrices
If A is a matrix of size m x n and B is a matrix of size n x p then the
product AB is defined and is a matrix of size m x p.
So, two matrices can be multiplied if and only if the number of
columns in the first matrix is equal to the number of rows in the
second matrix.
Example 1: Multiple the given matrices.
[1
2 3] is a 1 x 3 matrix
 6
 5 is a 3 x 1 matrix
 
 4
When multiplied the ending matrix will be 1 x 1.
 6
[1 2 3] 5
 4
Here is how you multiply:
a11 a12  b11 
 a × b11 + a12 × b 21 
=  11
a




 21 a 22  b 21 
a 21 × b11 + a 22 × b 21 
Example 2: Multiply the given matrices.
a.
− 2 4 − 2
 1 0  4 

 
M 1313
Section 2.5
2
1 
 2 3 − 1  
b. 
 8 
4
2
2

  
6 
Example 3: Mike and Sam have stock as follows:
BAC GM IBM TRW
200 300 100 200 
A= 
0 
100 200 400
two
Mike is this row one and Sam row
At the close of trading on a certain day, the price $/share (BAC, GM,
IBM, TRW respectively) are:
B=
AB =
54 
 48 
 
 98 
 
 82 
M 1313
Section 2.5
2
1 
 2 3 − 1  
b. 
 8 
4
2
2

  
6 
Example 3: Mike and Sam have stock as follows:
BAC GM IBM TRW
200 300 100 200 
A= 
0 
100 200 400
two
Mike is this row one and Sam row
At the close of trading on a certain day, the price $/share (BAC, GM,
IBM, TRW respectively) are:
B=
AB =
54 
 48 
 
 98 
 
 82 
M 1313
Section 2.5
3
Example 4: Multiply the following matrices if possible.
− 3

3 1 4 


1 3 0 
 − 10 9 
 6
 , B =  2 0 3  , C = 
Let A = 
 , and D = 
0
 2 4 − 1
 − 6 4
 1 2 − 1



 8
compute, if possible:
9

1
9

4 
AB
AC
Laws for Matrix Multiplication
If the products and sums are defined for the matrices A, B and C,
then
1. (AB)C = A(BC)
2. A(B + C) = AB + AC
Note: In general, matrix multiplication is not commutative – that is,
AB ≠ BA.
M 1313
Section 2.5
4
Example 5: If A and B are matrices we will look at the product AB
and BA.
− 3 4
− 1 2
B= 
A= 


 2 0
 5 7
AB =
BA =
You can not divide matrices. We use the inverse. In 2.6 you will
learn how to find and inverse. In this section we will give you some
background.
1
a−1 =
a
If a is a nonzero real number, then there exists a unique real
number such that:
a−1 • a = 1
Let’s look at matrices:
1 2 
M= 

3 4 
M
−1
1 2   − 2 1 
M • M −1 = 
  3 − 1 =
3
4

  2
2 
− 2 1 
1
= 3
−
 2
2 
1 0 
0 1 


M 1313
Section 2.5
5
Identity Matrix
The square matrix of size n having 1s along the main diagonal and
zeros elsewhere is called the identity matrix of size n.
1

0
0
The identity matrix of size n is given by I n = 
⋅
⋅

0

If A is a square matrix of size n, then I n A = AI n
0 0 0 0 0

1 0 0 0 0
0 1 0 0 0

⋅
⋅
⋅
⋅
⋅ ⋅ 
0 ⋅ ⋅ ⋅ 1 
= A.
 1 2
 x
 − 4
, X =  , and B = 
. Show that the
Example 6: Let A = 
 − 3 5
y
 12 
equation
AX = B represents a linear system of two equations in two
unknowns.
Matrix Representation
A system of linear equations may be written in a compact form with
the help of matrices.
Example 7: Given the following system of equations, write it in
matrix form.
2x − 4y + z = 6
− 3 x + 6 y − 5z = − 1
x − 3 y + 7z = 0