Adding Matrices and Subtracting MatricesReference > Mathematics > Algebra > Matrices
ay,x + by,x = cy,x
From this, it should be fairly clear that you can only add two matrices if they have the same dimensions (otherwise, there will be elements in one matrix that don't have a corresponding element in the other matrix!) and the resulting matrix will have the same dimensions as the two matrices being added.
How do we subtract matrices? The same way - except that instead of adding corresponding elements, we subtract them. As with adding, the two matrices must have the same dimensions, and the result will also have those dimensions.
Just as with addition and subtraction of numbers, matrix addition is commutative, but matrix subtraction is not. In other words, A + B is the same as B + A, but A - B is not the same as B - A.Example One
Find the sum of and . Solution
Adding each corresponding element, we obtain Example Two
Find the difference: -
Subtract the corresponding elements (watch out for those negatives: 5 - (-3) = 5 + 3 = 8!)
Find the following sum: +
These do not have matching dimensions, so the operation cannot be performed!
Find x if + =
The only part of this that matters to us is the entry in the first row, second column of each matrix:
x + 5 = 12, which leads to x = 7.Example Five
Find x and y if + =
We can obtain two equations from this (which is good - we have two variables, so we should expect to see two equations if we're going to solve this!).
x + 2y = 20
2x + y = 19
If we subtract twice the second equation from the first, we get -3x = -18, or x = 6. Plugging this into either equation gives y = 7.
The solution is x = 6, y = 7.