# Weird Identities with Scalar Product & Transpose: $\vec{a}\cdot\vec{b} = \vec{b}^T \cdot {a}^T$, $\vec{a}^T \cdot \vec{b} = \vec{b}^T \cdot \vec{a}$?

Let's say I have a row vector $\vec{a}$ and a column vector $\vec{b}$:

\begin{align} \vec{a}= \begin{pmatrix}4 & 5 & 6\end{pmatrix} \qquad \vec{b} = \begin{pmatrix}1\\2\\3\end{pmatrix} \end{align}

Now if I want to calculate a scalar product, it is easy for $\vec{a} \cdot \vec{b}= \begin{pmatrix}4 & 5 & 6\end{pmatrix}\begin{pmatrix}1\\2\\3\end{pmatrix} = \begin{pmatrix}4\cdot1+ 5\cdot 2 + 6\cdot 3\end{pmatrix} = 32.$

but it is not as easy for $\vec{b}\cdot \vec{a}$ where the scalar product is undefined:

\begin{align} \vec{b}\cdot \vec{a} = \begin{pmatrix}1\\2\\3\end{pmatrix} \begin{pmatrix}4 & 5 & 6\end{pmatrix} \qquad{\scriptsize\text{Not defined!}} \end{align}

So if I take a transpose of both of the vectors I get:

\begin{align} \vec{b}{\hspace{0.4mm}}^\mathsf{T}\cdot \vec{a}{}^\mathsf{T} = \begin{pmatrix}1&2&3\end{pmatrix} \begin{pmatrix}4 \\ 5 \\ 6\end{pmatrix} = \begin{pmatrix}1\cdot4 + 2 \cdot 5 + 3 \cdot 6\end{pmatrix} = 32 \end{align}

So I get a relation that $\vec{a}\cdot\vec{b} = \vec{b}^T \cdot {a}^{T} = 32$. But why do I find a different equation on Wikipedia which says: $(\vec{a}\cdot\vec{b} ){}^\mathsf{T}= \vec{b}{}^\mathsf{T} \cdot \vec{a}{\hspace{0.4mm}}^\mathsf{T}$?

EDIT: If i do it like @Samuel says i define original vectors differently:

\begin{align} \vec{a}= \begin{pmatrix} 4\\ 5 \\ 6 \end{pmatrix} \qquad \vec{b}= \begin{pmatrix} 1\\ 2 \\ 3 \end{pmatrix} \end{align}

And now i try to calculate $\vec{a} \cdot \vec{b}$ which is not defined. I can calculate ${\vec{a}}^T \vec{b}$ though:

\begin{align} {\vec{a}}^T \cdot \vec{b}= \begin{pmatrix} 4& 5 &6 \end{pmatrix} \begin{pmatrix} 1\\ 2 \\ 3 \end{pmatrix} = 4\cdot 1 + 5\cdot 2 + 6 \cdot 3 = 32 \end{align}

Now i try to calculate scalar product $\vec{b} \cdot \vec{a}$ and neither this one is defined. But i can calculate ${\vec{b}}^T\cdot \vec{a}$ though:

\begin{align} {\vec{b}}^T \cdot \vec{a}= \begin{pmatrix} 1& 2 &3 \end{pmatrix} \begin{pmatrix} 4\\ 5 \\ 6 \end{pmatrix} = 1\cdot 4 + 2\cdot 5 + 3 \cdot 6 = 32 \end{align}

So now i can say ${\vec{a}}^T \cdot \vec{b} = {\vec{b}}^T \cdot \vec{a}$. So this now is a lot wierder and i cant find it on Wikipedia.

• Check your "transpose" signs: in the equations you show that $ab=b^Ta^T$, which is correct (because $32^T=32$ when you look at it as a $1\times1$ matrix), and in the last sentence you change the order - which part exactly is not clear to you, why the order changes or why it's $(ab)^T=b^Ta^T$ rather than $(ab)=b^Ta^T$? Commented May 12, 2013 at 21:58
• At the moment only unclarity to me is what @Samuel wrote. I don't get it.
– 71GA
Commented May 12, 2013 at 22:38
• By the way $\vec{b} \cdot \vec{a}$ is defined. It's a $3 \times 3$ matrix called the outer product of the two vectors. Commented May 13, 2013 at 0:00

A vector should always be a column vector. If you want to talk about a "row vector", you should write it as the transpose of some vector, or as a matrix with just one row.

I will add that, technically, the scalar product can not be written as a matrix product the way you are doing it. If $u,v$ are vectors, then the matrix product $u^T v$ is a $1\times 1$-matrix, whereas the scalar product $u\cdot v$ is a scalar. It is common to ignore this and consider them the same, but one should sometimes be careful when using this, for example when one wants to multiply the scalar product with a matrix.

