I am a Maths major student.
Question: Given a function $f:\mathbb{R}^2\to\mathbb{R},$ $g:\mathbb{R}^2\to\mathbb{R}^2$ and $(a_1,a_2)\in \mathbb{N}^2.$ Assume that $f$ and $g$ are infinitely differentiable. Is there a formula for $$\frac{\partial^{a_1+a_2}} {\partial x_1^{a_1} \partial x_2^{a_2}} f(g(x_1,x_2))?$$
We need to use chain rule for multivariable version. I think it has something to do with tensor, as suggested by this post. But I am unable to pintpoint some references (books or lecture notes) to build my knowledge on tensor.
The Wikipedia page on the chain rule has some info on this.
It will help to write $g=(g_1,g_2)$. Then, we have $$\partial_1(f(g_1(x_1,x_2),g_2(x_1,x_2))) = \partial_1f(g(x))\partial_1g_1(x) + \partial_2f(g(x))\partial_1g_2(x) = \partial_jf(g(x))\partial_1g_j(x).$$ Then, you just iterate this process and determine the general structure (find a pattern). Admittedly, these multivariable chain rule problems can get quite messy when computing higher derivatives.
Edit: To extend this to higher derivatives gets very involved beyond the second or third derivatives. You can look up Faà di Bruno's formula (there is a Wikipedia page on it) to see the generalized expression. I'm virtually sure you can find a proof online, so I won't reproduce it here. Unless you really can't find one, in which case I'll have a cup of coffee and give it a whirl.