Learn about matrix notation, dimension, addition, and scalar multiplication. Optionally, learn the formula for matrix multiplication.
In addition to vectors, matrices are a fundamental way we can talk about higher-dimensional space. They will show up all over multivariable calculus, so let's get into it.
What is a matrix?
A matrix is an array of numbers that we surround with square brackets. The dimension of a matrix is how many rows and columns it has, which we write as
. For example, here is a matrix (pronounced "two by three"). The convention is to use uppercase letters for a variable that is a matrix.
When a matrix has the same number of rows as columns, we call it a square matrix. For example, the matrix
is non-square. We call the numbers in a matrix its elements, or its entries. To refer to an entry in a matrix, we specify its row then its column in a subscript. The convention is to use lowercase letters for matrix elements.
The transpose of a matrix is that matrix with its rows and columns switched. That is, the entry
becomes . We write to refer to the transpose of . The transpose also reverses the dimensions of a matrix, so for example is .
In general, the entries in a matrix don't have to be numbers. For example, some of the matrices we'll encounter in multivariable calculus have functions or even derivative operators as entries.
Vectors as matrices
Because a vector is just a list of numbers, we can represent it as a matrix. This is why we can write vectors with matrix notation. We can always write a given vector as a row vector (
) or as a column vector ( ). The only difference between row and column vectors is how they work in matrix multiplication.
We use the transpose here because otherwise the row vector and column vector are not technically equal, because they have different dimensions.
To learn more about the transpose of vectors, check out this video.
We can add two matrices if they have equal dimensions. The way we add them is to add corresponding components. In symbols, this says that
To get practice with matrix addition, check out this exercise.
We can multiply any matrix by a scalar, which is a fancy word for a number. When we do scalar multiplication, we multiply the scalar into every entry of the matrix. In symbols, this says that
To get practice with scalar multiplication, check out this exercise.
Matrix multiplication (optional)
This section is optional because matrix multiplication is most useful when we need to talk about
-dimensional space, while in this course we focus on 2D and 3D. Nonetheless, learning this now provides a great foundation for extending into higher dimensions later.
Unlike with addition and scalar multiplication, we do not just multiply the corresponding entries of two matrices
and to find their product. Instead, we calculate the dot product of a row vector of with a column vector of to find each entry. For example, to find of , we take the dot product of row of with column of :
In general, to find entry
of , we take the dot product of the th row of with the th column of . Here's the rest of the matrix multiplication above:
As a consequence of this definition, we can only multiply two matrices
and if has the same number of columns as has rows. Otherwise we would have to take the dot product of two vectors with different lengths.
We can always multiply two square matrices of the same dimension, such as a
with a . Other valid combinations include, for example, a with a , or a with a .
The dimension of the product matrix will be the rows of
and the columns of . Therefore, the product of a matrix with a matrix will be a matrix, which is interchangeable with a number. On a sidenote, this leads to another way we can write the dot product:
Now that we know matrix fundamentals, it's a good time to step back and think about what matrices mean. Otherwise the formulas and concepts surrounding them can feel unmotivated. The next article presents a way to visualize matrices that will give intuition into how they work. Specifically, it sheds light on how to think about the formula for matrix multiplication, and it prepares us for the final article about determinants.
Want to join the conversation?
- The Addition example is erroneous, showing 5-2 = -3(8 votes)
We can multiply any matrix by a scalar, which a fancy word for a number.
We can multiply any matrix by a scalar, which IS a fancy word for a number.(3 votes)
- Wow, why the lack of questions on this thread? Only five other responses have been made, and those were just discussing typos.(0 votes)