Lesson 9.2 · Systems and Matrices
Matrices and matrix operations
In the last lesson a matrix was just a tidy way to store a system. Matrices are much more useful than that: you can add them, scale them and multiply them, and those operations let you write an entire system of equations as one short equation. This lesson sets up the vocabulary and the arithmetic, with special attention to matrix multiplication, which works differently from anything you have multiplied before.
Matrix vocabulary
Definition
Matrix
A matrix is a rectangular array of numbers called entries. A matrix with rows and columns has dimensions (read " by "). The entry in row and column of matrix is written .
Rows always come first: both in the dimensions and in the subscripts. For example,
is a matrix, and because sits in row 2, column 3. A matrix with the same number of rows and columns is square. A matrix with a single column, such as , is a column matrix (or column vector).
Two matrices are equal when they have the same dimensions and every pair of corresponding entries is equal. That gives you one ordinary equation for each entry.
Addition, subtraction and scalar multiplication
These operations work entry by entry, just as you would guess.
- To add or subtract two matrices, they must have the same dimensions. Add or subtract corresponding entries.
- To multiply a matrix by a number (a scalar), multiply every entry by .
Worked example: A linear combination of matrices
Let and . Find .
First scale : . Then subtract entry by entry:
Matrix addition behaves like ordinary addition: it is commutative () and associative, and the zero matrix (all entries ) plays the role of .
Matrix multiplication
Multiplying matrices is not entry by entry. The product is built from rows of the first matrix and columns of the second.
Row-times-column rule
If is and is , then is the matrix whose entry in row , column is
found by multiplying matching entries and adding. The product is defined only when the number of columns of equals the number of rows of .
A quick way to check the dimensions: write them side by side. For , the inner numbers match (), so the product exists, and the outer numbers give its size, . For the inner numbers are and , so the product is undefined.
Worked example: Multiplying a 2 × 3 matrix by a 3 × 2 matrix
Find for
The product is , so is . Compute each entry as a row times a column:
So . Notice that is also defined, but it is , a completely different matrix.
Common mistake
Matrix multiplication is not commutative: in general . Sometimes one product exists and the other does not, and even for square matrices of the same size the two products usually differ. Always keep track of which matrix is on the left.
Worked example: Order matters
Let and . Then
Same two matrices, different products.
Multiplication does keep several familiar properties: it is associative, , and it distributes over addition, . Powers of a square matrix mean repeated multiplication: .
The identity matrix
The identity matrix is the matrix with s on the main diagonal (top left to bottom right) and s everywhere else:
For any square matrix of the same size, . The identity plays the role that the number plays for ordinary multiplication, and it is the key to the next lesson on inverse matrices.
Systems as matrix equations
Here is the payoff. The system
can be written as
Multiply out the left side with the row-times-column rule and you get the column , so setting it equal to the right side reproduces both equations. In short form this is , where is the coefficient matrix, is the column of variables and is the column of constants. Any linear system, no matter how many variables, fits this pattern.
Tip
To double-check a product, look at the dimensions before computing. If is , every row of has entries, and each column of must also have exactly entries for the dot products to line up.
Practice
What are the dimensions of ?
For , what is ?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Let and . What is the entry in row 2, column 1 of ?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Let and . What is the entry in row 2, column 1 of ?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.
Matrix is and matrix is . Which statement is true?
Compute .
Find if .
Enter a point like (2, -3)
Let . What is the entry in row 2, column 2 of ?
Enter a number. Fractions like 3/4 and sqrt(2) are OK.