# Is matrix subtraction commutative?

Apr 13, 2015

Matrix subtraction is not commutative because you have to subtract term by term your two matrices and the order in the subtraction counts. So:

$A - B \ne B - A$

For example, consider:

Dec 27, 2016

No, but it is not too difficult to show that it is anticommutative.

For $C = A - B$, looking at the entry on row $i$ and column $j$:

${c}_{i j} = {a}_{i j} - {b}_{i j}$

Thus:

${c}_{i j} = - \left({b}_{i j} - {a}_{i j}\right) = {a}_{i j} - {b}_{i j}$

or

$C = - \left(B - A\right)$

which we should expect from knowing that subtraction is itself anticommutative.

So, if you realize that you subtracted the two matrices in the wrong order for some reason, just take the negative of your resultant matrix. For instance:

$\stackrel{B}{\overbrace{\left[\begin{matrix}1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9\end{matrix}\right]}} - \stackrel{A}{\overbrace{\left[\begin{matrix}1 & 2 & 4 \\ 4 & 7 & 6 \\ 7 & 8 & 2\end{matrix}\right]}}$

$= \stackrel{- C}{\overbrace{\left[\begin{matrix}0 & 0 & - 1 \\ 0 & - 2 & 0 \\ 0 & 0 & 7\end{matrix}\right]}}$

Then, if it wasn't what you wanted to do, you can fix it!

$- \left(\stackrel{B}{\overbrace{\left[\begin{matrix}1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9\end{matrix}\right]}} - \stackrel{A}{\overbrace{\left[\begin{matrix}1 & 2 & 4 \\ 4 & 7 & 6 \\ 7 & 8 & 2\end{matrix}\right]}}\right) = - \stackrel{- C}{\overbrace{\left[\begin{matrix}0 & 0 & - 1 \\ 0 & - 2 & 0 \\ 0 & 0 & 7\end{matrix}\right]}}$

$= \stackrel{A}{\overbrace{\left[\begin{matrix}1 & 2 & 4 \\ 4 & 7 & 6 \\ 7 & 8 & 2\end{matrix}\right]}} - \stackrel{B}{\overbrace{\left[\begin{matrix}1 & 2 & 3 \\ 4 & 5 & 6 \\ 7 & 8 & 9\end{matrix}\right]}}$

$= \stackrel{C}{\overbrace{\left[\begin{matrix}0 & 0 & 1 \\ 0 & 2 & 0 \\ 0 & 0 & - 7\end{matrix}\right]}}$