# A question about partial derivatives and directional derivative.

• Feb 23rd 2010, 06:41 PM
zzzhhh
A question about partial derivatives and directional derivative.
Assume $f$ is a real-valued function defined on an open set $E$ of $\mathbb R^n$ and all partial derivatives of $f$ exist on $E$. Is it possible that there is some ${\bf {a}}\in E$ and ${\bf u}\in\mathbb R^n$ such that the directional derivative of $f$ in the direction of $\bf u$ at $\bf a$ does not exist?
Thanks!
• Feb 24th 2010, 02:10 AM
Opalg
Quote:

Originally Posted by zzzhhh
Assume $f$ is a real-valued function defined on an open set $E$ of $\mathbb R^n$ and all partial derivatives of $f$ exist on $E$. Is it possible that there is some ${\bf {a}}\in E$ and ${\bf u}\in\mathbb R^n$ such that the directional derivative of $f$ in the direction of $\bf u$ at $\bf a$ does not exist?

On $\mathbb{R}^2$, let $f(x,y) = \begin{cases}\frac{xy}{x^2+y^2}&((x,y)\ne(0,0)),\\ 0&((x,y)=(0,0)).\end{cases}$

Then both partial derivatives of f exist at the origin (and everywhere else), but the directional derivatives in the directions of $(1,\pm1)$ do not exist.
• Feb 24th 2010, 03:05 AM
HallsofIvy
If f is differentiable at a point, then the directional derivative in all directions exists. But, as Opalg showed, it may happen that has partial derivatives at a point but is not "differentiable" there.

Another example is
$
f(x,y) = \begin{cases}1 &((x,y)\ne(0,0)),\\ 0&((x,y)=(0,0)).\end{cases}
$

At (0,0) both partial derivatives exist and are 0. But the function is not differentiable and directional derivatives do not exist except in the directions of the axes.
• Feb 24th 2010, 07:17 AM
Opalg
Quote:

Originally Posted by HallsofIvy
Another example is
$
f(x,y) = \begin{cases}1 &((x,y)\ne(0,0)),\\ 0&((x,y)=(0,0)).\end{cases}
$

At (0,0) both partial derivatives exist and are 0. But the function is not differentiable and directional derivatives do not exist except in the directions of the axes.

Umm, I hate to disagree, but that example does not have partial derivatives at the origin:

$\frac{\partial f}{\partial x}(0,0) = \lim_{h\to0}\frac{f(h,0)-f(0,0)}h = \lim_{h\to0}\frac{1-0}h =$ (ouch!) (Angry)

I think you probably meant $
f(x,y) = \begin{cases}1 &(xy\ne0),\\ 0&(x \text{ or }y =0).\end{cases}
$
But no, on second thoughts that won't work either, because that function doesn't have partial derivatives on either of the axes (except at the origin). I have a feeling that the example I gave previously can't really be simplified.
• Feb 24th 2010, 01:42 PM
zzzhhh
Thank you! Now I have a further question: Assume the conditions in my first post still hold, that is, $f$ is a real-valued function defined on an open set $E$ of $\mathbb R^n$ and all partial derivatives of $f$ exist on $E$. If the directional derivative of $f$ in the direction of ${\bf u}=(u_1,...,u_n)$ at a point ${\bf a}\in E$ does exist, is it always true that the value of the directional derivative equals the inner product $(D_1f({\bf a}),...,D_nf({\bf a}))\cdot(u_1,...,u_n)$? Thanks!
• Feb 24th 2010, 01:54 PM
hjortur
Quote:

Originally Posted by Opalg
I think you probably meant $
f(x,y) = \begin{cases}1 &(xy\ne0),\\ 0&(x \text{ or }y =0).\end{cases}
$
But no, on second thoughts that won't work either, because that function doesn't have partial derivatives on either of the axes (except at the origin). I have a feeling that the example I gave previously can't really be simplified.

Why does this not work?

f=0 everywhere on the x and y axis, and f=1 otherwise, so:

$\frac{\partial f}{\partial x}(x,0)=\lim\limits_{h\to0}\frac{f(x+h,0)-f(x,0)}{h}=\lim\limits_{h\to0}\frac{0-0}{h}=0$, for all $x\in\mathbb{R}$
• Feb 25th 2010, 12:01 AM
Opalg
Quote:

Originally Posted by hjortur
Why does this not work?

f=0 everywhere on the x and y axis, and f=1 otherwise, so:

$\frac{\partial f}{\partial x}(x,0)=\lim\limits_{h\to0}\frac{f(x+h,0)-f(x,0)}{h}=\lim\limits_{h\to0}\frac{0-0}{h}=0$, for all $x\in\mathbb{R}$

This function has a partial x-derivative at points on the x-axis, but not a partial y-derivative. If $x\ne0$ then $\frac{\partial f}{\partial y}(x,0)=\lim_{k\to0}\frac{f(x,k)-f(x,0)}{k}=\lim_{k\to0}\frac{1-0}{k}$, which does not exist.

On the y-axis, the function has a partial y-derivative but not a partial x-derivative.
• Feb 25th 2010, 03:20 AM
HallsofIvy
Quote:

Originally Posted by Opalg
Umm, I hate to disagree, but that example does not have partial derivatives at the origin:

$\frac{\partial f}{\partial x}(0,0) = \lim_{h\to0}\frac{f(h,0)-f(0,0)}h = \lim_{h\to0}\frac{1-0}h =$ (ouch!) (Angry)

I think you probably meant $
f(x,y) = \begin{cases}1 &(xy\ne0),\\ 0&(x \text{ or }y =0).\end{cases}
$
But no, on second thoughts that won't work either, because that function doesn't have partial derivatives on either of the axes (except at the origin). I have a feeling that the example I gave previously can't really be simplified.

(Crying) Ouch! You are right. That is the example I meant to give. It does have partial derivatives at (0,0) but is not differentiable there. $\frac{\partial f}{\partial x}$ exists at (x, 0) but not $\frac{\partial f}{\partial y}$ and vice-versa at (0, y).

That is not a good example because the initial post asked for an example where the partial derivatives exist on some open set. Thank you.
• Feb 25th 2010, 04:05 PM
zzzhhh
Quote:

Originally Posted by HallsofIvy
That is not a good example because the initial post asked for an example where the partial derivatives exist on some open set. Thank you.

I would still like to express my thanks for your consideration of my problem. I benefit a lot from you all.