Addition and subtraction are the two operations on matrices that behave exactly as you would hope: entry by entry, no surprises. Fill in A and B above and press A + B or A − B.
The one rule
Both matrices must have the same dimensions. A 2×3 can be added to another 2×3 and to nothing else — not to a 3×2, not to a 2×4. The result keeps those dimensions, and the entry in each position is simply the sum of the two entries in that position.
Because it works positionally, matrix addition inherits the arithmetic you already know: it is commutative, so A + B = B + A, and associative, so the grouping of a three-way sum does not matter. This is a genuine contrast with multiplication, where A·B and B·A are usually different matrices and can even have different shapes. Subtraction is addition of the negative: A − B is A + (−1)·B, so it is not commutative, in the same ordinary way that 5 − 3 differs from 3 − 5.
Worked example
| 1 | 2 |
| 3 | 4 |
| 5 | 6 |
| 7 | 8 |
| 6 | 8 |
| 10 | 12 |
Each position is handled independently: 1 + 5 = 6, 2 + 6 = 8, and so on. The zero matrix plays the role zero plays for numbers — adding it changes nothing — and A − A returns it.
Common mistakes
- Adding matrices of different sizes. There is no convention for padding the shorter one; the operation is simply undefined.
- Adding a scalar to a matrix. A + 3 has no meaning. To add 3 along the diagonal, add 3·I; to add it everywhere, add a matrix of threes.
- Expecting det(A + B) = det(A) + det(B). Determinants do not distribute over addition, and there is no useful formula relating the three.
- Mixing up the order in a subtraction. A − B and B − A differ by a sign in every entry.