Derivative of a vector times its transpose

314 Views Asked by At

I am trying to work out how to solve a derivative of the form:

$${d \over dx}(M(x)M(x)^T)$$

where M is a vector.

In my case specifically, M is the (1x3) vector

$$M(x)={df(x) \over dx}$$

where f(x) is a scalar and x is a (3x1) vector.

Could I just use the product rule like this: $${d(uv) \over dx}=u{dv \over dx}+v{du \over dx}$$ if $M(x)=u$ and $M(x)^T=v$ then $${d \over dx}(M(x)M(x)^T)=M(x){d(M(x)^T) \over dx}+M(x)^T{d(M(x)) \over dx}$$ $${d \over dx}(M(x)M(x)^T)=M(x){d(M(x)) \over dx}^T+M(x)^T{d(M(x)) \over dx}$$ $${d \over dx}(M(x)M(x)^T)={df(x) \over dx}({{d^2 f(x) \over dx^2}})^T+({df(x) \over dx})^T{{d^2 f(x) \over dx^2}}$$

I assume that I made a few mistakes above. Whether you help with the general solution or my problem specifically it would be much appreciated!

2

There are 2 best solutions below

2
On BEST ANSWER

Since $M_i=\partial_i f$ with $\partial_i:=\frac{\partial}{\partial x^i}$, $\sum_j\partial_i M_j^2=2\sum_j M_j\partial_i M_j=2\sum_j\partial_j f\partial_i\partial_j f$, the $i$th component of a vector perhaps best denoted as $2\nabla f\nabla^2 f$.

0
On

Instead of $M$, let's denote the gradient of $f$ by $$g=\frac{\partial f}{\partial x}$$ And for the Hessian of $f$, let's use
$$H=\frac{\partial^2f}{\partial x\,\partial x}=\frac{\partial g}{\partial x}$$ Note that $H$ is symmetric.

The function of interest is the square of the gradient. Write it in terms of these new variables and find its differential and derivative. $$\eqalign{ \phi &= \|g\|^2 = g\cdot g \cr d\phi &= 2g\cdot dg = 2g\cdot(H\cdot dx) = 2(H^T\cdot g)\cdot dx \cr \frac{\partial\phi}{\partial x} &= 2H^T\cdot g = 2H\cdot g \cr }$$