Is $\phi : \mathbb R^2 \rightarrow \mathbb R$ a differentiable function? We have the following example on the book "Matrix Differential Calculus with Applications in Statistics and Econometrics", 3rd edition, p. 100.

Let $\phi : \mathbb R^2 \rightarrow \mathbb R$ be a real-valued function defined by
  $$
\phi(x,y) = \left\{ 
\begin{array}{ll}
x^2[y+\text{sin}(1/x)] &  \text{if } x\neq 0 \\ 
0& \text{if } x= 0
\end{array}
\right. 
$$
  Then $\phi$ is differentiable at every point in $\mathbb R^2$ with partial derivatives
  $$
\mathrm D_1\phi(x,y) = \left\{
\begin{array}{ll}
2x[y+\text{sin}(1/x)] - \text{cos}(1/x) & \text{if } x\neq 0\\
0                         & \text{if } x= 0
\end{array}
\right.
$$
  and $\mathrm D_2\phi(x,y) = x^2$. We see that $\mathrm D_1\phi$ is not continuous at any point on the $y$-axis since cos(1/x) in $\mathrm D_1\phi(x,y)$ does not tend to a limit as $x\rightarrow 0$.

Letting $c_1\neq 0$ and considering the open ball in $\mathbb R^2$ where $\sqrt{x^2+y^2}<c_1$ (to make $x\neq -c_1$), we have
\begin{align}
\phi(c_1+x,c_2+y) &= \phi(c_1,c_2) + [\mathrm D_1\phi(c_1,c_2) \quad \mathrm D_2\phi(c_1,c_2)] \left[\begin{array}{c}x\\
y
\end{array}\right] + r(x,y)\\
(c_1+x)^2(c_2+y+\sin\frac{1}{c_1+x}) &= c_1^2(c_2+\sin\frac{1}{c_1}) + x(2c_1(c_2+\sin\frac{1}{c_1})-\cos\frac{1}{c_1})+yc_1^2+r(x,y).
\end{align}
Thus,
$$
r(x,y) = (c_1+x)^2(c_2+y+\sin\frac{1}{c_1+x}) - c_1^2(c_2+\sin\frac{1}{c_1})-x(2c_1(c_2+\sin\frac{1}{c_1})-\cos\frac{1}{c_1})-yc_1^2.
$$
However, it seems that
$$
\lim_{(x,y)\rightarrow (0,0)} \frac{r(x,y)}{\sqrt{x^2+y^2}}=0
$$
is not true, which is required to $\phi$ be differentiable everywhere as stated by the above example. How to verify the differentiability of $\phi$?
 A: The partial derivatives exist at every point and are continuous for any $(c_1,c_2)$ such that $c_1\neq 0$. Thus, $\phi$ is differentiable at every  $(c_1,c_2)$ such that $c_1\neq 0$.
Let $(c_1,c_2)$ be such that $c_1= 0$. From
\begin{align}
\phi(c_1+x,c_2+y) &= \phi(c_1,c_2) + [\mathrm D_1\phi(c_1,c_2) \quad \mathrm D_2\phi(c_1,c_2)] \left[\begin{array}{c}x\\ 
y
\end{array}\right] + r_{c_1,c_2}(x,y)\\
\phi(x,c_2+y) &=r_{c_1,c_2}(x,y),
\end{align}
we have
\begin{align}
r_{c_1,c_2}(x,y) = \left\{
\begin{array}{ll}
x^2[y+c_2+\sin(1/x)] & \text{if } x\neq 0\\
0                      & \text{if } x= 0
\end{array}
\right.
\end{align}
Consider
$$
\lim_{(x,y)\rightarrow (0,0)} \frac{r_{c_1,c_2}(x,y)}{\sqrt{x^2+y^2}}=\lim_{(x,y)\rightarrow (0,0)}\frac{x^2y}{\sqrt{x^2+y^2}} + \lim_{(x,y)\rightarrow (0,0)}\frac{x^2c_2}{\sqrt{x^2+y^2}} + \lim_{(x,y)\rightarrow (0,0)}\frac{x^2\sin(1/x)}{\sqrt{x^2+y^2}}.
$$
Note that $0\leq\frac{x^2}{\sqrt{x^2+y^2}}\le\frac{x^2}{\sqrt{x^2}}=|x|$, where $|x|\rightarrow 0$ as $(x,y)\rightarrow (0,0)$. Thus, $\lim_{(x,y)\rightarrow (0,0)}\frac{x^2}{\sqrt{x^2+y^2}}=0$, $\lim_{(x,y)\rightarrow (0,0)}\frac{x^2}{\sqrt{x^2+y^2}} \lim_{(x,y)\rightarrow (0,0)}y =0$, and $c_2\lim_{(x,y)\rightarrow (0,0)}\frac{x^2}{\sqrt{x^2+y^2}} =0$.
Since
$$
\frac{-x^2}{\sqrt{x^2+y^2}}\le\frac{x^2\sin(1/x)}{\sqrt{x^2+y^2}}\le \frac{x^2}{\sqrt{x^2+y^2}},
$$
we also have $\lim_{(x,y)\rightarrow (0,0)}\frac{x^2\sin(1/x)}{\sqrt{x^2+y^2}}=0$. Thus, $\lim_{(x,y)\rightarrow (0,0)} \frac{r_{c_1,c_2}(x,y)}{\sqrt{x^2+y^2}}=0$ and $\phi$ is differentiable also at $(0,c_2)$. 
A: No  calculation is necessary:   
The function $\phi$ is equal to the sum of the function $\phi_1$ defined by $\phi_1(x,y)=x^2y$ and of the function $\phi_2$ defined by $\phi_2(x,y)=\psi(x)$, with $\psi(x)=x^2\text{sin}(1/x)$ for $x\neq0$ and $\psi(0)=0$.
The polynomial function $\phi_1$ is obviously differentiable and $\phi_2$ is differentiable because $\psi$ is differentiable since  it has a derivative everywhere: for the only questionable point zero,    $\psi '(0)=0$  follows from the definition.
[Recall that in one variable "differentiable" is equivalent to "has a derivative"]
Hence  the sum $\phi=\phi_1+\phi_2$ is differentiable.
The problem is phony because it is a problem about the derivability of a function of one variable dressed up as a problem of differentiability of a function of two variables. 
