Partial derivates of product How to derive from this formula:
$$\frac{\partial(\mathbf g.\mathbf h)}{\partial \mathbf x} = \left(\frac{\partial(\mathbf g.\mathbf h)}{\partial x_1},\frac{\partial(\mathbf g.\mathbf h)}{\partial x_2},\frac{\partial(\mathbf g.\mathbf h)}{\partial x_3}\right)^T=\ldots$$
this formula:
$$\ldots=\frac{\partial(\mathbf h^T)}{\partial \mathbf x}\mathbf g+\frac{\partial(\mathbf g^T)}{\partial \mathbf x}\mathbf h$$
 A: By linearity, the product rule $(gh)'=g'h+gh'$ and the assumption that $\mathbf g\cdot\mathbf h=\mathbf h\cdot \mathbf g$:
$$
\frac{\partial(\mathbf g.\mathbf h)}{\partial \mathbf x} = \left(\frac{\partial(\mathbf g.\mathbf h)}{\partial x_1},\ldots \right)^T=
\left(\frac{\partial(\mathbf h^T)}{\partial  x_1}\mathbf g+\frac{\partial(\mathbf g^T)}{\partial  x_1}\mathbf h, \ldots \right)^T
=\frac{\partial(\mathbf h^T)}{\partial \mathbf x}\mathbf g+\frac{\partial(\mathbf g^T)}{\partial \mathbf x}\mathbf h
$$
A: For each element you can use the chain rule
$$ \frac{ \partial (\boldsymbol{g}\cdot\boldsymbol{h}) }{\partial x_i} = \frac{ \partial (\boldsymbol{g}\cdot\boldsymbol{h}) }{\partial \boldsymbol g} \cdot\frac{ \partial (\boldsymbol{g}) }{\partial x_i} + \frac{ \partial (\boldsymbol{g}\cdot\boldsymbol{h}) }{\partial \boldsymbol h} \cdot\frac{ \partial (\boldsymbol{h}) }{\partial x_i} = \boldsymbol{h} \cdot \frac{ \partial (\boldsymbol{g}) }{\partial x_i}+\boldsymbol{g} \cdot \frac{ \partial (\boldsymbol{h}) }{\partial x_i} $$
where $\boldsymbol{g}\cdot\boldsymbol{h} = \boldsymbol{g}^\top\boldsymbol{h} $.
