# Example of a multivariable nondifferentiable function with directional derivatives.

Please give an example of a continuous function $f:\mathbb{R}^2\rightarrow \mathbb{R}$ all of whose directional derivatives exist, so for every $\mathbf{v}\in\mathbb{R}^2$ $$df_{\mathbf{x}}(\mathbf{v})=\lim\limits_{t\to 0}\frac{f(\mathbf{x}+t\mathbf{v})-f(\mathbf{x})}{t}$$ exists, however $f$ is not differentiable, say at $(0,0)$.

• Does this post answer your question to your satisfaction? – Omnomnomnom Feb 18 '18 at 23:41
• @Omnomnomnom Thanks for the reference, unfortunately, those examples, are unsatisfying, many not being continuous. Or not defines in a nbd of the origin. – Rene Schipperus Feb 18 '18 at 23:45
• @ReneSchipperus see: math.stackexchange.com/questions/372070/… – dromastyx Feb 18 '18 at 23:47
• @Rene You're welcome. And I'm glad I didn't vote to close this as a duplicate, then. – Omnomnomnom Feb 18 '18 at 23:48
• @dromastyx Thanks, for that, I verified the example, I like it ! – Rene Schipperus Feb 18 '18 at 23:55

For instance, $$f(x,y)=\begin{cases}\sqrt{x^2+y^2}\exp\frac{x^4}{(y-3x^2)(y-x^2)}&\text{if }x>0\wedge x^2<y<3x^2\\ 0&\text{otherwise}\end{cases}$$
This function is continuous, because in the aforementioned domain $0\le \exp\frac{x^4}{(y-3x^2)(y-x^2)}\le e^{-1}$.
The region $\{f\ne 0\}$ intersects each line through the origin outside of a neighbourhood of $(0,0)$, so $\partial_vf(0)=0$ for all $v$. However, $\limsup_{(x,y)\to0}\frac{f(x,y)}{\sqrt{x^2+y^2}}\ge \lim_{x\to 0}\exp\frac{x^4}{(2x^2-3x^2)(2x^2-x^2)}=e^{-1}$ .