In my analysis course we've been dealing strictly with functions from $\mathbb{R}^n$ to $\mathbb{R}$, and we've been given the following formula for calculating derivative of $f(x(t),y(t))$ w.r.t. $t$:
$\frac{df}{dt} = \frac{\partial f}{\partial x}\cdot\frac{dx}{dt} + \frac{\partial f}{\partial y}\cdot\frac{dy}{dt}$
Now I'm struggling with following problem:
Let $f, g : R^2 → R$ be differentiable. Define $h(x, y) = f(g(u, v), −g(u, v))$. Show that $dh = (f_x − f_y)dg$
It seems to me the right approach would be to try to find $\frac{dh}{dg}$. I didn't know how to start, so I tried finding $\frac{dh}{dt}$, where $h(t) = f(x(t),y(t))$ , $x = t$, $y = -t$. Formula above gives: $$ \frac{dh}{dt} = \frac{df}{dx} - \frac{df}{dy}\quad \rightarrow\quad dh =(f_x − f_y)dt$$ And since $y(t) = - x(t)$ the result above applies to $h(t) = f(x(t),-x(t))$.
It looks very similiar to what I'm trying to show, but I don't know what to do when the inside functions rely on 2 variables.
It can be helpful in problems like these to introduce intermediate functions: here, the function $\phi: t\mapsto(t,-t)^T$ looks like it’ll help untangle things a bit. It can also be helpful to use positional notation for partial derivatives instead of dummy variable names, which have a tendency to get overloaded. We then have $h = f\circ\phi\circ g$ and $$dh_{\mathbf p} = df_{\phi(g(\mathbf p))} \circ d\phi_{g(\mathbf p)} \circ dg_\mathbf p.$$ If we fix coordinate systems for the domains and ranges of these functions, we can identify the differentials with Jacobian matrices and the chain rule becomes matrix multiplication: $$dh = \begin{bmatrix}f_1&f_2\end{bmatrix} \begin{bmatrix}1\\-1\end{bmatrix} dg = (f_1-f_2)\,dg,$$ with the partial derivatives of $f$ evaluated at the point $(g(u,v),-g(u,v))$.