Added: You cannot say that $a$ is a vector and then write $a=(4,5,6)$ as a row matrix. You can however say that $a$ is a $1\times 3$-matrix $(4,5,6)$, or that $a$ is a vector and $a^T=(4,5,6)$ (and in the latter case, $a$ is a column vector). Let us suppose that you defined the matrices $a=(4,5,6)$ and $b=\begin{pmatrix}1\\2\\3\end{pmatrix}$. Now, the matrix product $a\cdot b$ is equal to the $1\times 1$-matrix $[32]$, not the number 32, which is the scalar product of the vectors $\begin{pmatrix}4\\5\\6\end{pmatrix}$ and $\begin{pmatrix}1\\2\\3\end{pmatrix}$. Likewise, the matrix product $b^T\cdot a^T$ is equal to the $1\times 1$-matrix $[32]$. Then we can conclude that $a\cdot b=b^T\cdot a^T$ (note that you made a typo in your post and wrote $a^T\cdot b^T$ for the right-hand-side). This is consistent with Wikipedia, which states that $(a\cdot b)^T=b^T\cdot a^T$. However, your typo is also correct in this particular case, namely $(a\cdot b)^T=a^T\cdot b^T$, but this is only because both matrices are $1\times 1$-matrices, so they are equal to their own transposes.

Added after the edit: You get the identity $a^T\cdot b=b^T\cdot a$. This equation is not true for general matrices $a,b$, so you will not find it on Wikipedia. What is generally true, however, is the identity $(a^T\cdot b)^T=b^T\cdot a$. The reason your identity is true is because both matrices are $1\times 1$-matrices, and the transpose of a $1\times 1$-matrix does not change the matrix.

• I don't understand what you are trying to say. @Alfonso Fernandez says i did it ok. Can you please try to explain it on an example?
– 71GA
Commented May 12, 2013 at 22:40
• @71GA: I've added a clarification. Commented May 12, 2013 at 22:54
• Can you check also my edit please.
– 71GA
Commented May 12, 2013 at 22:55
• Ok so what you wanted is to warn me that in TEXT i have to be careful how to talk about vectors and matrix. If i have for example: $$a=\begin{pmatrix}1&2&3\end{pmatrix}\qquad \vec{b}=\begin{pmatrix}4\\5\\6\end{pmatrix}$$ i can say in text that $b$ is a vector, but i can't say this for $a$ which is only a matrix $1\times 3$. But i can read in en.wikipedia.org/wiki/Matrix_multiplication that: "Treating the rows and columns in each matrix as row and column vectors respectively, this entry is also their vector dot product"?
– 71GA
Commented May 12, 2013 at 23:30
• @71GA: When taking scalar products, it doesn't matter if you write your vectors as row vectors or column vectors, but as soon as you use matrix multiplication, everything you call a vector has to be a column vector to avoid matrix multiplications becoming undefined due to mismatched dimensions. Commented May 12, 2013 at 23:36

Vectors have a notation, they can be written only as a column matrix. In case of multiplying two such vectors, matrix multiplication is not defined as both would be 3x1 matrices.

\begin{gather} \vec{u} = \left[ \begin{array}{c} u_1 \\ u_2 \\ u_3 \\ \end{array} \right] & \vec{v} = \left[ \begin{array}{c} v_1 \\ v_2 \\ v_3 \\ \end{array} \right] \end{gather}

Then the following is not defined -

\begin{gather} \vec{u}\cdot \vec{v} = \left[ \begin{array}{c} u_1 \\ u_2 \\ u_3 \\ \end{array} \right] \cdot \left[ \begin{array}{c} v_1 \\ v_2 \\ v_3 \\ \end{array} \right] \end{gather}

A dyadic multiplication is defined, which gives rise to a column or a row matrix. It is as follows:
\begin{gather} \vec{u} \otimes \vec{v} = \left[ \begin{array}{ccc} u_1\cdot v_1 & u_1 \cdot v_2 & u_1 \cdot v_3\\ u_2\cdot v_1 & u_2 \cdot v_2 & u_2 \cdot v_3\\ u_3\cdot v_1 & u_3 \cdot v_2 & u_3 \cdot v_3\\ \end{array} \right] \end{gather}

It is therefore \begin{gather} \vec{u} \otimes \vec{v} = (\vec{v} \otimes \vec{u})^T \end{gather}

In terms of vector inner product same may be written as \begin{gather} \vec{u} \otimes \vec{v} = \vec{u} \cdot \vec{v}^T \end{gather}

OR

Valid vector inner product is therefore, \begin{gather} \vec{u}\cdot \vec{v} = \left[ \begin{array}{c} u_1 \\ u_2 \\ u_3 \\ \end{array} \right] \cdot \left[ \begin{array}{ccc} v_1 & v_2 & v_3 \\ \end{array} \right] \end{gather}