• Practice
  • About 18 min
  • 5 practice questions

Algebra of matrices: addition, scalar multiplication and multiplication

Add, subtract and scale matrices, multiply conformable matrices row by column, and see why AB need not equal BA, why cancellation fails and how AB can be O.

If something looks wrong, please tell us.

By the end of this lesson you can

  • Find kA, A + B and A − B, and state when they are defined.
  • Decide whether A and B are conformable for multiplication and find the order of AB.
  • Multiply matrices using the row-by-column rule.
  • Explain how matrix multiplication differs from multiplication of real numbers, and use its properties.

Matrices are useful only because we can calculate with them. The basic operations are multiplying by a scalar, adding or subtracting, and multiplying two matrices. There is no division of one matrix by another, so an expression A/B is not defined. Multiplication is the operation that behaves most unlike ordinary numbers, so it gets most attention here.

Scalar multiplication, addition and subtraction

For a scalar k and A = [aᵢⱼ]ₘₓₙ, kA = [k·aᵢⱼ]ₘₓₙ: every entry is multiplied by k. With k = −1 we get −A = [−aᵢⱼ], called the negative of A (not a 'negative matrix'). If A and B have the same order, A + B = [aᵢⱼ + bᵢⱼ] and A − B = A + (−1)B = [aᵢⱼ − bᵢⱼ]. If the orders differ, A + B and A − B are not defined.

Worked example 1: a combination

Let A = [2 −1; 3 4] and B = [1 5; −2 0]. Find 3A − 2B. Working: 3A = [6 −3; 9 12] and 2B = [2 10; −4 0]. Subtract entry by entry: 6 − 2 = 4, −3 − 10 = −13, 9 − (−4) = 13, 12 − 0 = 12. So 3A − 2B = [4 −13; 13 12].

Multiplication of matrices

A is conformable for multiplication with B when the number of columns of A equals the number of rows of B. If A is m × n and B is n × p, then AB exists and has order m × p. Its (i, j)th entry is found by the row-by-column rule: multiply the entries of row i of A by the matching entries of column j of B and add, cᵢⱼ = aᵢ₁b₁ⱼ + aᵢ₂b₂ⱼ + ... + aᵢₙbₙⱼ.

Multiplying A (m × n) by B (n × p)

  1. Check conformability Columns of A must equal rows of B (both n).
  2. Fix the order AB will be m × p.
  3. Row i times column j Multiply matching entries and add to get cᵢⱼ.
  4. Repeat for every i and j Fill all m × p places, then check one entry again.

Worked example 2: AB and BA

Let A = [1 2 0; 3 −1 4] (2 × 3) and B = [2 1; 0 3; −1 2] (3 × 2). AB is 2 × 2. Row 1 of A with column 1 of B: 1·2 + 2·0 + 0·(−1) = 2; with column 2: 1·1 + 2·3 + 0·2 = 7. Row 2 with column 1: 3·2 + (−1)·0 + 4·(−1) = 2; with column 2: 3·1 + (−1)·3 + 4·2 = 8. So AB = [2 7; 2 8]. BA is 3 × 3: row 1 of B, [2 1], gives [2·1 + 1·3, 2·2 + 1·(−1), 2·0 + 1·4] = [5 3 4]; row 2, [0 3], gives [9 −3 12]; row 3, [−1 2], gives [−1 + 6, −2 − 2, 0 + 8] = [5 −4 8]. So BA = [5 3 4; 9 −3 12; 5 −4 8]. AB and BA are not even of the same order.

Worked example 3: costing gift packs

With made-up prices, a mango costs ₹25, a banana ₹5 and a guava ₹10. Pack I holds 4 mangoes, 6 bananas, 2 guavas; Pack II holds 6, 12, 4; Pack III holds 2, 10, 6. Put the prices in a row matrix P = [25 5 10] and the contents in Q = [4 6 2; 6 12 10; 2 4 6], one column per pack. Then PQ = [25·4 + 5·6 + 10·2, 25·6 + 5·12 + 10·4, 25·2 + 5·10 + 10·6] = [150 250 160]. Pack I costs ₹150, Pack II ₹250 and Pack III ₹160.

