I have to find a function $f:\mathbb{R}^2 \longrightarrow \mathbb{R}$ that verifies the following conditions:
- Both partial derivatives exist in a neighborhood of the point $(0,0)$.
- Both partial derivatives aren't continuous in the point $(0,0)$.
- The function is differentiable in the point $(0,0)$.
What I've worked so far
I have considered $f$ to be:
$$f(x,y)= \begin{cases} xy\sin\left(\frac{1}{x^2+y^2}\right), & \text{if $(x,y)\neq (0,0)$} \\ 0, & \text{if $(x,y)=(0,0)$} \end{cases}$$
First of all this function is differentiable in the open set $\mathbb{R}^2\setminus\{(0,0)\}$ because it is composition of continuous and differentiable elemental functions.
Existence of the partial derivatives
Now when it comes to the point $(0,0)$, if I calculate the partial derivatives of $f$ I get:
$$D_{x}f(0,0)=\lim \limits_{t \to 0} \frac{f(t,0)-f(0,0)}{t}=\lim \limits_{t \to 0} \frac{0}{t}=\lim \limits_{t \to 0} 0=0$$
$$D_{y}f(0,0)=\lim \limits_{t \to 0} \frac{f(0,t)-f(0,0)}{t}=\lim \limits_{t \to 0} \frac{0}{t}=\lim \limits_{t \to 0} 0=0$$
So both partial derivatives exist at the point $(0,0)$ (and in a neighborhood of itself). [Condition 1]
Continuity of the partial derivatives
To figure out if the partial derivatives are continuous at the $(0,0)$ y calculate each one by derivating maintaining the other variable constant:
$$D_{x}f(x,y)=\frac{\partial f(x,y)}{\partial x}=y\left(\sin\left(\frac{1}{x^2+y^2}\right)+\cos\left(\frac{1}{x^2+y^2}\right)\frac{-2x^2}{(x^2+y^2)^2}\right)$$
$$D_{y}f(x,y)=\frac{\partial f(x,y)}{\partial y}=x\left(\sin\left(\frac{1}{x^2+y^2}\right)+\cos\left(\frac{1}{x^2+y^2}\right)\frac{-2y^2}{(x^2+y^2)^2}\right)$$
Now that I take the limit of the previous expression to check for continuity at $(0,0)$.
$$\lim \limits_{(x,y)\to(0,0)}D_{x}f(x,y)=\lim \limits_{(x,y)\to(0,0)}y\left(\sin\left(\frac{1}{x^2+y^2}\right)+\cos\left(\frac{1}{x^2+y^2}\right)\frac{-2x^2}{(x^2+y^2)^2}\right)$$
Since $\nexists \lim \limits_{z\to0}\cos\left(\frac{1}{z}\right)$ the previous limit does not exist and the same reasoning for the other partial derivative. Therefore, both partial derivatives aren't continuous at the point $(0,0)$. [Condition 2]
- Is there another way to check for continuity of the partial derivatives?
Differenciability at the point $(0,0)$
Now I have to verify if $f$ is differentiable at the $(0,0)$, so: $$ \lim _{(x, y) \rightarrow(0, 0)} \frac{|f(x, y)-f(0,0)-a(x-0)-b(y-0)|}{\|(x, y)-(0,0)\|}=0 $$.
Since both partial derivatives are $0$, the previous limit turns into:
$$ \lim _{(x, y) \rightarrow(0, 0)} \frac{|f(x, y)-f(0,0)|}{\|(x, y)\|}=\lim _{(x, y) \rightarrow(0, 0)} \frac{|xy\sin\left(\frac{1}{x^2+y^2}\right)|}{\|(x, y)\|}\stackrel{¿?}{=}0 $$
To prove that the limit is $0$ try to bound the limit, so: $$0\leq\frac{|xy\sin\left(\frac{1}{x^2+y^2}\right)|}{\|(x, y)\|}\leq\|(x, y)\|^2$$ And because when $(x,y)\to(0,0)$, then $\|(x, y)\|\to (0,0)$ by the squeeze or sandwich theorem the limit is $0$, therefore $f$ is differentiable in $(0,0)$. [Condition 3]
Knowing that both partial derivatives exist on the $(0,0)$ and in a neighborhood of it and that are continuous in this neighborhood (which I haven't proved) could I have said directly that the function was differentiable even though the partial derivatives aren't continuous at the $(0,0)$?
I do not know if there are some mistakes in the reasoning I followed or the way that I expressed the ideas.
Are there more examples of functions that meet these conditions whithout using a term like $\sin\left(\frac{1}{\phi(x,y)}\right)$? I can't come up with more right now.
Another little question
Now if the partial derivatives didn't exist at the point $(0,0)$ and I had to prove that they exist in a neighborhood of this point. Could I proceed like this?:
Let be $\epsilon\in\mathbb{R}^{+},(\overline{x},\overline{y})\in B_{\mathbb{R}^2}[(0,0),\epsilon]$ I now calculate the limits corresponding to the partial derivatives at the point $(\overline{x},\overline{y})$ and if they exist I have proved that they exist in a neighborhood of $(0,0)$.