Differentiation of $xx^T$ where $x$ is a vector How is differentiation of $xx^T$ with respect to $x$ as $2x^T$, where $x$ is a vector? $x^T $means transpose of $x$ vector.

I'm posting this second answer at the request of Doctor Mohawk, who wants to see the derivative of $xx^T$ for column vectors $x$.  We note the function $x \to xx^T$ maps column vectors $x \in \Bbb R^n$ into the space of real square $n \times n$ matrices, as opposed to $x \to x^Tx$, which maps onto $\Bbb R$.  In any event, proceding in a manner similar to the answer above,  we find
$(x + h)(x + h)^T = xx^T + hx^T + xh^T + hh^T; \tag{1}$
we observe that for column vectors $y, z \in \Bbb R^n$
$zy^T = \begin{pmatrix} z_1 \\ z_2 \\ \vdots \\ z_n \end{pmatrix} \begin {pmatrix} y_1 & y_2 & \dots & y_n \end{pmatrix} = \begin{bmatrix} z_i y_j \end{bmatrix}, \tag{2}$
and so
$hh^T = \begin{bmatrix} h_i h_j \end{bmatrix}; \tag{3}$
now if we agree that the norm $ \Vert z \Vert$ of any $z \in \Bbb R^n$ is given by
$\Vert z \Vert^2 = z^Tz = \sum_i z_i^2, \tag{4}$
and the norm of a matrix
$M = \begin{bmatrix} m_{ij} \end{bmatrix} \tag {5}$
is
$\Vert M \Vert^2  = \sum_{i, j} m_{ij}^2, \tag{6}$
then
$\Vert hh^T \Vert^2 = \sum_{i, j} h_i^2 h_j^2 = (h^Th)^2; \tag{7}$
we now return to (1) and see that
$(x + h)(x + h)^T - xx^T - ( hx^T + xh^T) = hh^T; \tag{8}$
for fixed $x$ the map
$h \to hx^T + xh^T \tag{9}$
is manifestly linear in $h$.  Furthermore, from (7) we have
$\Vert hh^T \Vert = h^Th = \sum_i h_i^2, \tag{10}$
so in accord with (4),
$\Vert hh^T \Vert = \Vert h \Vert^2, \tag{11}$
whence, for $h \ne 0$,
$\dfrac{\Vert hh^T \Vert}{\Vert h \Vert} = \Vert h \Vert \to 0 \tag{12}$
as
$\Vert  h \Vert \to 0; \tag{13}$
since, from (8),
$\Vert (x + h)(x + h)^T - xx^T - ( hx^T + xh^T) \Vert = \Vert hh^T \Vert, \tag{14}$
we see that the linear map $hx^T + xh^T$ approximates the "error" in $(x + h)(x + h)^T - xx^T$ up to second order in $\Vert h \Vert$; but this is precisely the definition of the derivative.
