Differentiability of the function $ f(x, y) = | e ^x-y | (e^x-1) $ 
Prove that the function $ f: \mathbb R^2 \to \mathbb R $ defined by
the formula $ f(x, y) = | e ^x-y | (e^x-1) $ is differentiable at $
 (a, b ) \in \mathbb R ^ 2 $ if and only if $ e ^ a \neq b $ or $ a = 0, b = 1 $.

I know that function is differentiable at $(x_0,y_0)$ if exist $Df(x_0,y_0)$ such that: $$\lim_{(h,k) \to (x_0,y_0)} \frac{f(x_0+h, y_0+k)-f(x_0,y_0)-h\cdot \frac{\partial f}{\partial x}(x_0,y_0)-k \cdot \frac{\partial f}{\partial y}(x_0,y_0)}{\sqrt{h^2+k^2}}=0$$
However, in my opinion, the formula of $f$ is too complicated to use this fact and I think that exist better solution.
 A: We divide the plane in three sets. The region $S_{1}=\left\{(x,y):e^{x}-y>0 \right\}$ and the region $S_{2}=\left\{(x,y):e^{x}-y<0 \right\}$ and the set $S_{3}=\left\{(x,y):e^{x}=y \right\}$. First consider an $(a,b)\in S_{1}$. Then there is a neighborhood $U$ of $(a,b) \subseteq S_{1}$.
We will consider Gateaux derivative in direction $(h_{1},h_{2})$ to make things simpler and then we will invoke the following standard result by Drabek-Milota:

If $f:X\to Y$ is a map of linear normed spaces such that in a certain open neighbourhood $O_{x_0}$ of $x_0\in X$ the Gateaux differential $\delta f(x)$ exists and is linear and continuous for all $x\in O_{x_0}$ and the map $x\mapsto \delta f(x)$ from $X$ into $L(X,Y)$ is continuous at $x_0$, then f is Frechet differentiable at $x_0$.

The function in $U$ is $f(x,y)=(e^{x}-y)(e^{x}-1)$. So
$$
\begin{align}
&\lim_{\epsilon \to 0}\dfrac{(e^{a+\epsilon\,h_{1}}-b-\epsilon\,h_{2})(e^{a+\epsilon\,h_{1}}-1)}{\epsilon}-\dfrac{(e^{a}-b)(e^{a}-1)}{\epsilon}\\
=&\lim_{\epsilon \to 0}\dfrac{e^{2a}(e^{2\epsilon\,h_{1}}-1)}{\epsilon}-e^{a}\dfrac{e^{\epsilon\,h_{1}}-1}{\epsilon}+be^{a}\dfrac{(1-e^{\epsilon\,h_{1}})}{\epsilon}+h_{2}\\
=&2h_{1}e^{2a}-h_{1}e^{a}-be^{b}h_{1}+h_{2}
\end{align}$$
which is linear in $(h_{1},h_{2})$ and continuous.
And also $(x,y)\to\,\delta\,f(x,y)$ is continuous at $(a,b)$. Therefore $f(x,y)$ is Frechet differentiable at $(a,b)$.
Likewise for $(a,b)\in\,S_{2}$. Now assume $(a,b)\in S_{3}$ and $(a,b)\,\neq\,(0,1)$. Then the limit
$$\lim_{\epsilon \to 0}\dfrac{e^{2a+2\epsilon\,h_{1}}-e^{a+\epsilon\,h_{1}}-be^{a+\epsilon\,h_{1}}+b}{\epsilon}-h_{2}e^{a}+h_{2}$$
does not exist unless $a=0$ and $b=1$. Thus we have proved the statement.
A: $f$ is obviously $C^\infty$ on the open set $\{(x,y)\in\mathbb R^2\mid y\ne e^x\}$.
Assume now $y_0=e^{x_0}$. Then,
$$f(x_0+h,y_0+k)=y_0\left|e^h-1-\frac k{y_0}\right|(y_0e^h-1)=y_0\left|h-\frac k{y_0}+o(h)\right|(y_0-1+y_0h+o(h)).$$
As a particular case, $f(h,1+k)=o(\|(h,k)\|)$ hence $Df(0,1)=0$. But in the other cases ($y_0\ne1$), $f$ is not differentiable at $(x_0,y_0)$, since e.g.
$$f(x_0,y_0+k)=|k|(y_0-1)\ne Ck+o(k)\quad(\forall C\in\mathbb R).$$