How matrix multiplication differs from numbers

  • AB = BA need not hold. For A = [1 1; 0 0] and B = [1 0; 1 0], AB = [2 0; 0 0] but BA = [1 1; 1 1]. When AB = BA we say A and B commute.
  • Cancellation fails. For A = [1 0; 0 0], B = [1 2; 3 4] and C = [1 2; 5 6], AB = [1 2; 0 0] = AC, yet B ≠ C.
  • AB = O is possible with A ≠ O and B ≠ O. For A = [1 1; 1 1] and B = [1 −1; −1 1], every entry of AB is 1 − 1 = 0.
  • Identities need care. (A + B)² = A² + AB + BA + B², which equals A² + 2AB + B² only when AB = BA. Likewise A² − B² need not equal (A + B)(A − B).

Properties that do hold

PropertyStatement (orders suitable)
Addition is commutativeA + B = B + A
Addition is associative(A + B) + C = A + (B + C)
Additive identity and inverseA + O = A; A + (−A) = O
Scalarsk(A + B) = kA + kB; (a + b)A = aA + bA; a(bA) = (ab)A
Multiplication is associativeA(BC) = (AB)C
Distributive lawsA(B + C) = AB + AC; (A + B)C = AC + BC
Scalars and productsα(AB) = (αA)B = A(αB)
Multiplicative identityAI = IA = A

Worked example 4: using A² = A

If A is square with A² = A, simplify (I + A)². Working: I and A commute (IA = AI = A), so (I + A)² = I² + IA + AI + A² = I + A + A + A = I + 3A. Here I² = I and A² = A were used.

AB exists when columns of A = rows of B; (m × n)(n × p) = m × p. Entry cᵢⱼ = row i of A times column j of B. In general AB ≠ BA.

— Matrix multiplication

Key takeaways: add and subtract only matrices of the same order; scalar multiplication scales every entry; multiplication needs conformability and uses row by column; it is associative and distributive, but not commutative, has no cancellation law, and can give O from non-zero factors.

Check your understanding

  1. 1. A is of order 3 × 2 and B is of order 2 × 4. What is the order of AB, and does BA exist?

    1. 3 × 4; BA does not exist
    2. 2 × 2; BA exists
    3. 3 × 4; BA is 4 × 3
    4. 4 × 3; BA does not exist
    Show answer

    Answer: A. A has 2 columns and B has 2 rows, so AB exists and is 3 × 4. For BA, B has 4 columns but A has 3 rows, so BA is not defined.

  2. 2. If A = [1 2; 3 4], what is 2A − 3I?

    1. [−1 4; 6 8]
    2. [2 4; 6 5]
    3. [−1 4; 6 5]
    4. [−1 2; 3 5]
    Show answer

    Answer: C. 2A = [2 4; 6 8] and 3I = [3 0; 0 3]. Subtracting, 2 − 3 = −1, 4 − 0 = 4, 6 − 0 = 6, 8 − 3 = 5, giving [−1 4; 6 5].

  3. 3. What is [2 −1; 0 3][1; 4]?

    1. [2; 12]
    2. [−2; 12]
    3. [6; 12]
    4. [−2 12]
    Show answer

    Answer: B. A 2 × 2 times a 2 × 1 gives a 2 × 1 column. Row 1: 2·1 + (−1)·4 = −2. Row 2: 0·1 + 3·4 = 12. The product is [−2; 12].

  4. 4. Which statement about square matrices of the same order is always true?

    1. AB = BA
    2. AB = O implies A = O or B = O
    3. AB = AC implies B = C
    4. A(B + C) = AB + AC
    Show answer

    Answer: D. Matrix multiplication distributes over addition, so A(B + C) = AB + AC always. The other three hold for real numbers but fail for matrices, as the counter-examples in this lesson show.

  5. 5. If A and B are square matrices of the same order, (A + B)² equals

    1. A² + 2AB + B² always
    2. A² + AB + BA + B²
    3. A² + B²
    4. A² + 2BA + B² always
    Show answer

    Answer: B. (A + B)(A + B) = A·A + A·B + B·A + B·B = A² + AB + BA + B². It reduces to A² + 2AB + B² only when AB = BA, which is not true in general.

Privacy · Terms · Refunds · Delivery