Let $f: \mathbb{R}^2 \to \mathbb{R}$ be defined by:
$f(x,y) = \begin{cases}y - x^2, & y\geq x^2 \\0, & -x^2\leq y < x^2 \\ y + x^2, & y < -x^2\end{cases}$
(a) Is $f$ differentiable at the origin?
(b) Is f of class $C^1$ at the origin?
My attempt at a solution:
$\frac{\partial f}{\partial x}(0,0)$ = $\lim_{h\to0}\frac{f(h,0) - f(0,0)}{h} =$ $\lim_{h\to0}\frac{(0 - h^2) - (0-0)}{h} = -h^2/h =$$-h = 0$
$\frac{\partial f}{\partial y}(0,0)$ = $\lim_{h\to0}\frac{f(0,h) - f(0,0)}{h} =$ $\lim_{h\to0}\frac{(h - 0) - (0-0)}{h} = h/h = 1$
So the partial derivatives exist at $(0,0)$ and $\nabla f = (0,1)$
(b) I can see that $f$ is not $C^1$ since the partial derivatives of $f$ with respect to $y$ are not continuous at $(0,0)$
(a) If $f$ were differentiable at the origin, then:
$\lim_{(s,t) \to (0,0)} \frac{f(0+s,0+t) - f(0,0) - \langle 0,1 \rangle \cdot (s,t)}{|(s,t)|} \to 0$
which simplifies to:
$\lim_{(s,t) \to (0,0)} \frac{f(s,t)-t}{|(s,t)|} = 0$
If this were true then:
$(1) \qquad \lim_{(s,t) \to (0,0)} \frac{-s^2}{\sqrt{s^2+t^2}} = 0, \qquad \text{on the set where $t \ge s^2$}$
$(2) \qquad \lim_{(s,t) \to (0,0)} \frac{-t}{\sqrt{s^2+t^2}} = 0, \qquad \text{on the set where $-s^2 \leq t < s^2$}$
$(3) \qquad \lim_{(s,t) \to (0,0)} \frac{s^2}{\sqrt{s^2+t^2}} = 0, \qquad \text{on the set where $t < - s^2$}$
Approaching along the linear path $s = mt$ we see that $(1)$ and $(3)$ evaluate to $0$ but that $(2)$ evaluates to $\frac{-1}{\sqrt{m+1}}$
Thus the limit
$\lim_{(s,t) \to (0,0)} \frac{f(s,t)-t}{|(s,t)|}$ does not exist and $f$ is not differentiable at the origin.
Is this a correct solution?
The only other way I can think to do this question is by using the properties of direction derivatives.
Let $u = (sin (\theta), cos(\theta))$
Then the directional derivative of $f$ at $(0,0)$ in the direction of $u$ is defined to be
$\partial_u f(0,0)= lim_{t \to 0} \frac{f((0,0) +t(sin(\theta), cos(\theta)) - f(0,0)}{t}$
$= lim_{t \to 0} \frac{f(tsin(\theta), tcos(\theta))}{t}$
$= lim_{t \to 0} \frac{tcos(\theta) -t^2sin^2(\theta)}{t}$
$= cos(\theta)$
So the directional derivatives of $f(0,0)$ all exist and are given by:
$\partial f(0,0) = \nabla f(0,0)\bullet u = (0,1) \bullet (sin(\theta), cos(\theta)) =(0,cos(\theta))$
Wouldn't this imply that the f is differentiable at the origin?
Furthermore, since all of the partial derivatives at the origin exist and are continuous, $f$ is $C^1$ at the origin?