Cancel partial derivative in fraction The question is related to this one.


Let $f(x,y) = xy$ and $g(x,y) = f(x,y)^2 = x^2y^2$.
Now consider the fraction of partial derivatives
\begin{align}
\frac{\frac{\partial g}{\partial x}}{\frac{\partial f}{\partial x}} = \frac{2xy^2}{y} = 2xy
\end{align}

I was wondering if I can cancel $\partial x$ in the fraction, i.e.,
\begin{align}
\frac{\frac{\partial g}{\partial x}}{\frac{\partial f}{\partial x}} = \frac{\partial g}{\partial f} = \frac{\partial f^2}{\partial f} = 2f = 2xy. 
\end{align}


Is this some general principle or coincidence?
This is not by accident. As N74 said, this is chain rule. So $$\frac{\partial g}{\partial f}=\frac{\partial g}{\partial x}\frac{\partial x}{\partial f}+\frac{\partial g}{\partial y}\frac{\partial y}{\partial f}=\frac{\frac{\partial g}{\partial x}}{\frac{\partial f}{\partial x}}+\frac{\frac{\partial g}{\partial y}}{\frac{\partial f}{\partial y}}$$
This is not by accident. As N74 said, this is chain rule. So $$\frac{\partial g}{\partial f}=\frac{\partial g}{\partial x}\frac{\partial x}{\partial f}+\frac{\partial g}{\partial y}\frac{\partial y}{\partial f}=\frac{\frac{\partial g}{\partial x}}{\frac{\partial f}{\partial x}}+\frac{\frac{\partial g}{\partial y}}{\frac{\partial f}{\partial y}}$$