Compute $\frac{\partial}{\partial x} (x^T \exp(x x^T) x )$

55 Views Asked by At

How to compute $\frac{\partial}{\partial x} \big(x^T \exp{x x^T} x \big), ~x \in \mathbb{R^n}$?

Any ideas

1

There are 1 best solutions below

0
On BEST ANSWER

Let's use a colon to denote the trace/Frobenius product, i.e. $$A:B={\rm tr}(A^TB)$$ and define a new (symmetric) matrix variable $$M=xx^T$$ We'll also need a general result about the differential of the trace of a function $$d\,{\rm tr}(f(X))=f'(X^T):dX$$ where $f'$ denotes the derivative of $f$.

Write the function in terms of this new variable and find its differential and then its gradient $$\eqalign{ f &= {\rm tr}\big(M\exp(M)\big) \cr\cr df &= (I+M)\exp(M):dM \cr &= (I+M)\exp(M):(dx\,x^T+x\,dx^T) \cr &= 2\,(I+M)\exp(M):dx\,x^T \cr &= 2\,(I+M)\exp(M)x:dx \cr\cr \frac{\partial f}{\partial x} &= 2\,(I+xx^T)\exp(xx^T)x \cr\cr }$$