Chain Rule for a function $f: \mathbb{R}^{n\times n} \to \mathbb{R}$

66 Views Asked by At

Suppose, we have a function $f: \mathbb{R}^{n\times n} \to \mathbb{R}$. Also, let \begin{align} f_1(x)= f(x {\bf I}) \end{align} where $x \in \mathbb{R}$ and ${\bf I}$ is the identity matrix.

Now suppose that

\begin{align} \frac{d}{dx}f_1(x)=\frac{d}{dx}f(x {\bf I})=g(x{\bf I})=g_1(x) \end{align}

My question: Can we do a chain rule of differentiation as follows. Let ${\bf h}(x): \mathbb{R} \to \mathbb{R}^{n \times n}$ and we want to find \begin{align} \frac{d}{dx}f({\bf h}(x))=?? \end{align}

I think the expression should be something like \begin{align} \frac{d}{dx}f(h(x))= g({\bf h}(x)) {\rm det}(J({\bf h}(x))) \end{align} where $(J({\bf h}(x)))$ is the determinant of the Jacobian of ${\bf h}(x)$. Is this correct?

1

There are 1 best solutions below

1
On BEST ANSWER

In your general case $f\circ h$ the chain rule says $$\frac{d}{dx}f(h(x))=\sum_{i,j}\frac{\partial f}{\partial h_{ij}} \frac{\partial h_{ij}}{\partial x}$$

In your special case $h$ is given by $h_{ij}= x \delta_{ij}$ so $$ \frac{\partial h_{ij}}{\partial x} = \delta_{ij}$$ So you end up with

$$ \frac{d}{dx}f(h(x))= \sum_i \frac{\partial f}{\partial h_{ii}} = \text{trace}\,\left(\frac{\partial f}{\partial h_{ij}}\right)$$