Matrix Operations

Matrices add element to element in a fairly intuitive manner. Maybe best shown by example:

(1)
\begin{align} {\begin{pmatrix} a & b\\ c & d \\ \end{pmatrix}}+ {\begin{pmatrix} e & f \\ g & h \end{pmatrix}}= \begin{pmatrix} a+e & b+f \\ c+g & h+h \end{pmatrix} \end{align}

#### Subtraction of Matrices

Subtraction works the same as addition, that is element to element:

(2)
\begin{align} {\begin{pmatrix} a & b\\ c & d \\ \end{pmatrix}} - {\begin{pmatrix} e & f \\ g & h \end{pmatrix}} = {\begin{pmatrix} a-e & b-f \\ c-g & h-h \end{pmatrix}} \end{align}

#### Multiplication by a Scalar

A vector can by multiplied by a scalar (a regular number). In this case each element of the matrix is multiplied by the same value. For example:

(3)
\begin{align} 3{\begin{pmatrix} a & b\\ c & d \\ \end{pmatrix}} = {\begin{pmatrix} 3a & 3b\\ 3c &3d \\ \end{pmatrix}} \end{align}

### Matrix Equality

If two matrices are set equal to each other than each element is equal to the corresponding element. For example:

(4)
\begin{align} {\begin{pmatrix} 3 & x\\ 3y & 1 \\ \end{pmatrix}} = {\begin{pmatrix} y & 5\\ 9 & x-4 \\ \end{pmatrix}} \end{align}

From this matrix we can write 4 equations (this begins to show the usefulness and compactness of matrix notation).

(5)
$$3=y$$
(6)
$$x = 5$$
(7)
$$3y=9$$
(8)
$$1 = x- 4$$

These equations can be solved to show (if I wrote them correctly) that $y = 3$ and $x = 5$.

##### Example

Find x and y if:

(9)
\begin{align} {\begin{pmatrix} x & x^2\\ 3 & -1 \\ \end{pmatrix}} = {\begin{pmatrix} y & 4\\ 3 & y+1 \\ \end{pmatrix}} \end{align}

#### Matrix Multiplication

Here is were things get a bit less clear, but this is also where we get the first tools that help use do what we couldn't (easily) do before, but the price is a bit of confusion at first. For example the multiplication of a 2x2 with another 2x2.

(14)
\begin{align} {\begin{pmatrix} a & b \\ c & d \\ \end{pmatrix}} {\begin{pmatrix} e & f \\ g&h \\ \end{pmatrix}} = {\begin{pmatrix} ae+bg & af+bh\\ ce+dg& cf+dh \end{pmatrix}} \end{align}

There are limits to matrix multiplication, in that not just any two matrices can be multiplied. An important fact of matrix multiplication is that in general:

(15)
\begin{align} A B \neq B A \end{align}

You can find special cases, but they are rare. In order for matrix multiplication to be defined the first matrix must have the same number of columns as the the second matrix has rows. For example :

(16)
\begin{align} {\begin{pmatrix} 1 & 2& 3\\ 4& 5 &6 \end{pmatrix}} {\begin{pmatrix} 1 & 2\\ 3 & 4\\ 5 & 6 \end{pmatrix}}= \begin{pmatrix} 22& 28 \\ 49& 64\\ \end{pmatrix} \end{align}

Notice that the order of the product is reduced to 2 x 2. In general if an m x n order matrix is multiplied by an n x k order matrix the result will be an m x k matrix.