Pm1–Pm3 - Adding and multiplying matrices
A matrix lets you organise several numbers and calculate with them as one object. You learn the arithmetic in Pm1, equality and the zero and identity matrices in Pm2, and the multiplication rules in Pm3. The important change from ordinary algebra is that the order of a product can change its value.
Entries, equality and scalar arithmetic
Can two non-zero matrices multiply to give a matrix containing nothing but zeros?
For ordinary real numbers, a zero product forces at least one factor to be zero. Matrices will provide a surprise. First, you need to know what their entries mean and how their arithmetic works.
The array has two horizontal rows and three vertical columns. Its entry in row , column is . Keeping each entry in its own place matters: swapping two entries usually changes the matrix.
Matrix and equality
A matrix is a rectangular array of entries. Its order is the number of rows followed by the number of columns: the array above is a matrix. Two matrices are equal precisely when they have the same order and every pair of corresponding entries is equal. For example, , although they contain the same four numbers.
Addition and subtraction combine corresponding entries, so the two matrices must have the same order. Multiplication by a scalar, an ordinary number, multiplies every entry. These operations keep the order of the original matrix.
Entry-by-entry arithmetic
For matrices and of the same order, and a scalar :
The subscripts mean row , column .
Not in the formula booklet: learn it.
Treat a matrix subtraction like a bracket subtraction: the minus sign reaches every entry of the second matrix.
Worked example 1: combining two arrays
Question. Given and , find .
Plan. Double every entry of , then subtract corresponding entries of .
Why this step? The lower-left entry of is negative, so subtracting it adds .
Answer. .
Check. Adding back gives .
The next example changes one feature: two entries are unknown. Equality lets you turn the matrix statement into ordinary equations.
Worked example 2: unknown entries
Question. Determine and , given
Plan. Form the left-hand matrix, then equate corresponding entries.
Why this step? Matrix equality requires all four entries to agree. The other two entries already agree and impose no further condition.
Answer. and .
Check. Substitution gives and , while the off-diagonal entries remain and .
A matrix equation can contain redundant information. Check every entry, because a conflicting entry would mean that no solution exists.
Watch out
Wrong: . The upper-right sign was missed. Right: the upper-right entry is , so every entry changes sign.
In the next equation the known entries give a useful consistency check before you solve for the unknowns.
Multiplying rows by columns
A matrix product combines a row of the first matrix with a column of the second, rather than multiplying entries in matching positions.
Suppose a row lists quantities and a column lists their prices. The total is . A matrix product collects many such totals at once.
Conformable matrices
Matrices are conformable for multiplication in a given order when the first has as many columns as the second has rows. A matrix multiplied by a matrix gives a matrix. For example, is defined; is not.
The matching inner dimensions count how many products go into each entry. The outer dimensions tell you the shape of the answer.
Row-by-column multiplication
If is and is , then
Multiply matching entries of row and column , then add their products.
Not in the formula booklet: learn it.
The diagram singles out one entry. Its row number comes from the first matrix; its column number comes from the second.
[DIAGRAM: asset_name: A row meets a column; asset_slug: matrix_row_column; caption: Row 1 of A and column 2 of B produce entry 1,2 of AB; description: The first row 2, 1, 3 of a two by three matrix A is highlighted blue. The second column 1, minus 2, 0 of a three by two matrix B is highlighted clay. A separate calculation gives 2 times 1 plus 1 times minus 2 plus 3 times 0 equals 0. In the product matrix with rows 19, 0 and 6, minus 5, the top-right entry 0 is highlighted sage.]

