What is $\frac{\partial^2(g\circ f)}{\partial x_i \partial x_j}(c)$
If $f:A\to \mathbb R^k$ and $g:B\to \mathbb R$ are two functions of class $C^2$ and their composition is well defined.
For $c \in A$ what is $$\frac{\partial^2(g\circ f)}{\partial x_i \partial x_j}(c)$$
Is it just $$\frac{\partial^2(g\circ f)}{\partial x_i \partial x_j}(c)=\frac{\partial^2g}{\partial x_i \partial x_j}(f(c))\frac{\partial^2f}{\partial x_i \partial x_j}(c) $$
If it is how to prove it. I get from $$\frac{\partial^2(g\circ f)}{\partial x_i \partial x_j}(c)=\frac{\partial}{\partial x_i}\frac{\partial(g\circ f)}{ \partial x_j}(c)=\frac{\partial}{\partial x_i}\left( \frac{\partial g}{ \partial x_j}(f(c))\frac{\partial f}{\partial x_j}(c)\right)$$
but not sure how to calculate this, is this a product rule?
Solution 1:
We consider open sets $A\subseteq \mathbb{R}^n$, $B\subseteq \mathbb{R}^k$ and $C^2$ functions $f$ and $g$ \begin{align*} &f:A\subseteq \mathbb{R}^n\to\mathbb{R}^k\\ &g:B\subseteq f(A)\to\mathbb{R} \end{align*} We have real-valued functions \begin{align*} &f_1\left(x_1,\ldots,x_n\right),\ldots,f_k\left(x_1,\ldots,x_n\right)\\ &g\left(f_1,\ldots,f_k\right) \end{align*} and obtain \begin{align*} \frac{\partial\left(g\circ f\right)}{\partial x_j} &=\frac{\partial g}{\partial f_1}\,\frac{\partial f_1}{\partial x_j} +\frac{\partial g}{\partial f_2}\,\frac{\partial f_2}{\partial x_j}+\cdots+\frac{\partial g}{\partial f_k}\,\frac{\partial f_k}{\partial x_j}\\ &=\sum_{q=1}^k\frac{\partial g}{\partial f_q}\frac{\partial f_q}{\partial x_j}\tag{1} \end{align*}
More verbose we can write (1) as \begin{align*} \frac{\partial\left(g\circ f\right)}{\partial x_j}\left(x_1,\ldots,x_n\right) &=\sum_{q=1}^k\frac{\partial g}{\partial f_q}\left(f_1\left(x_1,\ldots,x_n\right),\ldots,f_k\left(x_1,\ldots,x_n\right)\right)\cdot\frac{\partial f_q}{\partial x_j}\left(x_1,\ldots,x_n\right) \end{align*}
We calculate from (1) the second partial derivative:
\begin{align*} \color{blue}{\frac{\partial^2\left(g\circ f\right)}{\partial x_i\,\partial x_j}} &=\frac{\partial }{\partial x_i}\left(\frac{\partial\left(g\circ f\right)}{\partial x_j}\right)\\ &=\frac{\partial }{\partial x_i}\left(\sum_{q=1}^k\frac{\partial g}{\partial f_q}\frac{\partial f_q}{\partial x_j}\right)\tag{2}\\ &=\sum_{q=1}^k\frac{\partial }{\partial x_i}\left(\frac{\partial g}{\partial f_q}\frac{\partial f_q}{\partial x_j}\right)\\ &=\sum_{q=1}^k\left[\left(\frac{\partial }{\partial x_i}\left(\frac{\partial g}{\partial f_q}\right)\right)\frac{\partial f_q}{\partial x_j} +\frac{\partial g}{\partial f_q}\frac{\partial}{\partial x_i}\left(\frac{ \partial f_q}{\partial x_j}\right)\right]\tag{3}\\ &=\sum_{q=1}^k\left(\frac{\partial^2 g}{\partial f_1\partial f_q}\frac{\partial f_1}{\partial x_i} +\cdots+\frac{\partial^2 g}{\partial f_k\partial f_q}\frac{\partial f_k}{\partial x_i}\right) \frac{\partial f_q}{\partial x_j} +\sum_{q=1}^k\frac{\partial g}{\partial f_q}\frac{\partial ^2 f_q}{\partial x_i\partial x_j}\tag{4}\\ &\,\,\color{blue}{=\sum_{q=1}^k\sum_{r=1}^k\frac{\partial^2 g}{\partial f_r\partial f_q} \frac{\partial f_r}{\partial x_i}\frac{\partial f_q}{\partial x_i} +\sum_{q=1}^k\frac{\partial g}{\partial f_q}\frac{\partial ^2 f_q}{\partial x_i\partial x_j}} \end{align*}
Comment:
-
In (2) we apply (1).
-
In (3) we apply the product rule for partial derivatives.
-
In (4) we apply the chain rule for partial derivatives according to (1).
Solution 2:
Edit this is what I got from 1 day of thought :D
$f : A \to B, g: B \to \mathbb R^m, A\subseteq \mathbb R^n, B\subseteq \mathbb R^k$
$ \begin{aligned}\frac{\partial^2(g\circ f)}{\partial x_i\partial x_j}(x) &=\frac{\partial}{\partial x_i}\left(\frac{\partial(g\circ f)}{\partial x_j}(x)\right) \\&=\frac{\partial}{\partial x_i}\left(\nabla (g\circ f)(x)e_j \right) \\&=\frac{\partial}{\partial x_i}\left(\nabla g(f(x))\nabla f(x)e_j) \right) \\&=\frac{\partial}{\partial x_i}\left(\nabla g(f(x)) \frac{\partial f}{\partial x_j}(x) \right)\\& =\frac{\partial}{\partial x_i}\left(\sum_{p=1}^k \frac{\partial g}{\partial x_p}(f(x))\frac{\partial f_p}{\partial x_j}(x)\right) \\&=\sum_{p=1}^k\frac{\partial}{\partial x_i}\left(\frac{\partial g}{\partial x_p}(f(x))\frac{\partial f_p}{\partial x_j}(x) \right)\\ &=\sum_{p=1}^k\left[ \frac{\partial}{\partial x_i}\left(\frac{\partial g}{\partial x_p}(f(x)) \right)\frac{\partial f_p}{\partial x_j}(x)+\frac{\partial g}{\partial x_p}(f(x)) \frac{\partial^2f_p}{\partial x_i\partial x_j}(x) \right]\\ &= \sum_{p=1}^k \frac{\partial}{\partial x_i}\left(\frac{\partial g}{\partial x_p}(f(x)) \right)\frac{\partial f_p}{\partial x_j}(x)+ \sum_{p=1}^k \frac{\partial g}{\partial x_p}(f(x)) \frac{\partial^2f_p}{\partial x_i\partial x_j}(x)\\ &=\sum_{p=1}^k\sum_{l=1}^k\frac{\partial^2g}{\partial x_l\partial x_p}(f(x))\frac{\partial f_l}{\partial x_i}(x)\frac{\partial f_p}{\partial x_j}(x)+\sum_{p=1}^k \frac{\partial g}{\partial x_p}(f(x)) \frac{\partial^2f_p}{\partial x_i\partial x_j}(x)\end{aligned} $
Also from this we get $\begin{aligned}D^2(g\circ f)(x)(h,k)&=\sum_{i=1}^n\sum_{j=1}^n\frac{\partial^2(g\circ f)}{\partial x_i\partial x_j}(x) h_ik_j\\ &=\sum_{i=1}^n\sum_{j=1}^n\left(\sum_{p=1}^k\sum_{l=1}^k\frac{\partial^2g}{\partial x_l\partial x_p}(f(x))\frac{\partial f_l}{\partial x_i}(x)\frac{\partial f_p}{\partial x_j}(x)+\sum_{p=1}^k \frac{\partial g}{\partial x_p}(f(x)) \frac{\partial^2f_p}{\partial x_i\partial x_j}(x) \right)h_ik_j\\ \\&=\sum_{i=1}^n\sum_{j=1}^n\left(\sum_{p=1}^k\sum_{l=1}^k\frac{\partial^2g}{\partial x_l\partial x_p}(f(x))\frac{\partial f_l}{\partial x_i}(x)h_i\frac{\partial f_p}{\partial x_j}(x)k_j\right)\\+ \sum_{i=1}^n\sum_{j=1}^n\left(\sum_{p=1}^k \frac{\partial g}{\partial x_p}(f(x)) \frac{\partial^2f_p}{\partial x_i\partial x_j}(x)h_ik_j \right)\\ \\&=\sum_{p=1}^k\sum_{l=1}^k\frac{\partial^2g}{\partial x_l\partial x_p}(f(x))\left(\sum_{l=1}^n\frac{\partial f_l}{\partial x_i}(x)h_i\right)\left(\sum_{p=1}^n\frac{\partial f_p}{\partial x_j}(x)k_j \right)\\ +\sum_{p=1}^k \frac{\partial g}{\partial x_p}(f(x))\left(\sum_{i=1}^n\sum_{j=1}^n \frac{\partial^2f_p}{\partial x_i\partial x_j}(x)h_ik_j\right)\\ &=\sum_{p=1}^k\sum_{l=1}^k\frac{\partial^2g}{\partial x_l\partial x_p}(f(x))(Df_l(x)h)(Df_p(x)k)\\+\sum_{p=1}^k \frac{\partial g}{\partial x_p}(f(x))D^2f_p(x)(h,k)\\& =\sum_{p=1}^k\sum_{l=1}^k\frac{\partial^2g}{\partial x_l\partial x_p}(f(x))(Df(x)h)_l(Df(x)k)_p\\+\sum_{p=1}^k \frac{\partial g}{\partial x_p}(f(x))\left(D^2f(x)(h,k)\right)_p\\&=D^2g(f(x))(Df(x)h,Dg(x)k)+Dg(f(x))(D^2f(x)(h,k)) \end{aligned}$
That is we get $$D^2(g\circ f)(x)(h,k)=D^2g(f(x))(Df(x)h,Dg(x)k)+Dg(f(x))(D^2f(x)(h,k))$$