I had a little argument with a friend about this. Let $f$ be a differentiable function such that $$g(x,y,z) =xy \ f \left( \frac{y}{x} \right) -z $$
Then, is it mathematically correct to write (I think this is completely ok) $$\nabla g = \left[ y \ f \left( \frac{y}{x} \right) + xy \ f' \left( \frac{y}{x} \right) \left( - \frac{y}{x^2} \right) \right] \hat i + [ \cdots ] \ \hat j - \hat k \tag{1}$$
My friend claims that since $f$ depends on two variables, I cannot just simply write $f'$, and she says that I should have defined $u = \frac{y}{x}$ so that $f'(u)$ would be meaningful.
i.e. she says that the only way to write this gradient is $$\nabla g = \left[ y \ f (u) + xy \ f' (u) \frac{\partial u}{\partial x} \right] \hat i + [ \cdots ] \ \hat j - \hat k \tag{2}$$
I know the way she does in (2) is also true, but does my notation (1) have a problem?