TITLE: A sufficient condition for differentiability of $f:\mathbb{R}^n\rightarrow\mathbb{R}$
QUESTION [6 upvotes]: There is a theorem in my textbook which says:

Theorem: consider the function $f:\mathbb{R}^2\to\mathbb{R}$ such that both of its partial derivatives at a point exist and at least one of them is continuous, then $f$ is differentiable at that point.

I want to know whether the theorem is true in general for a function $f:\mathbb{R}^n\to\mathbb{R}$, i.e whether the following is true or not:

Consider the function $f:\mathbb{R}^n\to\mathbb{R}$ such that all its partial derivatives exist at a point and at least one of these partial derivatives is continuous at that point,then $f$ is differentiable at that point.

REPLY [4 votes]: Here is a counterexample.
$\displaystyle f(x,y,z)=\begin{cases} \frac{xy}{x^2+y^2}+c(z)\quad (x,y)\ne(0,0) \\ c(z) \quad (x,y)=(0,0) \end{cases}$
where $c(z)$ is any function with continuous derivative (so that $f_z$ exists).
Since $\frac{xy}{x^2+y^2}$ is zero along the $x-$ and $y-$ axes, the partial derivatives $f_x$ and $f_y$ are both zero at the point $(0,0,0)$. 
$f(x,y,z)$ is not even continuous at $(0,0,0)$ . Taking the limit along the line $x=y, z=0$ we have $\lim_{x\rightarrow 0}\frac{xx}{x^2+x^2}+c(0)=1/2+c(0)\ne f(0,0,0)$