4. Multiplication of Matrices
Important: We can only multiply matrices if the number of columns in the first matrix is the same as the number of rows in the second matrix.
Examples
Multiplying a 2 × 3 matrix by a 3 × 4 matrix is possible and it gives a 2 × 4 matrix as the answer.
Multiplying a 7 × 1 matrix by a 1 × 2 matrix is okay; it gives a 7 × 2 matrix
A 4 × 3 matrix times a 2 × 3 matrix is NOT possible.
How to Multiply 2 Matrices
We use letters first to see what is going on. We'll see a numbers example after.
As an example, let's take a general 2 × 3 matrix multiplied by a 3 × 2 matrix.
The answer will be a 2 × 2 matrix.
We multiply and add the elements as follows. We work across the 1st row of the first matrix, multiplying down the 1st column of the second matrix, element by element. We add the resulting products. Our answer goes in position a11 (top left) of the answer matrix.

We do a similar process for the 1st row of the first matrix and the 2nd column of the second matrix. The result is placed in position a12.

Now for the 2nd row of the first matrix and the 1st column of the second matrix. The result is placed in position a21.

Finally, we do the 2nd row of the first matrix and the 2nd column of the second matrix. The result is placed in position a22.

So the result of multiplying our 2 matrices is as follows:

Now let's see a number example.
Example
Multiply:
Multiplying 2 × 2 Matrices
The process is the same for any size matrix. We multiply across rows of the first matrix and down columns of the second matrix, element by element. We then add the products:
In this case, we multiply a 2 × 2 matrix by a 2 × 2 matrix and we get a 2 × 2 matrix as the result.
Example
Multiply:
Here is a (2×2)×(2×2) example in LiveMath.
Let's look at another example. This time we have (3×3)×(3×1).
Flash Interactive
Here's a Flash movie to play with. It will generate many different sized (up to 5 by 5) matrices with different random numbers each time. You can see plenty of examples of matrix operations, including adding, subtracting and multiplying.
You can step through each calculation involved. You can do this by clicking the "step" button which appears.
Suggestion: Work out the answer yourself first, then check your answer against what it says. Never just copy!
Matrices and Systems of Simultaneous Linear Equations
We now see how to write a system of linear equations using matrix multiplication.
Example:
The system of equations
can be written as:
Matrices are ideal for computer-driven solutions of problems because computers easily form arrays. We can leave out the algebraic symbols. A computer only requires the first and last matrices to solve the system, as we will see in Matrices and Linear Equations.
Note 1 - Notation
Care with writing matrix multiplication.
The following expressions have different meanings:
AB is matrix multiplication
A×B cross product, which returns a vector
A*B used in computer notation, but not on paper
A•B dot product, which returns a scalar.
Note 2 - Commutativity of Matrix Multiplication
Does AB = BA?
Let's see if it is true using an example.
Example
If
and
find AB and BA.
In general, when multiplying matrices, the commutative law doesn't hold, i.e. AB ≠ BA. There are two common exceptions to this:
- The identity matrix: IA = AI = A.
- The inverse of a matrix: A-1A = AA-1 = I.
In the next section we learn how to find the inverse of a matrix.
Example - Multiplying by the Identity Matrix
Given that
find AI.
Exercises
1. If possible, find BA and AB.

![]()
2. Determine if B = A-1.
3. In studying the motion of electrons, one of the Pauli spin matrices is
where
Show that s2 = I.
[If you have never seen j before, go to the section on complex numbers].
4. Evaluate the following matrix multiplication which is used in directing the motion of a robotic mechanism.
Here is a Java applet (the only one on Interactive Mathematics) which also demonstrates matrix multiplication.
Matrix Multiplication Java Applet
Tutors from Harvard, Penn, Cornell and other top US schools are online and ready to help.
First 30 minutes are free!
Visit ziizoo.com
Book mark this page in Del.icio.us, Furl, Digg, StumbleUpon, whatever...
Didn't find what you are looking for? Try search:
Need a break? Play a math game. Well, they all involve math... No, really!

















