Second order partial derivative of multivariable function I have a function $f(x,y) = g(u(x,y), v(x,y))$ and I need to find $\frac{\partial ^2f}{\partial x\partial y}$
I tried to solve it but I'm not too sure I'm doing it correctly. My method was the following:
$$
\frac{\partial ^2f}{\partial x\partial y} = \frac{\partial }{\partial x}(\frac{\partial f}{\partial y})
$$
$$
\frac{\partial f}{\partial y} = \frac{\partial g}{\partial u}\frac{\partial u}{\partial y} + \frac{\partial g}{\partial v}\frac{\partial v}{\partial y}
$$
$$
\frac{\partial }{\partial x}(\frac{\partial g}{\partial u}\frac{\partial u}{\partial y} + \frac{\partial g}{\partial v}\frac{\partial v}{\partial y}) = \frac{\partial }{\partial x}(\frac{\partial g}{\partial u}\frac{\partial u}{\partial y}) + \frac{\partial }{\partial x}(\frac{\partial g}{\partial v}\frac{\partial v}{\partial y})
$$
$$
\frac{\partial }{\partial x}(\frac{\partial g}{\partial u}\frac{\partial u}{\partial y}) = \frac{\partial ^2g}{\partial x\partial u}\frac{\partial u}{\partial y} + \frac{\partial g}{\partial u}\frac{\partial ^2u}{\partial x\partial y}
$$
$$
\frac{\partial }{\partial x}(\frac{\partial g}{\partial v}\frac{\partial v}{\partial y}) = \frac{\partial ^2g}{\partial x\partial v}\frac{\partial v}{\partial y} + \frac{\partial g}{\partial v}\frac{\partial ^2v}{\partial x\partial y}
$$
So
$$
\frac{\partial ^2f}{\partial x\partial y} = \frac{\partial ^2g}{\partial x\partial u}\frac{\partial u}{\partial y} + \frac{\partial g}{\partial u}\frac{\partial ^2u}{\partial x\partial y} + \frac{\partial ^2g}{\partial x\partial v}\frac{\partial v}{\partial y} + \frac{\partial g}{\partial v}\frac{\partial ^2v}{\partial x\partial y}
$$
I feel like I'm messing up at the $\frac{\partial }{\partial x}(\frac{\partial g}{\partial u}\frac{\partial u}{\partial y})$ and $\frac{\partial }{\partial x}(\frac{\partial g}{\partial v}\frac{\partial v}{\partial y})$ by using the product rule here, but I'm not sure what else I should or could do. I dont see how I'd have to use the chain rule here again if that's the intended method.
 A: The missing detail is that you need to keep track of the points where you are computing the derivatives.
For instance, your computation of $\frac{\partial f}{\partial y}$ would be written more precisely as follows:
$$\frac{\partial f}{\partial y}(x,y) = \frac{\partial g}{\partial u}(u(x,y),v(x,y))\frac{\partial u}{\partial y}(x,y) + \frac{\partial g}{\partial v}(u(x,y),v(x,y))\frac{\partial v}{\partial y}(x,y).$$
Now, to compute $\frac{\partial^2f}{\partial x\partial y}$, you indeed need to apply the product rule, as you have done. For example, the first term would be
$$\frac{\partial}{\partial x}\left(\frac{\partial g}{\partial u}(u(x,y),v(x,y))\frac{\partial u}{\partial y}(x,y)\right) = \frac{\partial g}{\partial u}(u(x,y),v(x,y)) \frac{\partial}{\partial x}\left(\frac{\partial u}{\partial y}(x,y)\right) + \frac{\partial}{\partial x}\left(\frac{\partial g}{\partial u}(u(x,y),v(x,y))\right)\frac{\partial u}{\partial y}(x,y).$$
Since we've been keeping track of where we are computing the derivatives, now you see that in the second term above you have to apply the chain rule again for $$\frac{\partial}{\partial x}\left(\frac{\partial g}{\partial u}(u(x,y),v(x,y))\right).$$
As a sanity check, note that in your computations you end up for instance with $\frac{\partial^2 g}{\partial x \partial u}$. However, $g = g(u,v)$ should be differentiated only with respect to $u$ or $v$, so it hints that something is up with the calculation.
