# How to properly write down $\frac{\partial}{\partial xy } f(xy, x^2+3y-2)$

I am wanting to take the derivative with respect to $$x$$ of $$f(xy, x^2+3y-2)$$, so, I use the chain rule to find $$\frac{\partial}{\partial x} f(xy, x^2-2) = y \frac{\partial}{\partial xy}f(xy, x^2-2) + 2x\frac{\partial}{\partial (x^2-2)}f(xy, x^2-2)$$ With which I would then continue $$\frac{\partial}{\partial xy} f(xy, x^2-2) = \frac{1}{x} \frac{\partial}{\partial y} f(xy, x^2-2)$$ However, when differentiating w.r.t $$xy$$, I am not communicating to the reader that $$x^2-2$$ is expected to remain a constant, and it would seem to them that I should rewrite $$x^2-2$$ as $$\left(\frac{xy}{y}\right)^2-2$$.

How do I use mathematical notation to communicate to another mathematician that $$x^2-2$$ remains constant when differentiating with respect to $$xy$$?

You start out wanting $$\frac{\partial}{\partial x}f(xy,x^2-2)$$.

There is this function $$f$$ of two variables that I might call $$u$$ and $$v$$: $$f=f(u,v)$$. Here, $$u$$ is composed with $$xy$$ and $$v$$ with $$x^2-2$$. The chain rule says:

\begin{align} \frac{\partial}{\partial x}f(xy,x^2-2) &=\frac{\partial f}{\partial u}\cdot\frac{\partial u}{\partial x}+\frac{\partial f}{\partial v}\cdot\frac{\partial v}{\partial x}\\ &=\frac{\partial f}{\partial u}\cdot y+\frac{\partial f}{\partial v}\cdot2x\\ \end{align}

And that's where I'd leave it until you know more about the nature of $$f(u,v)$$. You have $$u$$ and $$v$$, independent variables. No one will think they have a relation. Later, if you have some formula for $$f(u,v)$$ and you can actually write a formula for $$\frac{\partial f}{\partial u}$$ and $$\frac{\partial f}{\partial v}$$, you could substitute away the $$u$$s and $$v$$s with $$xy$$ and $$x^2-2$$. Or you could write it as

$$\left.\left(y\frac{\partial f}{\partial u}+2x\frac{\partial f}{\partial v}\right)\right\rvert_{u=xy,v=x^2-2}$$

Let $$\alpha(x,y)=xy$$ and $$\beta(x,y)=x^2-2$$. Then, the function you're actually looking at is the composition $$F(x,y)=f(\alpha(x,y),\beta(x,y))$$. The chain rule tells you \begin{align} (\partial_1F)_{(x,y)} &=(\partial_1f)_{(\alpha(x,y),\beta(x,y))}\cdot (\partial_1\alpha)_{(x,y)} + (\partial_2f)_{(\alpha(x,y),\beta(x,y))}\cdot (\partial_1\beta)_{(x,y)}\\ &= (\partial_1f)_{(xy-x^2-2)}\cdot y + (\partial_2f)_{(xy-x^2-2)}\cdot 2x. \end{align} This is the strictest way of writing down the chain rule, and also the least ambiguous: the subscripts $$1,2$$ tell you along which direction you're calculating the partial derivatives, and the subscripts $$(xy,x^2-2)$$ etc tell you the point of evaluation of the derivatives. So, if you want to be 100% precise, this is how you could write the chain rule calculation.

If you want a slight mix with the Leibniz notation, you could also write this:

\begin{align} \frac{\partial}{\partial x} f(xy,x^2-2) &= (\partial_1f)_{(xy,x^2-2)}\cdot \frac{\partial (xy)}{\partial x} + (\partial_2f)_{(xy,x^2-2)}\cdot \frac{\partial (x^2-2)}{\partial x}\\ &=(\partial_1f)_{(xy-x^2-2)}\cdot y + (\partial_2f)_{(xy-x^2-2)}\cdot 2x. \end{align}