Differentiability of functions of several variables. I've just read the proof of a theorem which states that if a function of several variables(two in this case) has partial derivatives in some neighborhood of a point (x,y) and these derivatives are continuous at (x,y) then the function is differentiable at that point. The proof uses the mean value theorem and ,analytically, I understand the proof but I can't feel why it is necessary to have these derivatives in a neighborhood not just in a point. Can someone experienced share his intuitive view on this question and show me some intuitive reasons for this being necessary?
 A: Limits are far more subtle when you have more than $1$ variable. Consider the standard counterexample function
$$f(x,y) = \begin{cases} \frac{xy}{x^2+y^2}\,, & (x,y)\ne (0,0) \\ 0\,, & (x,y)=(0,0)
\end{cases}\,.$$
This function is not continuous at the origin, but both its partial derivatives are $0$ at the origin. Thus, if we were to have a tangent plane, it would be horizontal. On the other hand, along the line $y=(\tan\theta) x$, the function has value $\frac12\sin 2\theta$ everywhere except the origin. So existence of partials doesn't even give you continuity. 
A continuous variant of this is given by
$$g(x,y) =  \begin{cases} \frac{x^2y}{x^2+y^2}\,, & (x,y)\ne (0,0) \\ 0\,, & (x,y)=(0,0)
\end{cases}\,.$$
The tangent plane would still be horizontal, if it existed, but the function now has directional derivative $\frac12\sin2\theta$ in direction $\theta$. Thus, our alleged tangent plane doesn't contain tangent lines to the surface other than in the coordinate directions.
What you should try to find is a function all of whose directional derivatives at the origin are $0$ but which is nevertheless not differentiable (e.g., not continuous).
