Scalar Multiplication and Addition/Subtraction
We can multiply a matrix by a number, referred to as a scalar, by multiplying each element by that scalar.
Example: If we define
then
We can add or subtract two matrices. Just add or subtract element by element. In order for this to work, the matrices must have the same dimensions.
Example: If we define
and
then
Multiplying matrices
The approach we take to multiplying matrices will at first seem strange. However, when we put all of our matrix methods together to solve linear systems, the method we use for multiplying will make sense.
Suppose we wish to multiply the two matrices A and B together where
A = and B = .The first thing we do is analyze the dimensions of the matrices to determine if multiplication is even possible. For, unlike numbers, we can't multiply just any two matrices together. The matrices must be of the correct dimensions in order for multiplication to work. Putting the matrices side-by-side we note their dimensions in red and blue.
The number of columns in the first matrix must equal the number of rows in the second matrix in order for you to multiply them together.
These are known as the INNER dimensions.
. 2X2 2X3
these must be
the same number
Since the inner dimensions are both 2, the multiplication is possible. If they weren't the same, we would not be able to multiply the matrices. Now we look at the other dimensions.
The number of rows of the first matrix and the number of columns of the second matrix tell you the dimensions of the resulting matrix.
These are known as the OUTER dimensions.
. 2X2 2X3
these tell you
your resulting matrix
will be a 2X3 matrix
The outer dimensions tell us that the result of multiplying will be a 2X3 matrix. We can now proceed with the multiplication. The matrix we calculate, call it matrix C, will have 6 elements in it. Each element will occupy a position in the matrix designated by the subscripts shown below
Here, the subscript tells us which row and column the element is in. For example
is the element in row 1, column 2; is the element in row 2, column 3; and so on. This designation of position within the resulting matrix is very important, because the position of the element tells us how to calculate it.
The element
is found by multiplying the elements in row of matrix A by the elements in column of matrix B.
Here are the matrices again
.I will keep the elements in matrix A colored red and the elements in matrix B colored blue so you can keep track of them.
To find the value of element
we multiply row 1 of matrix A by column 1 of matrix B: = 1(6) + 4(7) = 6 + 28 = 34.To find the value of element
we multiply row 1 of matrix A by column 2 of matrix B: = 1(8) + 4(9) = 8 + 36 = 44To find the value of element
we multiply row 1 of matrix A by column 3 of matrix B: = 1(4) + 4(5) = 4 + 20 = 24To find the value of element
we multiply row 2 of matrix A by column 1 of matrix B: = 3(6) + 2(7) = 18 + 14 = 32To find the value of element
we multiply row 2 of matrix A by column 2 of matrix B: = 3(8) + 2(9) = 24 + 18 = 42To find the value of element
we multiply row 2 of matrix A by column 3 of matrix B: = 3(4) + 2(5) = 12 + 10 = 22Thefore, our matrix multiplication has yelded the following result
. = If you look closely at how we grouped the numbers, you will see why it is important for the number of columns of the first matrix to equal the number of rows of the second.
Example: Muliply
Solution: We will call these two matrices A and B. We first analyze the dimensions to see if multiplication is possible. The number of columns in the first matrix must equal the number of rows in the second matrix.
2X3 3X2
these must be
the same
The inner dimensions match, so multiplication is possible. Now we analyze the dimensions to determine the size of the resulting matrix which we can call C. The number of rows in the first and the number of columns in the second tell us the size of the resulting matrix.
2X3 3X2
these tell us that the
resulting matrix will be
a 2X2 matrix
The outer dimensions tell us that the result of multiplying will give us a 2X2 matrix.
If we refer to the elements of the resulting C matrix then we write its elements as
C =
To find the value of element
we multiply row 1 of matrix A by column 1 of matrix B: = - 4(1) + 3(6) +0(-1) = -4 +18 + 0 = 14To find the value of element
we multiply row 1 of matrix A by column 2 of matrix B: = - 4(-3) + 3(2) +0(0) = 12 + 6 + 0 = 18To find the value of element
we multiply row 2 of matrix A by column 1 of matrix B: = 5(1) + -2(6) +1(-1) = 5 - 12 - 1 = - 8To find the value of element
we multiply row 2 of matrix A by column 2 of matrix B: = 5(-3) + -2(2) +1(0) = -15 - 4 + 0 = -19That means we have done the multiplication and the result is
= Clearly this procedure takes practice and repetition. However, organization is the real key. Below is a tutorial in which you can see the process in action.
There is a way to indicate this process using some notation.
Suppose we wish to multiply matrix A by matrix B. Assume that the dimensions of the two matrices are such that multiplication is defined. That means the number of columns in A eqauls the number of rows in B. Let's say this number is
.
Let's call the resulting matrix C, so that
Then the
element of C, called can be found as
It's perhaps less confusing than it looks but verify for yourself that it is correct.
The non-commutativity of matrix multiplication
Before we did any multiplication of two matrices, we always checked their inner dimensions for compatability. The reason we did this was because
The number of columns in the first matrix must equal the number of rows in the second matrix in order for you to multiply them together.
In the three examples done above, you could see that the inner dimensions always matched, so multiplication was possible.
In the first example we looked at, we used
A = and B = . 2X2 2X3
where the dimensions of the matrices are written below them. We can always multiply a 2X2 matrix by a 2X3 matrix because the inner dimensions match. That meant that the matrix product AB was well-defined i.e. possible. However, what if we tried to multiply them in the reverse order? Is BA well-defined? This would require us to multiply a 2X3 matrix by a 2X2. Their inner dimensions do not match. So the product BA does not exist. We can't multiply them in that order.
There's more.
Suppose we multiply the following matrices together
A = and B = 2X2 2X2
where their dimensions are written below them.
If we wanted to find the matrix product AB we would have to multiply a 2X2 matrix by a 2X2 matrix. The inner dimensions match, so this is possible. Verify for yourself that the product
AB = = Now, suppose we wanted to find the matrix product BA. We would again have to multiply a 2X2 matrix by a 2X2 matrix. The inner dimensions still match so matrix multiplication is still possible. You can verify that the matrix product
BA. = = In this case, we were able to multiply the two matrices in either order because both of them were square matrices---the number of rows and columns were the same for both of them. However, the matrix we got as a result of multiplying them in the order AB was completely different from the matrix we got from multiplying them in the order BA. We can conclude that because of the peculiarities of matrix multiplication
Matrix multiplication is non-Commutative.
Another way of writing this is that, in general,
BA
AB
The above discussion illustrated that sometimes one of those orders is not even possible and even when both orders are possible, the resulting matrix may not be the same. You will be working with matrix multiplication very carefully in the future because of this fact especially when solving matrix equations.
The identity matrix
Multiply the following matrices together:
The result you should have gotten is
.Now multiply the following two matrices together:
Here the result is
Notice in each case that the matrix
did not change in any way the matrix it was multipled by. This makes the matrix very special. It is known as the 2X2 Identity matrix.
The 2X2 Identity matrix is
The symbol for this matrix is I.
This special matrix functions in matrix algebra like the number 1 functions in normal algebra. Any matrix multiplied by the identity matrix will not change.
If A is any 2X2 matrix then IA = A and AI = A.
Inverses as a substitute for division
You may have noticed that we have talked already about matrix addition, matrix subtraction, and matrix multiplication but we have not mentioned matrix division. That's because
There is NO matrix division!
We never divide matrices. This presents us with a problem. How can we solve matrix equations without division? Just think about how you would solve the simple algebraic equation
without having a process known as division? What we would have to do is replace division with a related process. If I had to solve the above equation without using division I would use, instead,
multiplication by multiplicative inverses.
so
This is a somewhat roundabout way to solve the equation
but with matrices I will be forced into doing something like this because I don't have the operation of division.Let's look closely at the above algebraic example. I had a 4 on the left side that I was trying to get rid of in order to isolate the variable x. So I multiplied both sides by 0.25. This worked because of the important fact that
and . The numbers and are known as mutliplicative inverses. In the step that followed I simpliy had which is the same as .Matrix algebra will work just like this. In matrix algebra I don't have a 1 but I do have something which functions like the number 1. I have the identity matrix I. So for any given 2X2 matrix A, I will be looking for a matrix that is the multiplicative inverse of A so that when it multiplies by A I will get the identity matrix.
The multiplicative inverse of the matrix A is known as A-1. When we multiply A by A-1 we always get the identity matrix I.
In other words AA-1 = I and A-1A = I.
Verify that the following two matrices are multiplicative inverses of one another by multiplying them together.
You should have gotten I, the 2X2 identity matrix. Verify that the following two matrices are multiplicative inverses of one another by multiplying them together
From these two examples, you may have already begun to guess how we will create the inverse matrix A-1 from the matrix A. How about this one? Are these two matrices inverses of one another?
and Not quite! When I multiply them together I don't get the identity matrix I but it's pretty close. The purpose of the following two sections is to enable you to find the inverse matrix of any 2X2 matrix that has one.
Determinants
Before we write the formula for finding an inverse we need to discuss a special number that is derived from a square matrix. This number is called the determinant of the matrix.
For any 2X2 matrix A = , its determinant is the number: det(A) = ad - bc.
Example: Find the determinant of the matrix A = Solution: det(A) = 5(3) - 4(3) = 15 - 12 = 3
Notice that the determinant of a matrix is a number, not another matrix.
Example: Find the determinant of the matrix B =
.Solution: det(B) = 7(-2) - (-3)(1) = -14 + 3 = -11
Be sure to watch those negative signs.
Example: Find the determinant of the matrix C =
Solution: det(C) = (-4)(3)-(-2)(6) = -12 + 12 = 0
With the determinant in hand we are now ready to define the inverse of a 2X2 matrix.
The inverse of a 2X2 matrix
For any 2X2 matrix A =
we define its inverse as
A-1 =
This is possibly a scary looking formula, but it's not really. What it's telling me is that to find the inverse of a matrix A I change the elements in a certain way then divide everything by the determinant. Notice how the elements a and d are switched and the elements b and c stay where they are but are multiplied by -1. Then everything is divided by the determinant. Another way to write this unwieldy formula is
A-1 = but that hardly looks any better.
Example: Find the inverse of B =
Solution: First I find the determinant. We did this in an example above and found that det(B) = 7(-2) - (-3)(1) = -14 + 3 = -11.
Therefore the inverse matrix of B is
B-1 = To simplify this, I need to multiply through by that fraction
. Then I get
B-1 = You should now verify that, as promised, the matrix B multiplied by the matrix B-1 really does give you the identity matrix I.
Example: Find the inverse matrix of E = .Solution: We first find the determinant. det(E) = 5(3) - (-3)(-2) = 15 - 6 = 9.
Therefore the inverse matrix of E is
E-1 = which is equal to
E-1 = which simplifies down to
E-1 = But don't take our word for it! Go ahead and multiply E by E-1 and verify that you actually get I.
For our final example we will retrieve a matrix whose determinant we already found above.
Example: Does the matrix C =
have an inverse?Solution: Above we found that det(C) = 0.
Now, the formula for an inverse matrix requires me to divide by the determinant. But the determinant in this case is 0 and I can never divide by 0. Consequently, I cannot proceed any further and must conclude that this matrix C does not have an inverse. I never said every matrix would have an inverse, and this one doesn't. I can generalize this example with the following statement.
If the determinant of a matrix is 0 then that matrix has no inverse.
Solving 2X2 linear systems with matrices
To some people, matrices are interesting in their own right but surely we spend lots of time fiddling around with them for a reason. What is that reason?
The reason we learn how to manipulate matrices is so that we can solve linear systems.
However, this begs another question. We already have other algebraic methods for solving linear systems. We could...
1. Graph on a calculator and use the TI-84 to get intersetions.
2. Use the method of Substitution.
3. Use the method of Elimination.
Why not use one of them. The answer to that is really two-fold.
1.) Solving linear systems with matrices is often the quickest way to do it. It is also a lot neater since it avoids messy fractions until the very last step.
2.) The matrix method generalizes to any number of equations, so that what we learn here can be employed, with the help of the calculator, to quickly and easily solve systems with any number of equations and any number of variables. It really is that powerful.
Example: Solve the linear system
Solution: We first need to transform this sytem of two equations into a single matrix equation. Using the rules of matrix multiplication, we can see that this system can be written as
= This matirx equation is made up of three matrices: the coefficient matrix A =
, the variable matrix X = and the constant matrix B = . So the matrix equation looks like this A X = B
We will solve this matrix equation using the inverse matrix A-1 and the identity matrix I. You may want to review the previous section on inverse matrices before proceeding. We have
A X = B
so if we multiply both sides of this equation by A-1 we get
A-1 A X = A-1 B
and
I X = A-1 B
X = A-1 B
What this is telling us is that our solution to the problem will be found by multiplying A-1 by B. That's it. All we have to do is find these two matrices and multiply them together.
We already have the B matrix so we only need to find A-1. Using the formula for the inverse of a 2X2 matrix we first calculate det(A) = 3(4) - 2(5) = 12 - 10 = 2. So
A-1 = Therefore our solution is found to be
A-1 B = All we need to do is multiply these together and we're done. This is a fraction multiplied by a matrix multiplied by another matrix. We will first multiply the two matrices together then multiply the fraction through. This avoids us having to deal with messy fractions until the very last step.
A-1 B =
A-1 B = so
A-1 B =
A-1 B = This is our solution to the linear system because the X matrix equals this. And the X matrix is just the matrix with the variables X =
so
That means the solution to our linear system is
and .We will streamline the process a bit in the next example so you get some idea of how quick this method can be once you've mastered it.
Example: Solve the linear system
Solution: We first write in matrix form as
= This is the matrix equation
A X = B
whose solution is
X = A-1 B
Then det(A) = 5(-2) - (-4)(7) = -10 + 28 = 14. So
A-1 B =
A-1 B =
A-1 B =
so
A-1 B = Therefore our solution is
which means and .That was pretty quick for a linear system whose solutions were not nice integers.