what's the right way to take the derivative of $xy-x$ where $x\le y$ in y when $x=y$?

36 Views Asked by At

When $x<y$, we simply have $\frac{\partial xy-x}{\partial y}=x$. However, when $x=y$, it is a little bit tricky for me. If we first take the derivative of $xy-x$ in $y$, then plug $x=y$ into the derivative, the result is $y$. However, I guess we can also plug $x=y$ into $xy-x$, then take the derivative in $y$, the result is $2y-1$. The first approach seems to be the natural procedure, however, I believe the second approach is the right one. My reasoning is (1) both $x$ and $y$ in $xy-x$ when $x=y$ are functions of $y$ and (2) the function $xy-x$ when $x=y$ is $y^2-y$ which has a decreasing linear part, i.e., $-y$ and the result should reflect it.

I abstract this question from my research and in my research context, the second approach should be right. However, some colleague of mine thinks the first approach is right since it is the right procedure and the second approach gives a result of $2y-1$ which is so far away from $\frac{\partial xy-x}{\partial y}=x$ when $x$ is super close to $y$, which he believes this sounds like the function $xy-x$ is not continuous anymore. Another colleague told me that both can be right and they just have different interpretations in the real world.

I was wondering whether you could point out whether both are right and what are the possible interpretations. Are there any fundamental theorems that take care of this issue? Thank you so much!

1

There are 1 best solutions below

2
On

The first approach is correct. Fundamentally, we have that $$\left.\frac{\partial}{\partial y}(xy-x)\right|_{x=y} \neq \frac{\partial}{\partial y}(y^2 - y)$$
This happens for the same reason that, when you are calculating $f'(a)$, you don't plug $a$ into $f$ first and then differentiate; instead you differentiate first and then plug in $a$. I recommend looking at the definition of the derivative.