# Is it possible that a directional derivative exists on a discontinuous point?

So I have this function:

$$f(x,y) = \begin{cases} \dfrac{xy^2}{x^2 + y^2}, & \text{if (x,y) \neq (0,0)} \\ 0, & \text{if (x,y) = (0,0)} \end{cases}$$

And I am asked to calculate the directional derivative at $(0,0)$, along a vector $(a,b)$. I used the limit definition and got to a result, but then realized that maybe it should not exist since the function is not continuous. Is this true?

• But the function is continuous at $(0,0)$?This can be seen by putting $x=r\sin \theta,y=r\cos\theta$ and doing $\lim_{r\to 0}$ – kingW3 Apr 12 '17 at 10:41
• Even if a function is discontinuous, the directional derivatives can exist because directional derivatives only look at the function in a single direction and the function may be continuous in those directions while being discontinuous in another direction. – Michael Burr Apr 12 '17 at 11:19
• @MichaelBurr The phrase "directional derivative" often refers to every direction, not only the horizontal and vertical ones. – Did Apr 12 '17 at 11:22
• @MichaelBurr For a discontinuous example such that every directional derivative exists, please see my answer. – Did Apr 12 '17 at 11:24
• @Did Sure, I am aware of such examples. I'm not trying to say that there must be a directional derivative that fails to exist when a function is discontinuous at a point, only that it is possible for only some directional derivatives to exist while others do not (it answers the intent of the OP's original question). Additionally, if one opens up the idea of "directions" to all smooth curves passing through the point of interest, the question becomes more interesting. – Michael Burr Apr 12 '17 at 11:31

The function $f$ in your post is continuous at $(0,0)$ since $|f(x,y)|\leqslant|x|$ for every $(x,y)$ and $|x|\to0$ when $(x,y)\to(0,0)$. The directional derivative of $f$ at $(0,0)$ in the direction $(\cos\theta,\sin\theta)$ is $$\lim_{r\to0}\frac1r\frac{r^3\cos\theta\sin^2\theta}{r^2}=\cos\theta\sin^2\theta$$
For an example of a function not continuous at $(0,0)$ such that every directional derivative at $(0,0)$ exists, consider $g(x,y)=0$ for every $(x,y)$ in $\mathbb R^2$ with the exception that $g(x,x^2)=1$ for every $x\ne0$.
Then $g(x,0)=0$ for every $x$ hence the directional derivatives of $g$ at $(0,0)$ in the direction of $(\pm1,0)$ exist and are both $0$. For every direction $(u,v)$ with $v\ne0$, $g(tu,tv)=0$ for every $|t|$ small enough (say, every $|t|\leqslant |v|/(u^2+1)$) hence the directional derivative of $g$ at $(0,0)$ in the direction of $(u,v)$ exists and it is $0$.
But naturally, this function $g$ is not continuous at $(0,0)$ since $g(0,0)=0$ and $\lim\limits_{x\to0}g(x,x^2)=1\ne0$.
Since $$|f(x,y)| \leq |x| \frac{y^2}{x^2+y^2} \leq |x|,$$ the function is continuous at the origin. Anyway, all you can deduce from the existence of a directional derivative at some point is that the restriction of the function to the straight line passing through that point in the given direction is continuous. The function may be discontinuous, though.