Taking derivative with function of multiple variables? Suppose we are studying the function
$$ 
f(x,y) = xy + ax^2 + bx^2y^2,
$$
We want to find the maximum $x$ satisfying the equation
$$ 
f(x,y) = c,
$$
where $a, b, c$ are constants. Somebody suggested to make use of the following auxiliary function
$$ 
g(x,y) = xy,
$$
so that
$$ 
g + ax^2 + bg^2 = c.
$$
Isolating $x$,
$$
x^2 = \frac{c-g-bg^2}{a}.
$$
Now he says that the same condition as $ \frac{dx}{dy} = 0 $ is
$$ \frac{dx^2}{d g(x,y)} = 0$$
Why?
Edit: I saw this trick here.

I don't want to go into details of different cases, so I will assume that $x$ and $a,b,c$ are all positive, while $y$ is negative.
The canonical procedure would be to solve $f(x,y)=c$ with respect to $x$, to obtain $x=g(y)$, then solve $g'(y)=0$ to obtain $y_0$ (suppose it is unique), finally the solution would be $x_0 = g(y_0)$.
If we make a change of variables, as
\begin{align}
X &= x^2, \\
Y &= xy,
\end{align}
the equation $f(x,y)=c$ becomes $F(X,Y)=c$, i.e.
$$
Y+aX+bY^2=c.
$$
Taking into account that when $x$ is positive and maximum, also $X$ will be maximum, thanks the relation $X=x^2$ between them, then we can solve for $X$ and obtain $X=G(Y)$, i.e.
$$
G(Y)=\frac{c-Y-bY^2}{a}
$$
and solve $G'(Y)=0$ obtaining
$$
Y_0 = -\frac{1}{2b}
$$
and of consequence
$$
X_0 = G(Y_0)=\frac{1}{a}\left(\frac{1}{4b}+c\right)
$$
and finally
$$
x_0 = \sqrt{\frac{1}{a}\left(\frac{1}{4b}+c\right)}
$$
As a final remark, my $X=G(Y)$ corresponds to your
$$
x^2 = \frac{c-g-bg^2}{a}.
$$
while my $G'(Y)=0$ corresponds to your
$$ 
\frac{dx^2}{d g(x,y)} = 0.
$$
