A non-convex set with $\partial x = 0$ but does depend on $ x$

40 Views Asked by At

Question states: "Let $f: S \to \Bbb R$ be differentiable and let $s \subset \Bbb R^n$. Furthermore, let $\partial _1 f(x) = 0$ for all $x \in S$. Show that if $S$ is convex, then $f$ doesn't depend on $x_1$ (meaning $f(a) = f(b)$ if $a$ and $b$ only differ in the first component). Is this still true if $S$ is not convex?"

I just wanted to make sure that my proof for the second part is correct.

Consider the function $f(x,y) = \frac{x^2y}{x+y}$ and the set $S=\{(0,0), (2,-1), (16,-2)\}$. $\partial _x f(x,y) = \frac{x^2y+2xy^4}{(x+y^3)^2}$, and it can be verified that $\partial _1 f(x) = 0$ for all $x \in S$. However, $f$ is dependent on $x$.

If my proof isn't correct, why is that, and what is the correct approach to the problem?