# Does there exist a differentiable function $\Bbb R^2$ to $\Bbb R$ with certain partial derivative properties?

Does there exist a counter-example to the following claim:

For a function $f: \mathbb{R}^2 \to \mathbb{R}$, if:

$D_1f$ exists in some ball around the origin and is continuous at the origin (but not necessarily anywhere else)

$D_2f$ exists at the origin (but not necessarily anywhere else)

then $f$ is differentiable at the origin.

I know that if we add either the condition "$D_2f$ is continuous at the origin" or "$D_1f$ is continuous in the open ball around the origin" then $f$ must be differentiable at the origin, but I can't find a non-differentiable function just satisfying the above two properties.

-

There is no counterexample, and we can further weaken things by not requiring $D_1 f$ to exist on the $y$-axis, and we don't even need $f$ to be required to be continuous anywhere on the $y$-axis with origin removed (note that neither one implies the other).

We can assume WLOG $f,D_1f,D_2f$ are $0$ at the origin by subtracting off the function $f(0)+Df(O)(x,y)$.

Then for $h=(h_1,h_2)$ in a small punctured disc around $O$, $\frac{f(h_1,h_2)}{\sqrt{h_1^2+h_2^2}}=\frac{f(h_1,h_2)-f(0,h_2)}{\sqrt{h_1^2+h_2^2}}+\frac{f(0,h_2)}{\sqrt{h_1^2+h_2^2}}=g(h_1,h_2)\frac{h_1}{\sqrt{h_1^2+h_2^2}}+r(h_2)\frac{h_2}{\sqrt{h_1^2+h_2^2}}$

Where

$g(h_1,h_2)=\frac{f(h_1,h_2)-f(0,h_2)}{h_1}$ when $h_1 \ne 0$, otherwise $0$

$r(h_2)=\frac{f(0,h_2)}{h_2}$ when $h_2 \ne 0$, otherwise $0$.

(no continuity was used here, this is always true).

For $h_1 \ne 0$, $g(h_1,h_2)=D_1(\epsilon(h_1,h_2) h_1,h_2)$ for some $0<\epsilon(h_1,h_2)<1$ which is a function of $h_1,h_2$ by mean value theorem.

Thus in any case, $|g| \le D_1(\epsilon(h_1,h_2) h_1,h_2) \to 0$, so since $|\frac{h_1}{\sqrt{h_1^2+h_2^2}}| \le 1$, the first term goes to $0$.

By definition of $Df_2$, $r$ is continuous at $0$, so $r(h_2) \to 0$ as $(h_1,h_2) \to 0$. Since $|\frac{h_2}{\sqrt{h_1^2+h_2^2}}| \le 1$, the second term goes to $0$.

Thus $\frac{f(h_1,h_2)}{\sqrt{h_1^2+h_2^2}} \to 0$, so $f$ is diff. at $0$, and we're done.

-