Matrix Multiplication Understanding

I have to multiply two 3x3 matrices. I don't understand the answer.

$$A=\begin{pmatrix}1&0&1\\ 0&1&1\\ 0&0&1 \end{pmatrix}$$

$$B=\begin{pmatrix}1&0&-1\\ 0&1&-1\\ 0&0&1 \end{pmatrix}$$

The answer given online is $$AB=\begin{pmatrix}1&0&1\\ 0&1&1\\ 0&0&1 \end{pmatrix}$$

I don't understand how this is so. I have said that:

$$AB=\begin{pmatrix}(1)(1)+(0)(0)+(1)(0) & (1)(0)+(0)(1)+(1)(0) & (1)(-1)+(0)(-1)+(1)(1)\\(0)(1)+(1)(0)+(0)(0) & (0)(0)+(1)(1)+(1)(0) & (0)(-1)+(1)(-1)+(1)(1) \\ (0)(1)+(0)(0)+(1)(0) & (0)(0)+(0)(1)+(1)(0) & (0)(-1)+(0)(-1)+(1)(1) \end{pmatrix}$$

$$AB=\begin{pmatrix}1 & 0 & (1)(-1)+(0)(-1)+(1)(1)\\0 & 1 & (0)(-1)+(1)(-1)+(1)(1) \\ 0 & 0 & 1 \end{pmatrix}$$

$$AB=\begin{pmatrix}1 & 0 & 0\\0 & 1 & 0 \\ 0 & 0 & 1 \end{pmatrix}$$

Can anyone tell me where I am going wrong?

-
Another check is compute the inverse of $A$ and determine if $A^{-1} = B$. –  Chinny84 Aug 11 '14 at 11:54
you're right, the answer they gave is incorrect –  Sam Creamer Aug 11 '14 at 17:43

I agree with your work, and if they posted $AB=\begin{pmatrix}1&0&1\\ 0&1&1\\ 0&0&1 \end{pmatrix}$ as the answer for the product, it seems they're incorrect.

Another fast way to see that their answer is not feasible is to notice that they are writing $AB=A$. Since $A$ is an upper triangular matrix with no zeros on the main diagonal, its determinant is clearly nonzero, so it is invertible. Then we can take $AB=A$ and multiply on the left with the inverse: $$A^{-1}AB=A^{-1}A\implies B=I$$

But $B$ is obviously not the identity matrix.

-

$\text{You have the right answer.}$ $$AB=\begin{pmatrix}1&0&0\\ 0&1&0\\ 0&0&1 \end{pmatrix}$$

-

You have the right answer, but in your solution process there is one little mistake.

$$AB = \begin{pmatrix} (1)(1)+(0)(0)+(1)(0) & (1)(0)+(0)(1)+(1)(0) & (1)(-1)+(0)(-1)+(1)(1) \\ (0)(1)+(1)(0)+\color{red}{(0)}(0) & (0)(0)+(1)(1)+(1)(0) & (0)(-1)+(1)(-1)+(1)(1) \\ (0)(1)+(0)(0)+(1)(0) & (0)(0)+(0)(1)+(1)(0) & (0)(-1)+(0)(-1)+(1)(1) \end{pmatrix}$$

should be:

$$AB = \begin{pmatrix} (1)(1)+(0)(0)+(1)(0) & (1)(0)+(0)(1)+(1)(0) & (1)(-1)+(0)(-1)+(1)(1) \\ (0)(1)+(1)(0)+\color{red}{(1)}(0) & (0)(0)+(1)(1)+(1)(0) & (0)(-1)+(1)(-1)+(1)(1) \\ (0)(1)+(0)(0)+(1)(0) & (0)(0)+(0)(1)+(1)(0) & (0)(-1)+(0)(-1)+(1)(1) \end{pmatrix}$$

Luckily, this doesn't seem to affect the final answer.

-