The row by column rule, when a product exists and its order, why AB and BA differ, and powers of a square matrix.
Lesson 4 of 9
6 min read
9 practice questions
Multiplying two matrices is not done entry by entry. Instead each row of the first matrix is combined with each column of the second. The rule looks strange at first, but it is exactly what is needed to work out totals such as a shopping bill, and it is what turns a system of equations into a single matrix equation. This lesson explains the rule, when a product exists, and the laws it does and does not obey.
Row times column
Start with a row matrix times a column matrix of the same length. Multiply the matching entries and add:
[321]52110180=[3×52+2×110+1×180]=[556]
This is a bill: buying 3 kg of rice at ₹52, 2 kg of dal at ₹110 and 1 kg of oil at ₹180 costs ₹556.
The product of two matrices
If A is of order m×n and B is of order n×p, the product AB is the m×p matrix whose entry in row i and column j is
(row i of A)×(column j of B)
worked out as above: multiply matching entries and add.
When does AB exist? Only when the number of columns of A equals the number of rows of B. A useful picture:
(m×n)×(n×p)→m×p
The inner numbers must match; the outer numbers give the order of the product.
Example 1
Find AB and BA for A=[1324] and B=[5768].
AB=[1×5+2×73×5+4×71×6+2×83×6+4×8]=[19432250]
BA=[5×1+6×37×1+8×35×2+6×47×2+8×4]=[23313446]
So AB=BA. Matrix multiplication is not commutative: the order of the factors matters.
Example 2
Let C=[132−104] (2×3) and E=20−1132 (3×2). Find CE and EC.
Ravi buys 3 kg of rice, 2 kg of dal and 1 kg of oil. The prices per kg at two shops are given by the columns of 5211018060104170 (rows: rice, dal, oil). Where is his shopping cheaper?
[321]5211018060104170=[556558]
The bill is ₹556 at the first shop and ₹558 at the second, so the first shop is cheaper by ₹2.
Laws of multiplication
Whenever the products exist:
(AB)C=A(BC) (associative law)
A(B+C)=AB+AC and (A+B)C=AC+BC (distributive laws)
AI=IA=A for a square matrix A and the identity matrix I of the same order
k(AB)=(kA)B=A(kB) for a scalar k
Two familiar laws of numbers fail for matrices:
In general AB=BA (Example 1).
AB=O does not force A=O or B=O. For example,
[1111][1−1−11]=[1−11−1−1+1−1+1]=[0000]
even though neither factor is the zero matrix.
Powers of a square matrix
For a square matrix, A2=AA, A3=A2A, and so on.
Example 4
If A=[2112], show that A2−4A+3I=O.
A2=[4+12+22+21+4]=[5445]
A2−4A+3I=[5445]−[8448]+[3003]=[0000]
Practice
If A is 3×4 and B is 4×2, does AB exist? What is its order? Does BA exist?
Find [123]456.
Find 456[123].
For A=[2103] and B=[1−142], find AB and BA.
For A=[100121] and B=131201, find AB.
If A=[1221], show that A2−2A−3I=O.
Find A2 for A=[0010]. What does this show?
For A=[1011], find A2 and A3.
Sita buys 4 pens and 3 notebooks. Pens cost ₹10 and notebooks ₹30 at one shop, and ₹12 and ₹28 at another. Use a matrix product to find her bill at each shop.
Answers
Show answers
Yes: columns of A (4) equal rows of B (4), so AB is 3×2. BA would need the 2 columns of B to match the 3 rows of A, so it does not exist.
[4+10+18]=[32].
A 3×3 matrix: 45681012121518.
AB=[2−2810] and BA=[60126].
AB=[1+0+20+3+12+0+20+0+1]=[3441].
A2=[5445], and [5445]−[2442]−[3003]=O.
A2=O, although A=O. A non-zero matrix can have a zero square.
A2=[1021] and A3=[1031].
[43][10301228]=[130132]: ₹130 at the first shop and ₹132 at the second.