**Read** Section 3.3 for Wednesday.
Work through recommended homework questions.

**Tutorials:** Quiz 3 next week will cover to the end of Section 3.2.

**Solutions** to the midterm are available from the course home page.
Class average was 31/40 = 77.5%.
Great work! But keep in mind that the material naturally gets much
more difficult.

**Office hour:** next Wednesday, 12:30-1:30, MC103B. (No office
hour on Monday.)

**Help Centers:** Monday-Friday 2:30-6:30 in MC 106. (But not on
Monday, Oct 14.)

**Note:** In particular, if $B$ is a column vector in $\R^n$,
then $AB$ is a column vector in $\R^m$.
So one thing a matrix $A$ can do is *transform* column vectors into column vectors.
This point of view will be important later.

For the most part, matrix multiplication behaves like multiplication of real numbers, but there are several differences:

We can have $A \neq O$ but $A^k = O$ for some $k > 1$.

We can have $B \neq \pm I$, but $B^4 = I$.

We can have $AB \neq BA$.

But most expected properties **do** hold:

(a) $A(BC) = (AB)C$ | (associativity) |

(b) $A(B + C) = AB + AC$ | (left distributivity) |

(c) $(A+B)C = AC + BC$ | (right distributivity) |

(d) $k(AB) = (kA)B = A(kB)$ | (no cool name) |

(e) $I_m A = A = A I_n$ if $A$ is $m \times n$ | (identity) |

Using Theorem 3.3, we find:
$$
\begin{aligned}
(A+B)^2 &= (A+B)(A+B) \\
&= (A+B)A + (A+B)B \\
&= A^2+BA+AB+B^2 .
\end{aligned}
$$
Suppose $A^2+BA+AB+B^2 = A^2 + 2AB + B^2$. Subtracting $A^2+AB+B^2$ from both sides
gives $BA=AB$.
So the answer is "No, unless $A$ and $B$ commute."

**Note:** Theorem 3.3 shows that a scalar matrix $kI_n$ commutes
with *every* $n \times n$ matrix $A$.

See **Example 3.12** for a larger, more complicated worked example.

The most common (and important) cases are when one or both of the matrices are partitioned into rows or columns. For example, if $A$ is $m \times n$ and $B$ is $n \times r$, and we partition $B$ into its columns as $B = [ \, \vb_1 \mid \vb_2 \mid \cdots \mid \vb_r ]$, then we have: $$ AB = A[ \, \vb_1 \mid \vb_2 \mid \cdots \mid \vb_r ] = [\, A\vb_1 \mid A\vb_2 \mid \cdots \mid A\vb_r ] , $$ where we think of $A$ and the $\vb_i$'s as scalars. The first column of $AB$ consists of the dot products of the rows of $A$ with the first column $\vb_1$ of $B$.

**Example on whiteboard:** $2 \times 3$ times $3 \times 2$.

Note that each column of $AB$ is a linear combination of the columns of $A$.

Similarly, if we partition $A$ into rows, we can compute $$ AB = \bmat{c} A_1 \\ \hline A_2 \\ \hline \vdots \\ \hline A_m \emat B = \bmat{c} A_1 B \\ \hline A_2 B \\ \hline \vdots \\ \hline A_m B \emat $$

**Same example on whiteboard.**

If we partition $A$ into rows and $B$ into columns, we get $$ AB = \bmat{c} A_1 \\ \hline A_2 \\ \hline \vdots \\ \hline A_m \emat [ \, \vb_1 \mid \vb_2 \mid \cdots \mid \vb_r ] = \bmat{ccc} A_1 \vb_1 & \cdots & A_1 \vb_r \\ \vdots & & \vdots \\ A_m \vb_1 & \cdots & A_m \vb_r \emat $$ which is just the usual description of $AB$, where the $ij$ entry is the dot product of the $i$th row of $A$ with the $j$th column of $B$!

(Outer products and Example 3.11 not covered.)

**Definition:** The **transpose** of an $m \times n$ matrix $A$
is the $n \times m$ matrix $A^T$ whose $ij$ entry is the $ji$ entry of $A$.

**Example 3.14:**
The transposes of
$$
A = \bmat{rrr} 1 & 3 & 2 \\ 5 & 0 & 1 \emat,
\qquad
B = \bmat{rr} a & b \\ c & d \emat ,
\qquad
\text{and}
\qquad
C = \bmat{rrr} 5 & -1 & 2 \emat
$$
are
$$
A^T = \bmat{rr} 1 & 5 \\ 3 & 0 \\ 2 & 1 \emat,
\qquad
B^T = \bmat{rr} a & c \\ b & d \emat ,
\qquad
\text{and}
\qquad
C^T = \bmat{r} 5 \\ -1 \\ 2 \emat .
$$
Note that the columns and rows get interchanged.

One use of the transpose is to convert between row vectors and column vectors. In particular, we can use this to express the dot product in terms of matrix multiplication. If $$ \vu = \bmat{c} u_1 \\ u_2 \\ \vdots \\ u_n \emat \qquad\text{and}\qquad \vv = \bmat{c} v_1 \\ v_2 \\ \vdots \\ v_n \emat $$ then $$ \vu^T \vv = [ u_1 \, u_2 \, \cdots \, u_n ] \bmat{c} v_1 \\ v_2 \\ \vdots \\ v_n \emat = u_1 v_1 + \cdots + u_n v_n = \vu \cdot \vv $$

(a) $(A^T)^T = A$ | (b) $(A+B)^T = A^T + B^T$ |

(c) $(kA)^T = k(A^T)$ | (d) $(AB)^T = B^T A^T$ ! |

(e) $(A^r)^T = (A^T)^r$ for all nonnegative integers $r$ |

(a), (b) and (c) are easy to see. (d) is more of a surprise, so it is worth explaining:

**Proof of (d):**
Suppose $A$ is $m \times n$ and $B$ is $n \times r$. Then both
of $(AB)^T$ and $B^T A^T$ are $r \times m$. We have to check that the entries are equal:
$$
\begin{aligned}\kern-4ex
[(AB)^T]_{ij} &= (AB)_{ji} = \row_j(A) \cdot \col_i(B) = \col_j(A^T) \cdot \row_i(B^T) \\
&= \row_i(B^T) \cdot \col_j(A^T) = [(B^T)(A^T)]_{ij} .
\qquad\Box
%\tag*{∎}
\end{aligned}
$$

Note that (b) and (d) extend to several matrices. For example: $$ (A + B + C)^T = ((A+B) + C)^T = (A+B)^T + C^T = A^T + B^T + C^T $$ and $$ (ABC)^T = ((AB)C)^T = C^T (AB)^T = C^T B^T A^T $$ In particular, (e) follows: $(A^r)^T = (A^T)^r$.

**Definition:** A square matrix $A$ is **symmetric** if $A^T = A$.
That is, $A_{ij} = A_{ji}$ for every $i$ and $j$.

**Example:** $\bmat{rr} 1 & 2 \\ 2 & 3 \emat$ is symmetric.

There are two ways to get a symmetric matrix from a non-symmetric matrix:

1. If $A$ is square, then $A + A^T$ is symmetric.
This is because
$$
(A + A^T)^T = A^T + (A^T)^T = A^T + A = A + A^T .
$$
**Example on whiteboard.**

2. And if $B$ is any matrix, then $B^T B$ is symmetric. This is because $$ (B^T B)^T = B^T (B^T)^T = B^T B $$ The same kind of argument shows that $B B^T$ is symmetric.

**Example on whiteboard.**

Find a $2 \times 2$ matrix $A$ such that $A \neq I_2$ but $A^3 = I_2$.

.