I learned that for a point to be an extremum of a function, the necessary condition is that the partial derivatives of the function with respect to its variables must be zero. However, suppose I have a function $$f(x,y(x)) = x - \sqrt{y}$$ and $y$ implicitly depends on $x$ such that $y(x) = x$.
The minimum of this function is achieved at $x = 1/4$.
However, $\frac{\partial f}{\partial x} = 1$ for all $x$.
Isn't this a contradiction?
In the statement
the variables must be independent.