Is this function differentiable? Is this directional derivative correct

calculusmultivariable-calculussolution-verification

I need to find the directional derivatives for all vectors $u=[u_1\ \ u_2]\in \mathbb R^2$ with $\|u\|=1$ at $P_0=(0,0)$, and determine whether $f$ is differentiable at $P_0$.

$$f(x,y)=\begin{cases}
1 & y=x^2,x\neq 0\\
0 & \text{else}
\end{cases}$$

First of all, if $f$ is not continuous then can I always say it isn't differentiable?

And my attemp was this:

$$\lim_{t\rightarrow 0} \frac {f(P_0+tu)-f(P_0)} t = \lim_{t\rightarrow 0}
\begin{cases}
\frac{1}{t} & \text{else}\\
0 & u_1=0 \text{ or } u_1^2\neq u_2\\
\end{cases}$$

Does the fact that $\lim_{t\rightarrow 0}\frac {1}{t}$ does not exist say anything about f being differentiable? Because $D_if(P_0)$ both exist for $i=1,2$.

So I'd like to know if my calculation is correct, and if the continuous statement is true.

Thanks!

Best Answer

Yes you can. I want to give you a broader perspective though. If $f(x,y)$ is continuous in a point, then in general you can say nothing about its derivatives in that point. They may or may not exist.

So for instance, $f$ may be discontinuous in $(0,0)$, but still have partial derivatives or even directional derivatives for every direction. In general, existence of partial derivatives in a point is necessary, but not sufficient, to the existence of directional derivatives in that point. The existence of directional derivatives is necessary, but not sufficient, to the validity of what I call the "gradient rule", that is

$$ \partial_\nu f(0,0) = \partial_x f(0,0) \nu_1 + \partial_y f (0,0) \nu_2$$

with $\nu=(\nu_1, \nu_2)$ a direction in $\mathbb{R}^2$.

You can check that the inverse implications are: if the gradient rule holds, every directional derivative exists and if every directional derivative exists then the partial derivatives exist, too (they are precisely directional derivatives with respect to the directions $(1,0)$ and $(0,1)$).

Both continuity and these other conditions I have told you are necessary, but not sufficient, for $f$ to be differentiable. While if $f$ is differentiable then it is also continuous and satisfies what I called the "gradient rule", and so it admits directional derivatives and partial derivatives.

If $f$ is $C^1$, that is its derivatives are continuous, then $f$ is also differentiable, continuous and so on.

As an exercise, you can try to find examples of every possible combination. For instance, if you want a function which is continuous in $(0,0)$, admits all directional derivatives in $(0,0)$ but does not satisfy the gradient rule you could take

$$f(x,y)= \begin{cases} x \text{ if } x=y \\ 0 \text{ otherwise} \end{cases}$$

Related Question