Matrix Form of Vectors and The Dot Product

# Matrix Form of Vectors and The Dot Product

So far we have looked at vectors in $\mathbb{R}^n$ in the form $\vec{u} = (u_1, u_2, ..., u_n)$, however, we can also write a vector as either a $1 \times n$ row matrix or an $n \times 1$ column matrix (omitting the vector arrows to denote a vector in matrix form)

(1)
\begin{align} u = \begin{bmatrix} u_1 & u_2 & \cdots & u_n \end{bmatrix} \quad , \quad u = \begin{bmatrix} u_1 \\ u_2 \\ \vdots \\ u_n \end{bmatrix} \end{align}

Sometimes this notation is useful as many vector operations are illustrated the same way if the vectors are in matrix form, for example consider the vector operation of addition, that is $\vec{u} + \vec{v} = (u_1 + v_1, u_2 + v_2, ..., u_n + v_n)$ in matrix form:

(2)
\begin{align} \quad \begin{bmatrix}u_1 \\ u_2 \\ \vdots \\ u_n\end{bmatrix} + \begin{bmatrix}v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix} = \begin{bmatrix}u_1 + v_1\\ u_2 + v_2\\ \vdots \\ u_n + v_n \end{bmatrix} \end{align}

# The Dot Product in Matrix Form

Let $\vec{u}, \vec{v} \in \mathbb{R}^n$, and write $u = \begin{bmatrix}u_1 \\ u_2 \\ \vdots \\ u_n\end{bmatrix}$ and $v = \begin{bmatrix}v_1 \\ v_2 \\ \vdots \\ v_n \end{bmatrix}$. The dot product $\vec{u} \cdot \vec{v}$ can be obtained by the following formula:

(3)
\begin{align} \begin{bmatrix}v_1 & v_2 & ... & v_n \end{bmatrix}_{1 \times n} \begin{bmatrix}u_1 \\ u_2 \\ \vdots \\ u_n\end{bmatrix}_{n \times 1} = \begin{bmatrix} u_1v_1 + u_2v_2 + ... u_nv_n \end{bmatrix}_{1 \times 1} = \vec{u} \cdot \vec{v}\\ \end{align}

Therefore we obtain that $\vec{u} \cdot \vec{v} = v^T u$.

Furthermore, consider an $n \times n$ matrix $A$ and the following equivalences:

(4)
\begin{align} Au \cdot v = v^T(Au) \\ Au \cdot v = (v^TA)u \\ Au \cdot v = (A^Tv)^Tu \\ Au \cdot v = u \cdot A^T v \end{align}
(5)
\begin{align} u \cdot Av = (Av)^T u \\ u \cdot Av = (v^TA^T)u \\ u \cdot Av = v^T(A^Tu) \\ u \cdot Av = A^Tu \cdot v \end{align}

We thereby get the formulas $Au \cdot v = u \cdot A^T v$ and $u \cdot Av = A^T u \cdot v$.