A simple partial differentiation problem yet it confused me Consider $f(x,y) = \sqrt (x^2+y^2)$.
I just learnt from calculus course that $\frac {\partial f}{\partial x} = \frac {x}{\sqrt{x^2 + y^2}}$.
Now I want to find the partial derivative of f with respect to x, $\frac {\partial f}{\partial x}$, at the point $(0,0)$. I directly substitute $(x,y)=(0,0)$ into the derivative just found and it gives $\frac {0}{\sqrt{0^2+0^2}}$ which is undefined. However I know that the derivative $\frac {\partial f}{\partial x}$ should exist and is equal to 1 at $(0,0)$ given another definition of $\frac {\partial f}{\partial x}$ at $(0,0)$ is $\lim_{h \to 0} \frac {f(h,0)-f(0,0)}{h} = \lim_{h \to 0} \frac {\sqrt {h^2 + 0} - \sqrt {0^2 + 0^2}}{h} = 1$.
My question is: why did I get two different results (I know that it is equal to 1)?
 A: Your claim that the limit $$\lim_{h \to 0} \frac{f(h,0) - f(0,0)}{h} = \lim_{h \to 0} \frac{\sqrt{h^2} - 0}{h} = 1$$ is incorrect for the reason that the limit is two-sided.  If $h < 0$, then $\sqrt{h^2} > 0$; i.e., we may write for all nonzero reals $h$ $$\frac{\sqrt{h^2}}{h} = \frac{|h|}{h}.$$  With this in mind, it becomes obvious that $$\lim_{h \to 0^-} \frac{|h|}{h} = -1, \quad \lim_{h \to 0^+} \frac{|h|}{h} = 1,$$ and the two-sided limit is undefined.
To understand the situation better, if we plot the function $f(x,y) = \sqrt{x^2+y^2}$, it is the "upper" half of a right circular cone.  The apex of this cone is clearly a point of non-differentiability, since the slope is not uniquely defined here.
A: Sometimes $0/0$ is comforting because it gives us hope that the limit could still evaluate to something finite. Unfortunately, this is not one of those instances.
Most functions of two or more variables give different derivatives if you approach points from different directions. This happens so often that when a function gives the same derivative at a point from multiple directions, we call it a special name: analytic.
$g(x,y) = \frac{x}{\sqrt{x^2+y^2}}$ is not analytic at $(0,0)$, that is, the value of the derivative at that point depends on the path you take to $(0,0)$. How can we show this?
Assume you only take straight paths to $(0,0)$, then you might assume that $y=m\cdot x$, where $m$ is the gradient of your line. Plugging into $g(x)$ then gives $\frac1{\sqrt{1+m^2}}$, which immediately demonstrates that many different paths are giving different slopes.
If you skip that line of reasoning and simply assume $y=0$, then $g(x,0) = \frac{x}{\sqrt{x^2}}=\operatorname{sgn}(x)$, which is still discontinuous at $x=0$, implying that even in such a simplified case, direction still matters. Graph it in Wolfram for kicks :)
Finally, the gradient of your function depended on the direction you chose, so this is probably a great way to tease the concept of a directional derivative (a gradient function that tells you the slope of a surface at a point in a given direction).
In summary:
If your function is indeterminate at a given point, you have to take a limiting path there, and if the gradient is affected by the path you choose, you need to be more careful about how you describe the slope of your function at the point of interest.
Hopefully this helps. Apologies for potential errors, I typed this on my phone 
