Derivative of function with 2 variables

I've leart in Calculus 1 that the derivetive of $f(x)$ is:

$$\lim_{h\to0} \frac{f(x+h) - f(x)}{h}$$.

suppose $f(x,y)$ is a function with 2 variables,

does $$f'(x,y) = \lim_{h\to0} \frac{f(x+h, y+h) - f(x,y)}{h}$$ ?

If not , what is the derivetive of function with 2 variables?


Allow me to look at the definition of derivative from a different point of view.

Let $f\colon I\to \mathbb R$ be a function defined on a non-trivial interval $I$ and take $x_0\in I.$

The derivative of $f$ at $x_0$, denoted by, $f'(x_0)$, is $\lim \limits_{h\to 0}\left( \dfrac{f(x_0+h) - f(x_0)}{h}\right)$, if this limit exists finitely.

Assuming $f$ differentiable at $x_0$, the following equivalence holds, (note the absolute value in the denominator of the RHS):

$$f'(x_0)=\lim \limits_{h\to 0}\left( \dfrac{f(x_0+h) - f(x_0)}{h}\right) \iff \lim \limits_{h\to 0}\left(\dfrac{f(x_0+h)-f(x_0)-hf'(x_0)}{|h|}\right)=0.$$

This motivates the following alternative definition: $f$ is differentiable at $x_0$ if, and only if, there exists a linear map $L\colon \mathbb R\to \mathbb R$ such that $$\lim \limits_{h\to 0}\left(\dfrac{f(x_0+h)-f(x_0)-L(h)}{|h|}\right)=0.$$

If you take $L(h)=h\lim \limits_{k\to 0}\left( \dfrac{f(x_0+k) - f(x_0)}{k}\right)$, for all $h\in \mathbb R$, you get the usual definition.

One can generalize this definition to maps from $\mathbb R^n$ to $\mathbb R^m$.
Let $D\subseteq \mathbb R^n$ be an open set, consider a function $g\colon D\to \mathbb R^m$ and let $X_0\in D$.
The function $g$ is said to be differentiable at $X_0$ if, and only if, there exists a linear map $L\colon \mathbb R^n\to \mathbb R^m$ such that $$\lim \limits_{H\to 0_{\mathbb R^n}}\left(\dfrac{g(X_0+H)-g(X_0)-L(H)}{\|H\|}\right)=0_{\mathbb R^m}.$$ This linear map $L$ is denoted by $(Dg)(X_0)$ and it is called the differential of $g$ at $X_0$.


Why did I take this route instead of yours, which is also natural?

The definition I provided makes the conditional statement $\color{blue}{g\text{ is differentiable}\implies g\text{ is continuous}}$ true (it's in the books), while yours doesn't as can be seen from the example below.

Consider the function $f\colon \mathbb R^2\to \mathbb R$ defined by, for all $(x,y)\in \mathbb R^2$, $$f(x,y)=\begin{cases}\dfrac{2xy^2}{x^2+y^4}, &\text{ if }(x,y)\neq (0,0)\\ 0, &\text{ if }(x,y)=(0,0) \end{cases}.$$

Let us analyze what happens at $(0,0)$ using your definition of differentiability: $$f''(0,0)=\lim \limits_{h\to 0}\left(\dfrac{f(h,h)-f(0,0)}{h}\right)=\lim \limits_{h\to 0}\left(\dfrac{2h^3}{h^3+h^5}\right)=2.$$

However $f$ isn't continuous at $(0,0)$ because, given $m\in \mathbb R$, the following happens: $$\lim \limits_{(x,y)\to (0,0)}\left(f(my^2,y)\right)=\lim \limits_{(x,y)\to (0,0)}\left(\dfrac{2my^4}{m^2y^4+y^4}\right)=\dfrac{2m}{m^2+1},$$ therefore the limit depends on $m$, which contradicts the uniquess of the limit, thus $g$ isn't continuous at $(0,0)$.


A common way of writing the derivatives in the multivariable case is as follows:

$f_x= \lim_{h\to0} \frac{f(x+h, y) - f(x,y)}{h}$ and $f_y = \lim_{h\to0} \frac{f(x, y+h) - f(x,y)}{h}$ give the two partial derivatives. The big thing to note here is that we need to look at partial derivative. This is, as Glen O indicates, taking the derivative in a specific direction. Sometimes we also write $\dfrac{\partial f}{\partial x}$ and $\dfrac{\partial f}{\partial y}$ instead of $f_x$ and $f_y$.