Let be $M:=\{(x,y)\in\mathbb{R}^2\mid x=y \text{ and } x\neq 0\}$ and $f:\mathbb{R}^2\to \mathbb{R}$ where $$ f(x,y)=\begin{cases} e^x-1, & \text{if } x \in M \\ 0, & \text{else } \\ \end{cases} $$ Show that both partials $D_1f(x,y)$ and $D_2f(x,y)$ at point $(a,b)$ exist iff $(a,b)\notin M$.
My approach:
1.) "$(a,b)\notin M \implies$ partials exists":
If $(a,b)=(0,0)$ then the differential quotients become: $$ D_1f(0,0)=\lim\limits_{\underset{x\neq 0}{x\to 0}}\frac{f(x,0)-f(0,0)}{x-0}=\lim\limits_{\underset{x\neq 0}{x\to 0}}\frac{0-0}{x-0}=0\\ D_2f(0,0)=\lim\limits_{\underset{y\neq 0}{y\to 0}}\frac{f(0,y)-f(0,0)}{y-0}=\lim\limits_{\underset{y\neq 0}{y\to 0}}\frac{0-0}{y-0}=0. $$ Now consider a point $(a,b)\notin (M \cup \{(0,0)\})$ which implies $a\neq b$ or in other words $|a-b|:=\delta>0$. We know that if a limit exists in a neighbourhood of $a$, $N_{\frac{\delta}{2}}(a):=\{x\in\mathbb{R}\mid |x-a|<\frac{\delta}{2}\}\subset B$, then it also exists in the set $B$. We apply this statement to the differential quotient by only considering those $x$ with $|x-a|<\frac{\delta}{2}$. Then $|x-b|<\frac{\delta}{2}$ and hence $x=b$ are impossible. For those $x$ the differential quotient becomes: $$ D_1f(a,b)=\lim\limits_{\underset{x\neq a}{x\to a}}\frac{f(x,b)-f(a,b)}{x-a}\underset{x\notin M}{=}\lim\limits_{\underset{x\neq a}{x\to a}}\frac{0-0}{x-a}=0.$$ We apply the same logic to the differential quotient regarding $y$ (which means that we have to guarantee that $y\neq a$ holds): $$ D_2f(a,b)=\lim\limits_{\underset{y\neq b}{y\to b}}\frac{f(a,y)-f(a,b)}{y-b}\underset{a\notin M}{=}\lim\limits_{\underset{y\neq b}{y\to b}}\frac{0-0}{y-b}=0. $$ As both limits exist in the defined neighbourhoods they also exist in $\mathbb{R}^2\setminus M$.
2.) "partials exists $\implies (a,b)\notin M$":
I will show this via the converse "$(a,b)\in M \implies$ partials can't exist". Recalling that $(a,b)\in M \implies a=b$ I will denote the point $(a,b)$ by $(a,a)$.
To show that the differential quotient at $(a,a)$ regarding $x$ can't exist, I plug in a sequence $\left(x_n\right)_{n\in\mathbb{N}}$ which consists of $x_n\notin M$. We define $x_n:=a+\frac{1}{n}$ and hence the differential quotient becomes: $$ D_1f(a,a)=\lim\limits_{\underset{x_n\neq a}{n\to \infty}}\frac{f(x_n,a)-f(a,a)}{x_n-a}=\lim\limits_{\underset{x_n\neq a}{n\to \infty}}\frac{0-e^a+1}{x_n-a}=\infty $$ To show that the differential quotient at $(a,a)$ regarding $y$ can't exist either, I plug in a sequence $\left(y_n\right)_{n\in\mathbb{N}}$ where $y_n:=a+\frac{1}{n}$ and hence the differential quotient becomes: $$ D_2f(a,a)=\lim\limits_{\underset{y_n\neq a}{n\to \infty}}\frac{f(a,y_n)-f(a,a)}{y_n-a}=\lim\limits_{\underset{y_n\neq a}{n\to \infty}}\frac{0-e^a+1}{y_n-a}=\infty. $$ So both partials can't exists at $(a,a)\in M$.
Hence, we have proven the equivalence "$D_1f(x,y)$ and $D_2f(x,y)$ at point $(a,b)$ exist iff $(a,b)\notin M$".
Is this proof correct? Would you have done it in a different way? Suggestions are appreciated :)