Derivative of evaluation along diagonal $g(x) := f(x,x)$ Let $f:\mathbb{R}^2 \to \mathbb{R}$ be a differentiable function. Define $g(x) := f(x,x)$. I want to prove that $g$ is differentiable as well and that
$$Dg(x)h = Df(x,x)(h,h) = [\partial_1f(x,x) + \partial_2f(x,x)]h.$$
I was trying to prove the fact by directly using the definition of differentiability for functions of one variable. We have
\begin{align*}
g(x+h) - g(x) &= f(x+h,x+h) - f(x,x)\\
&= f(x+h,x+h) - f(x+h,x) + f(x+h,x) - f(x,x)\\
\end{align*}
Now, if we devide by $h$
\begin{align*}
\frac{f(x+h,x+h) - f(x+h,x)}{h} + \frac{f(x+h,x) - f(x,x)}{h}\\
\end{align*}
and take the limit $h \to 0$ we get
\begin{align*}
\lim_{h \to 0} \frac{f(x+h,x+h) - f(x+h,x)}{h} + \partial_1f(x,x).
\end{align*}
Here I'm stuck. How can I show that the first limit equals $\partial_2f(x,x)$?
 A: The easy way is to use the chain rule. Let $\Delta(x) \doteq (x,x)$. Clearly $\Delta$ is linear. So $g = f\circ \Delta$ implies $$Dg(x)(h) =D(f\circ \Delta)(x)(h) = Df(\Delta(x))\circ D\Delta(x)(h) = Df(x,x)(\Delta(h)) = Df(x,x)(h,h),$$as wanted.
A: If you want to use the definition and not the chain rule, argue as follows:
we have $\lim_{(h,k) \to 0} \frac{|f(x + h, x + k) - f(x, x) - Df(x, x)(h, k)|}{|(h,k)|}=0.$ 
This limit is independent of the direction of approach to $0$, so in particular if we take $h=k$ we have 
$\lim_{(h,h) \to 0}\frac{|g(x + h) - g(x) - Df(x, x)(h, h)|}{|(h,h)|}=\lim_{(h,h) \to 0}\frac{|g(x + h) - g(x) - Df(x, x)(h, h)|}{\sqrt 2|h|}=0\Rightarrow \lim_{h \to 0}\frac{|g(x + h) - g(x) - Df(x, x)(h, h)|}{|h|}=0$ 
and now it follows by definition that $g'(x)=Df(x,x)(h,h).$
A: I think it just follows from the definition of the derivative of $f$: 
\begin{align*}
0 &= \lim_{h \to 0} \frac{|f(x + h, x + h) - f(x, x) - Df(x, x)(h, h)|}{|h|} \\
&= \lim_{h \to 0}\frac{|g(x + h) - g(x) - Df(x, x)(h, h)|}{|h|},
\end{align*}
thus by definition, $Dg(x)h = Df(x, x)(h, h)$.
