# Why do we have $(\vec{u}\cdot\vec{n})\vec{n}=\vec{u}^{T}(\vec{n}\otimes\vec{n})=(\vec{n}\otimes\vec{n})\vec{u}$?

In this question the answer gives a nice illustration about the tangential projection $P = I - \vec{n}\otimes\vec{n}$.

I understand everything but the identity it mentioned:

I've applied the identity $(\vec{u}\cdot\vec{n})\vec{n}=\vec{u}^{T}(\vec{n}\otimes\vec{n})=(\vec{n}\otimes\vec{n})\vec{u}$

I have no background in tensor analysis, thus I hope someone can help me to understand in details how the transpose $\vec{u}^{T}$ and the tensor product $\vec{n}\otimes\vec{n}$ are derived here. Thanks!

Let me verify the identity as follows:

For the sake of simplicity, let us consider 2-d case, we assume row vector $\vec{u} = \begin{bmatrix}{u_1 \; u_2}\end{bmatrix}$ and column vector $\vec{n} = \begin{bmatrix}{n_1 \\ n_2}\end{bmatrix}$, then $\vec{u}\cdot\vec{n} = (u_1 n_1 + u_2 n_2)$ which is a scalar, so the column vector $(\vec{u}\cdot\vec{n})\vec{n} = (u_1 n_1 + u_2 n_2)\begin{bmatrix}{n_1 \\ n_2}\end{bmatrix}$ is well-defined on the LHS.

However, $\vec{u}^T = \begin{bmatrix}{u_1 \; u_2}\end{bmatrix}^T = \begin{bmatrix}{u_1 \\ u_2}\end{bmatrix}$, and $\vec{n}\otimes\vec{n} = \vec{n}\vec{n}^T = \begin{bmatrix}{n_1 \\ n_2}\end{bmatrix} \begin{bmatrix}{n_1 \\ n_2}\end{bmatrix}^{T} = \begin{bmatrix}{n_1 \\ n_2}\end{bmatrix} \begin{bmatrix}{n_1 \; n_2}\end{bmatrix} = \begin{bmatrix}{n_1 n_1 \; n_1 n_2 \\ n_2 n_1 \; n_2 n_2}\end{bmatrix}$, thus $\vec{u}^T(\vec{n}\otimes\vec{n}) = \begin{bmatrix}{u_1 \\ u_2}\end{bmatrix} \begin{bmatrix}{n_1 n_1 \; n_1 n_2 \\ n_2 n_1 \; n_2 n_2}\end{bmatrix}$ is ill-defined.

In addition, $(\vec{n}\otimes\vec{n})\vec{u} = \begin{bmatrix}{n_1 n_1 \; n_1 n_2 \\ n_2 n_1 \; n_2 n_2}\end{bmatrix} \begin{bmatrix}{u_1 \; u_2}\end{bmatrix}$ is also ill-defined.

I realized that $\vec{u}$ should be a column vector in order to make the dot product $\vec{u} \cdot \vec{n}$ well-defined.

However, even if we assume $\vec{u}$ a column vector, the identity $\vec{u}^{T}(\vec{n}\otimes\vec{n}) = (\vec{n}\otimes\vec{n})\vec{u}$ does not hold, because LHS will be a row vector while RHS a column vector.

• $\vec{u}$ should be a column vector, not a row vector. – B. Mehta Nov 21 '17 at 15:48
• Well, it seems I confused between dot product $\vec{u} \cdot \vec{n}$ and matrix product $\vec{u} \vec{n}$, the later one requires $\vec{u}$ to be row vector. – Analysis Newbie Nov 21 '17 at 16:00
• Yes, exactly! :) – B. Mehta Nov 21 '17 at 16:01
• However, even if we assume $\vec{u}$ a column vector, the identity $\vec{u}^{T}(\vec{n}\otimes\vec{n}) = (\vec{n}\otimes\vec{n})\vec{u}$ does not hold, because LHS will be a row vector while RHS a column vector. – Analysis Newbie Nov 21 '17 at 17:32

There is a clash of conventions here. Matrices are usually intended to be a way to conveniently express a linear transformations relative to bases of the domain and codomain. More precisely, suppose that $f:X\to Y$ is a linear trasformation from vector space $X$ to vector space $Y$ and $(x_1,x_2,\dots,x_n)$ is an orthonormal basis for $X$ and $(y_1,y_2,\dots,y_m)$ is an orthonormal basis for $Y.\;$ Now given $v\in X$ and $w\in Y,\;$ define the linear transformation $w\otimes v:X\to Y$ with for all $u$ in $X\;$ $\;(w\otimes v)(u) := (u\cdot v)w.\;$ Since, by linearity, and because $\;u=\sum_{i=1}^n (u\cdot x_i)\;$ for all $\;u\in X$, $$f(u)=\sum_{i=1}^n (u\cdot x_i)f(x_i)= \sum_{i=1}^n (u\cdot x_i)\sum_{j=1}^m (f(x_i)\cdot y_j)y_j= \sum_{i=1}^n\sum_{j=1}^m (u\cdot x_i)y_j\;a_{i,j}.$$ Thus, the $a_{i,j}$ are the coefficients of the summation expansion of $\;f = \sum_{i=1}^n\sum_{j=1}^m \;(y_j\otimes x_i)\;a_{i,j}.$
Conventionly, the coefficients $a_{i,j}$ are arranged in a rectangular array with rows and column. Again, by convention, the result of $f(u)=v$ is written as $v=Au$ where $u$ and $v$ are regarded as column vectors using the rules of matrix multiplication. This is just a convention and for convenience. Now, taking transposes, $\;v^T=u^TA^T$ expresses the same result. Similarly we have $\;(w\otimes v)^T=(v\otimes w).$
So now, we restrict to $X$ and $u\in X$ and $n\in X\;$ By definition, $\;(u\cdot n)n = (n\otimes n)u\;$ which is one part of the equality. Now, taking transposes, $\;(u\cdot n)n^T=u^T(n\otimes n)\;$ which is just the same result.