# Lagrange and Leibniz notation.

Suppose $g=g(x,y)$ is a certain function and we need to find the new function $g_x(x^2y,y)$, say. How would one write this in Leibniz notation. Is it

$\cfrac{\partial g(x^2y,y)}{\partial x}$ or $\left.\cfrac{\partial g(t,y)}{dt}\right|_{t=x^2y}$ or $\cfrac{\partial g}{\partial x}(x^2y,y)$ or $\cfrac{\partial g(x^2y,y)}{\partial (x^2y,y)}$.

This first one seems a bit ambiguous for do we first form the new function $g(x^2y,y)$ or do the differentiation first (the results would be very different if $g(x,y)=x+y$ for example). The second one I think it is correct but wonder if there is a bit less clumsy notation. Finally the third one is ambiguous again because it can be interpreted as multiplying $g_x(x,y)$ with (vector) $(x^2y,y)$.

In my humble opinion, Leibniz's notation is definitely hopeless, since it confuses the function with the value. Actually, this is exactly its scope, since we all wish to write $\frac{d}{dx} x^2 = 2x$. But it becomes a nightmare with compositions: what is $$\frac{d}{dx} f(x^2)?$$ Is it $f'(x^2)$ or $2x f'(x^2)$?
I suggest avoiding Leibniz notation in such cases: just give a name to the composition. My golden rule is this: use Leibniz's notation when you deal with explicit functions, and use a more "functional" notation when your functions are generic (i.e. only labels, names: $f$, $g$, $H$,...)