All directional derivatives vanish does not imply function is constant

calculusreal-analysis

Are there functions $f:\mathbb{R}^2\rightarrow \mathbb{R}$ for which every directional derivative in a certain point vanishes but the function is still not constant?

I thought about something like the following: $f(x,y)= \sin x$, if there is a $t\in\mathbb{R}\setminus\{0\}$ such that $(x,y)=(t,t^2)$ but $f(x,y)=0$ everywhere else. Does this work?

Best Answer

If you are talking about one point then, no it need not be constant. For example $$f(x,y) = x^2 + y^2$$ then $$\nabla f|_{(0,0)} = (0,0)^T$$ However if all direction derivatives vanish everywhere (or on some open set), and $f\in C^1$, then yes, $f$ must be constant. See this post All partial derivatives 0. Also note $\nabla f|_{(x,y)}\cdot (1,0)^T = 0$ implies $\partial_xf|_{(x,y)} = 0$ and similarily for all other partial derivatives.