# Using the limit definition of the derivative, show that the function is differentiable on its domain.

The function is: $f:R^2 \rightarrow R,\ \ f(x,y) = x - y$

I'm supposed to use the limit definition of the derivative to show this function is differentiable. However, after computing the gradient and using the definition, I get a $0$ in the numerator so I still end up with a $\frac{0}{\sqrt{h_1^2 + h_2^2}}$, where $h = (h_1,h_2)$. Any advice on what to do/what went wrong?

Sub question: Could anyone confirm the process (same question) except if $f(x,y) = x^2 + y$

$\nabla f(x,y) = (2x,1)$

$\lim_{h\to0} \frac{f(x+h_1, y+h_2) - f(x,y) - (2x,1)\cdot(h)}{\|h\|} = 0$

$\lim_{h\to0} \frac{(x+h_1)^2 + (y+h_2) - (x^2+y) - (2xh_1+h_2)}{\|h\|} = 0$

$\lim_{h\to0} \frac{x^2+2xh_1+h_1^2 + y+h_2 -x^2-y -2xh_1-h_2}{\|h\|} = 0$

$\lim_{h\to0} \frac{h_1^2}{\|h\|} = 0$

$0 \leq \frac{h_1^2}{\|h\|} \leq \frac{\|h\|^2}{\|h\|} = \|h\|$

By squeeze thm, $\lim_{h\to0} \frac{h_1^2}{\|h\|} = 0$

$\therefore f(x,y) = x^2 + y$ is differentiable.

Fix a point $(x_0,y_0)\in{\mathbb R}^2$. One has $$f(x_0+X,y_0+Y)-f(x_0,y_0)=(x_0+X)-(y_0+Y)-(x_0-y_0)=X-Y$$ for all increment vectors $(X,Y)$, and therefore $$\lim_{(X,Y)\to(0,0)}{f(x_0+X,y_0+Y)-f(x_0,y_0)-(X-Y)\over\sqrt{X^2+Y^2}}=0$$ trivially. This proves that $$df(x_0,y_0).(X,Y)=X-Y\ ,$$ and in particular that $f$ is differentiable at $(x_0,y_0)$ with Jacobian matrix $\bigl[df(x_0,y_0)\bigr]=[1 \ \ -1]$.