Let $u(x, y)=x+y$. What is $\displaystyle\frac{\partial u}{\partial x}$ and $\displaystyle\frac{\partial u}{\partial y}$? My answers are $1$ and $1$.
Suppose I now told you that $y=x$, so that $u=2x$.
Now it appears that $\displaystyle\frac{\partial u}{\partial x}=2$ and $\displaystyle\frac{\partial u}{\partial y}=0$.
Where have I gone wrong?
Note: My question is completely different from "Partial derivatives paradox". I have renamed my question.