# Thread: Total Derivative vs. Directional Derivative

1. ## Total Derivative vs. Directional Derivative

Hi,

I am having a little difficulty in understanding the following problem. I present it with some thoughts:

2) Give an example of a function f:R2 --> R that has directional derivatives in every direction but that is not differentiable. Explain why your example works.

I understand the difference between a directional derivative and a total derivative, but I can't think of any examples where the directional derivatives in all directions are well-defined and the total derivative isn't. In order for f to be totally differentiable at (x,y), the partials of f w.r.t. (x,y) must be defined and continuous. It seems that total differentiability is stronger than directional differentiability, I just can't think of any examples that show that.

2. Originally Posted by joeyjoejoe
2) Give an example of a function f:R2 --> R that has directional derivatives in every direction but that is not differentiable. Explain why your example works.
Define the function $\displaystyle f:\mathbb{R}^2\mapsto \mathbb{R}$ as $\displaystyle f(x,y) = \left\{ \begin{array}{c} \tfrac{x^2y}{x^2+y^2} \mbox{ if }(x,y)\not = (0,0) \\ 0 \mbox{ if }(x,y)=0 \end{array} \right.$

The function is continous at $\displaystyle (0,0)$ as an added bonus. Because if $\displaystyle \epsilon > 0$ choose $\displaystyle \delta = \epsilon$ and so if $\displaystyle 0<\sqrt{x^2+y^2} < \delta$ it follows that $\displaystyle |f(x,y) | = \left| \tfrac{x^2y}{x^2+y^2} \right| \leq \left| \tfrac{x^2y}{2xy} \right| = \tfrac{1}{2}|x| \leq \tfrac{1}{2}\sqrt{x^2+y^2} < \epsilon$. (Here we used the inequality $\displaystyle x^2+y^2\geq 2xy$).

Next compute the directional derivatives $\displaystyle \partial_{\bold{u}}f(0,0)$ by definition. Now if the partial derivatives were to exist they would be related to the directional derivatives by $\displaystyle \partial_{\bold{u}}f(0,0) = \nabla f(0,0)\cdot \bold{u}$. But it does not. Therefore this function has directional derivatives but not partial.

3. Originally Posted by ThePerfectHacker
Define the function $\displaystyle f:\mathbb{R}^2\mapsto \mathbb{R}$ as $\displaystyle f(x,y) = \left\{ \begin{array}{c} \tfrac{x^2y}{x^2+y^2} \mbox{ if }(x,y)\not = (0,0) \\ 0 \mbox{ if }(x,y)=0 \end{array} \right.$

The function is continous at $\displaystyle (0,0)$ as an added bonus. Because if $\displaystyle \epsilon > 0$ choose $\displaystyle \delta = \epsilon$ and so if $\displaystyle 0<\sqrt{x^2+y^2} < \delta$ it follows that $\displaystyle |f(x,y) | = \left| \tfrac{x^2y}{x^2+y^2} \right| \leq \left| \tfrac{x^2y}{2xy} \right| = \tfrac{1}{2}|x| \leq \tfrac{1}{2}\sqrt{x^2+y^2} < \epsilon$. (Here we used the inequality $\displaystyle x^2+y^2\geq 2xy$).

Next compute the directional derivatives $\displaystyle \partial_{\bold{u}}f(0,0)$ by definition. Now if the partial derivatives were to exist they would be related to the directional derivatives by $\displaystyle \partial_{\bold{u}}f(0,0) = \nabla f(0,0)\cdot \bold{u}$. But it does not. Therefore this function has directional derivatives but not partial.
Aren't partial derivatives also directional derivatives in the direction of the coordinate axes? What you say about this doesn't make much sense to me, if ALL directional derivatives are defined and partials are not, there would seem to be a contradiction.

Directional/Partial Derivatives

4. Originally Posted by joeyjoejoe
Aren't partial derivatives also directional derivatives in the direction of the coordinate axes? What you say about this doesn't make much sense to me, if ALL directional derivatives are defined and partials are not, there would seem to be a contradiction.
IF the partial derivatives exist then the directional derivative along the axes is equal to the partial derivatives. You need the existence part.

5. Originally Posted by ThePerfectHacker
IF the partial derivatives exist then the directional derivative along the axes is equal to the partial derivatives. You need the existence part.
Partial derivatives ARE directional derivatives, I don't see how you can turn that into the conditional statement you give here. I can logically return with -- if ALL directional derivatives exist (which they do according to your analysis), then the partials equal the directional derivatives along the coordinate axes.

Also, you said that because the gradient at (0,0) is undefined, partial derivatives can't exist. Your reasoning about this would imply that no directional derivatives could exist either. It doesn't matter what the directional vector is, the directional derivative would still be bogus.

6. Yes, sorry about that! I was thinking about (normal) derivative. You are absolutely correct to say the partial derivatives are just types of directional derivatives. However, IF the function has directional derivatives does not mean it is differenciable at the point. The example I posted above is still exactly what you are looking for.

Let $\displaystyle \bold{u} = (\cos \theta , \sin \theta)$ where $\displaystyle 0\leq \theta < 2\pi$. Then $\displaystyle \partial_{\bold{u}} f(0,0) = \lim_{t\to 0}\frac{f(\bold{0}+t\bold{u}) - f(\bold{0})}{t} = \cos^2 \theta \sin \theta$. In particular $\displaystyle \partial_1 f(0,0) = \partial_2 f(0,0) = 0$. But then (assuming differenciability) it would mean $\displaystyle \nabla f(0,0) = (0,0)$ and so $\displaystyle \partial_{\bold{u}}f(0,0) = \nabla f(0,0) \cdot \bold{u} = 0$ and contradiction.