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$?

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)$. 
