Let $f = f(x,y,z,w)$ where $w = w(x,y,z)$. How do you compute $\frac{\partial f}{\partial x}$? For example, say $f(x,y,z,w) = x + yze^{xw}$. Then you would get $\frac{\partial f}{\partial x} = (1 + yzwe^{xw}) + (0 + yz\frac{\partial w}{\partial x})e^{xw}$ = (take derivative with respect to x as if y,z,w is constant) + (take derivative as if x,y,z constant but w is still a function of x). So a general formula would then be \begin{equation} \frac{\partial f}{\partial x}|_{(x_0,y_0,z_0)} = \frac{\partial}{\partial x} f(x,y_0,z_0,w(x_0,y_0,z_0))|_{x = x_0} + \frac{\partial}{\partial x} f(x_0,y_0,z_0,w(x,y_0,z_0))|_{x = x_0} \end{equation}
Is this correct? If so, is there a simpler way of seeing why this formula works?
Define a 3-variable function
$$g(x,y,z) = f(x,y,z,w(x,y,z))$$
Then its derivative, according to the chain rule, is
$$g^{(1,0,0)}(x,y,z) = f^{(1,0,0,0)}(x,y,z,w(x,y,z)) + f^{(0,0,0,1)}(x,y,z,w(x,y,z))\cdot w^{(1,0,0)}(x,y,z)$$
As another example, if
$$h(x) = f(x,5,u(x),v(x))$$
then
$$\begin{align} h'(x) = h^{(1)}(x) &= f^{(1,0,0,0)}(x,5,u(x),v(x)) \\ &+ f^{(0,0,1,0)}(x,5,u(x),v(x))\cdot u'(x) \\ &+ f^{(0,0,0,1)}(x,5,u(x),v(x))\cdot v'(x) \end{align}$$