# Partial derivatives, directional derivatives and differentiability of a function

I'm studying the function $f:\mathbb{R}^2\to \mathbb{R}$ such that:

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

How to find the partial derivatives and directional derivatives at $(0,0)$? Do they exist?

-
Hiperion, I made a few edits. (In particular, I removed the array enviroment, and used the "cases" command instead.) Hope it's ok. – Srivatsan Sep 12 '11 at 3:31
Yes, it's ok. Thanks! – Hiperion Sep 12 '11 at 3:34
Since you accepted @Arturo's answer already, does this mean you know how to proceed with the directional derivative part? – Srivatsan Sep 12 '11 at 3:43
I thought so, but I'm not so sure now – Hiperion Sep 12 '11 at 4:04
@Hiperion: What is the confusion? – Arturo Magidin Sep 12 '11 at 4:28

You find partial derivatives the usual way: the parial derivative with respect to $y$ at $(0,0)$ is $$\frac{\partial f}{\partial y}\Biggm|_{(x,y)=(0,0)} = \lim_{y\to 0}\frac{f(0,y) - f(0,0)}{y-0} = \lim_{y\to 0}\frac{y-0}{y-0} = 1.$$ While the partial derivative with respect to $x$ at $(0,0)$ is: $$\frac{\partial f}{\partial x}\Biggm|_{(x,y)=(0,0)} = \lim_{x\to 0}\frac{f(x,0)-f(0,0)}{x-0} = \lim_{x\to 0}\frac{x^2+x^2\sin(1/x) - 0}{x-0} = \lim_{x\to 0}\left(x+x\sin\frac{1}{x}\right)=0.$$
The directional derivatives are similar: let $\mathbf{u}=(a,b)$ be a unit vector. Then by definition we have that $$D_{\mathbf{u}}f(0,0) = \lim_{h\to 0}\frac{f(ha,hb) - f(0,0)}{h}.$$ If $a=0$, you are looking at the partial with respect to $y$, which we have already computed. If $a\neq 0$, then you get $$D_{\mathbf{u}}f(0,0) = \lim_{h\to 0}\frac{1}{h}\left(h^2a^2 + h^2a^2\sin(1/h^2a^2)\right) = \lim_{h\to 0}\left(ha^2 + ha^2\sin(1/h^2a^2)\right)=0.$$