Partial derivative vs Total derivative Are partial derivative and total derivative different for a system with independent variables?
The term $\frac{df(x,y)}{dx} = \frac{\partial f(x,y)}{\partial x}+\frac{\partial f(x,y)}{\partial y}\frac{dy}{dx}$. But as $y$ and $x$ are independent, so $\frac{dy}{dx} = 0$. So, how are two different?
 A: Strictly speaking, the equation you have written down is riddles with notational ambiguities. What is going on is that there are actually three different functions involved:

*

*We have a function $f:\Bbb{R}^2\to\Bbb{R}$. This means it takes in a tuple of numbers as an input and spits out a real number as output.

*We then have a function $g:\Bbb{R}\to\Bbb{R}$. This takes in a real number as input and spits out a real number.

*Finally, we have a third function $F:\Bbb{R}\to\Bbb{R}$. This function is defined in a very specific way from the previous two functions: we define for each $x\in\Bbb{R}$, $F(x):= f(x,g(x))$. Note that $F$ and $f$ are COMPLETELY DIFFERENT FUNCTIONS (afterall how can two functions be equal if one of them has domain $\Bbb{R}^2$ and the other has domain $\Bbb{R}$). We say that $F$ is obtained from $f$ via composition.

Let me just re-emphasize what the third bullet point means. If you give me a specific real number $x\in\Bbb{R}$, then the quantity $g(x)$ is also a specific real number. The quantity $(x,g(x))$ is a specific tuple of real numbers. So, $f(x,g(x))$ is a specific real number. I'm only emphasizing these things because it is very important to distinguish between a function (which is a "rule") vs the value of a function when evaluated at a point of its domain (which is a certain output in the target space).
Now, what is being claimed is that by the chain rule,
\begin{align}
F'(x)&= (\partial_1f)_{(x,g(x))} + (\partial_2f)_{(x,g(x))}\cdot g'(x) \tag{$*$}
\end{align}
And of course, there is no reason at all to assume $g'=0$ identically.
Here, the notation $\partial_if_{(a,b)}$ means the partial derivative of the function $f$ along the $i^{th}$ coordinate direction, evaluated at the point $(a,b)$. It is important to note that $\partial_if$ is a function, while $(\partial_if)_{(a,b)}$ is a specific real number obtained by evaluating the function on an element of its domain. I think $(*)$ is the most notationally precise and unambiguous way of writing things down. A slightly more common way of writing things is as follows:
\begin{align}
\dfrac{dF}{dx}\bigg|_x &=\dfrac{\partial f}{\partial x}\bigg|_{(x,g(x))} + \dfrac{\partial f}{\partial y}\bigg|_{(x,g(x))}\cdot \dfrac{dg}{dx}\bigg|_{x} \tag{$**$}
\end{align}
This is I think as precise as you can get when using Leibniz's notation.
Hopefully by now it is clear that your confusion arises from a poor notational choice. Wherever you read that equation from, they're reusing the same letters in two different places with two different meanings, which is why you're getting confused:

*

*On the left hand side, they're using the letter $f$ when they should have actually been using $F$.

*On the right hand side, the meaning of the $y$ in $\frac{\partial f}{\partial y}$ is different from the meaning of $y$ in $\dfrac{dy}{dx}$.

*Also, they're not indicating the point of evaluation of the derivatives.

The most ambiguous (for a beginner) way of writing down this relationship is
\begin{align}
\dfrac{df}{dx}&=\dfrac{\partial f}{\partial x}+\dfrac{\partial f}{\partial y}\dfrac{dy}{dx}. \tag{$***$}
\end{align}

See also this other answer of mine for similar things about varying levels of precision in notation, and this answer, which deals with derivatives in the setting of Lagrangian mechanics.
