# Total Derivative vs. Directional Derivative

• May 29th 2008, 05:52 PM
joeyjoejoe
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.
• May 29th 2008, 07:57 PM
ThePerfectHacker
Quote:

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 $f:\mathbb{R}^2\mapsto \mathbb{R}$ as $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 $(0,0)$ as an added bonus. Because if $\epsilon > 0$ choose $\delta = \epsilon$ and so if $0<\sqrt{x^2+y^2} < \delta$ it follows that $|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 $x^2+y^2\geq 2xy$).

Next compute the directional derivatives $\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 $\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.
• May 29th 2008, 08:17 PM
joeyjoejoe
Quote:

Originally Posted by ThePerfectHacker
Define the function $f:\mathbb{R}^2\mapsto \mathbb{R}$ as $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 $(0,0)$ as an added bonus. Because if $\epsilon > 0$ choose $\delta = \epsilon$ and so if $0<\sqrt{x^2+y^2} < \delta$ it follows that $|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 $x^2+y^2\geq 2xy$).

Next compute the directional derivatives $\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 $\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
• May 29th 2008, 08:32 PM
ThePerfectHacker
Quote:

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.
• May 29th 2008, 08:59 PM
joeyjoejoe
Quote:

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.
• May 30th 2008, 08:42 AM
ThePerfectHacker
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 $\bold{u} = (\cos \theta , \sin \theta)$ where $0\leq \theta < 2\pi$. Then $\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 $\partial_1 f(0,0) = \partial_2 f(0,0) = 0$. But then (assuming differenciability) it would mean $\nabla f(0,0) = (0,0)$ and so $\partial_{\bold{u}}f(0,0) = \nabla f(0,0) \cdot \bold{u} = 0$ and contradiction.