Worked example 3: a rectangular product
Question. Find , where
Plan. Check the dimensions, then calculate the four row-by-column totals.
Why this step? A row and a column must contain the same number of entries. That is why the dimension condition comes before the arithmetic.
Answer. .
Check. Multiplying by selects its first column; applying gives , the first column of the answer.
The next example changes the size to . The rule is identical: there are nine entries to find, each made from three products. A calculator can check the complete product, but you should be able to produce it by hand too.
Worked example 4: a three-by-three product
Question. Find , where
Plan. Work across each row of the answer in turn, keeping all three terms in every dot product.
The same first-row method now uses the second row, then the third row.
Why this step? Completing one answer row at a time keeps the same left-hand row in view and reduces the chance of mixing positions.
Answer. .
Check. The last column is . In matrix mode, enter both matrices as and evaluate in that order; all nine entries agree.
A calculator is useful for checking arithmetic. Under detailed reasoning, the row-by-column calculation must still appear in your answer.
Watch out
Wrong: . A square means a matrix multiplied by itself. Right: row-by-column multiplication gives .
Keep the zeros visible in the following product until you are sure which row and column you are using.
Zero and identity matrices
Zero and one have matrix counterparts, but their sizes must fit the calculation.
The zero matrix is . Adding it to any matrix changes nothing. Multiplying a conformable matrix by a zero matrix gives a zero matrix of the product's order, because every row-by-column term contains a zero.
Zero and identity matrices
The zero matrix has every entry zero. The identity matrix is the square matrix with on its main diagonal and elsewhere. For example,
A matrix of all ones is not an identity matrix.
The diagonal ones select the entries that should survive. For instance, the first row of is times row of plus times row . Each row is copied unchanged.
Identity and zero rules
For any matrix :
The zero matrix in the sum must also be . Every defined product with a zero factor is zero.
Not in the formula booklet: learn it.
The converse of the last sentence is false. Here is the promised surprise:
Both factors are non-zero. One retains only the first coordinate, while the other retains only the second; doing both leaves nothing. So does not force either matrix to be zero, and ordinary scalar cancellation cannot simply be copied into matrix algebra.
Key idea
The identity leaves every conformable matrix unchanged. A zero product can have two non-zero matrix factors.
For a rectangular matrix the identity on the left can have a different order from the identity on the right. The dimensions tell you which one to use.
Order and brackets in a product
You may move brackets in a matrix product, but you may not freely exchange its factors.
For ordinary numbers, and . These are two different properties. Associative concerns brackets; commutative concerns order.
Associativity without commutativity
For conformable matrices,
Matrix multiplication is associative. In general,
so it is not commutative. Particular pairs can commute; sometimes only one order of product is defined.
Not in the formula booklet: learn it.
Associativity follows because either bracketing adds the same products . It lets you choose a cheaper calculation. If and are and is , calculating uses two matrix-vector products rather than first finding all nine entries of . Their order stays .
Worked example 5: testing whether matrices commute
Question. Determine whether and commute under multiplication.
Plan. Calculate both products and compare corresponding entries.
Why this step? “Not commutative in general” does not settle a question about a particular pair. The two products provide the evidence.
Answer. The upper-right entries differ, so . These matrices do not commute.
Check. On , , agreeing with . Reversing the factors gives .
The next example changes only the lower-right entry of , making both diagonal entries . This particular pair now commutes.
Worked example 6: a commuting pair
Question. Determine whether and commute.
Plan. Evaluate both orders and identify why they agree.
Why this step? Here , so multiplication on either side simply doubles every entry of .
Answer. , so this pair commutes.
Check. Both products equal , as the identity rule predicts.
The distributive rules also work, with order preserved: and . These are not in the formula booklet. In particular, expanding gives separate middle terms , which cannot generally be combined into .
Exam tip
For “Determine whether the matrices commute”, show both products and write a conclusion comparing them. Calculating two matrices without saying whether they agree leaves the reasoning unfinished.
The following pair changes the off-diagonal entry. Use equality of the complete products to find the exceptional value.
Watch out
Wrong: associativity gives . Associativity changes brackets, not factor order. For the first pair, the correct products have upper-right entries and , so .
Keep the factor order while computing both products below.
Quick Recap
- Equal matrices have the same order and equal corresponding entries; add, subtract and scale entry by entry.
- In a product, inner dimensions must match; each answer entry is a row-by-column total.
- Appropriate identity matrices leave a matrix unchanged; a zero factor makes a defined product zero.
- Matrix multiplication is associative, so brackets may move. It is not generally commutative, so factor order matters.
Yes: two non-zero matrices can have zero product, as demonstrates.