Suppose I have the arbitrary functions $f, g$, and $h: \mathbb{R}^2 \longrightarrow \mathbb{R}$. The question I have is, what is the derivative with respect to $x$ of: \begin{equation} f(g(x,y), h(x, y)) \end{equation}
It is important that the functional relationship between g(x,y) and h(x,y) remains arbitrary. I do understand the chain rule if it were to be applied to a simple case such as $f(g(x,y))$, in which case this would be equal to $f_x(g(x,y))g_x(x,y)$, where $f_x$ and $g_x$ are the partial derivatives with respect to $x$. Thank you.
Roughly speaking, if you vary $x$ a small amount, say, $x\to x+\Delta x$, then
$$g(x+\Delta x)= g(x) + g'(x)\Delta x + O(\Delta x^2)$$
If $f$ only had one argument, the usual chain rule can be expressed informally via linear approximations,
\begin{align} f(g(x+\Delta x))-f(g(x)) &\approx f(g(x)+g'(x)\Delta x)-f(g(x))\\ &\approx f(g(x)) +f'(g(x))g'(x)\Delta x-f(g(x)\\ &= f'(g(x))g'(x)\Delta x \end{align}
Plus some term of order $(\Delta x)^2$. Dividing by $\Delta x$ and taking limits yields the familiar expression.
But since we're now varying both arguments of $f = f(u,v)$ (let's call them $u,v$ to distinguish them from $x,y$), we need to add on two terms:
\begin{align} &f(g(x+\Delta x,y),h(x+\Delta x,y))-f(g(x,y),h(x,y)) \\ &\approx f(g(x,y)+g_x(x,y)\Delta x, h(x,y)+h_x(x,y)\Delta x)-f(g(x,y),h(x,y))\\ &\approx f_u(g(x,y),h(x,y))g_x(x,y)\Delta x + f_v(g(x,y),h(x,y))h_x(x,y)\Delta x \end{align}
Plus some term of order $(\Delta x)^2$ as before. Dividing by $\Delta x$ and taking limits yields one form of the multivariable chain rule:
$$\frac{\partial}{\partial x}f(g(x,y),h(x,y)) = f_u(g(x,y),h(x,y))g_x(x,y) + f_v(g(x,y),h(x,y))h_x(x,y)$$
Which is sometimes expressed more compactly as
$$\frac{\partial f}{\partial x} = \frac{\partial f}{\partial u}\frac{\partial u}{\partial x}+\frac{\partial f}{\partial v}\frac{\partial v}{\partial x}$$
Where $f=f(u,v)$ and $u,v$ are understood to dependent on $x,y$ via $u(x,y) = g(x,y)$ and $v(x,y)=h(x,y)$.