# Where is the mistake? Two different methods to compute directional derivative lead to do two different results!

Problem:

Let $$f(x,y) = \begin{cases} \frac{xy\sin x}{x^{2}+y^{2}}, & (x,y) \neq (0,0) \cr 0, & (x,y) = (0,0) \end{cases}$$

Let $u=\left ( u_{1},u_{2} \right )$ be a unit vector. Find $\frac{\partial f}{\partial u}\left ( 0,0 \right )$.

First Method: I applied the definition: $$\frac{\partial f}{\partial u}(0,0) = \lim_{h\to 0} \frac{f(0+u_1 h,0+u_2 h)-f(0,0)}h = \lim_{h\to 0} \frac{u_1 u_2 h^2 \sin(u_1 h)}{h^2 \cdot h}=u_1^2 u_2.$$

Second Method I applied another definition of directional derivative: $$\frac{\partial f}{\partial u}(0,0) = \nabla f(0,0) \cdot (u_1,u_2) = u_1\frac{\partial f}{\partial x}(0,0) + u_2\frac{\partial f}{\partial y}(0,0) = u_1\cdot0 + u_2\cdot0=0.$$

Which method is the correct one? and why did we get different results although both definitions are true?

-
If $u$ must be an unit vector, then how does $\frac{\partial f}{\partial u}(0,0)$ make sense in the first place? $(0,0)$ is not an unit vector? –  Henning Makholm Feb 15 '12 at 1:56
@HenningMakholm: It makes sense if $\frac{\partial f}{\partial u}(x,y)$ is the directional derivative of $f$ w.r.t. $u$ taken at $(x,y)$ –  kahen Feb 15 '12 at 2:00
@Henning Makholm: What I mean is exactly what Kahen wrote above. –  M.Krov Feb 15 '12 at 2:01
@m_p2009: You should take a look at the edits I did to your LaTeX source. In particular, try to weed out all those unnecessary uses of \left and \right. –  kahen Feb 15 '12 at 2:02
@HenningMakholm: The directional derivative of a function $f:\mathbb R^2\to\mathbb R$ in the direction of a unit vector $\mathbf u$ at the point $\mathbf x\in\mathbb R^2$, if it exists, is by definition $\lim\limits_{h\to 0}\frac{f(\mathbf x +h\mathbf u)-f(\mathbf x)}{h}$. Here $(0,0)$ is playing the role of the point $\mathbf x$, and whether or not it is of distance $1$ from the origin is not relevant, whereas the unit vector determines the direction in which the derivative is taken at $(0,0)$. –  Jonas Meyer Feb 15 '12 at 2:23
show 1 more comment

The first one, based on the definition, is correct. The second is using a theorem which has a hypotheses that is not true in this case. Specifically, this $f$ is not differentiable at $(0,0)$.