I would like to compute the following. How can I do this?
$$\frac{\partial }{\partial X}\text{Tr} \big( X \log X \big)$$
Or, more generally, how to compute derivatives of the following form?
$$\frac{\partial }{\partial X}\text{Tr} \big( f(X) g(X) \big)$$
Many thanks!
Consider the scalar function and its first derivative $$\eqalign{ h(s) &= f(s)g(s) \cr h' &= fg'+gf' \cr }$$ Your general function applies this scalar function to a matrix argument, i.e. $H=h(X),\,$ then takes the trace. So the function, differential and gradient are given by $$\eqalign{ \phi &= {\rm tr}(H) \cr d\phi &= {\rm tr}(H'\,dX) \cr \frac{\partial\phi}{\partial X} &= H' = \,\,f(X)g'(X)+g(X)f'(X) \cr }$$ Depending on your preferred layout convention, the gradient may be transposed.