# Problem about finite differences and mixed partial derivatives

Let $g(x,y)$ be a $C^2$ function.

(a). Show that $\lim_{h \to 0} {g(h,h)-g(h,0)-g(0,h)+g(0,0)\over h^2}=\frac{\partial^2 g}{\partial x \, \partial y}(0,0)$.

(b). Assume $g(x+h,y+h)-g(x+h,y)-g(x,y+h)+g(x,y)=0$ for all $x$, $y$ and $h$, $g(x,0)=x^2+1$ and $g(0,y)=\cos(y)$. Find the function $g(x,y)$.

For (a), I used mean value theorem,the continuity of $g_{yx}$ and the definition of limit using $ε-δ$ to get the more general result(not only satisfied at $(0,0)$). Is this the standard way?But I have a little confused because $h$ is the same variable appears in two variable place, but I find my book that it wrote: $\lim_{(s,t)_ \to (0,0)}\frac{g(x+s,y+t)-g(x+s,y)-g(x,y+t)+g(x,y)}{st}=g_{yx}(x,y)$

So now, I want to prove that $\lim_{h_ \to 0}\frac{g(x+h,y+h)-g(x+h,y)-g(x,y+h)+g(x,y)}{h^2}=g_{yx}(x,y)$. i.e., the variables $s$ and $t$ are replaced by the same variable $h$.

For (b), I use the general result of (a), Because of the assumption the problem gave, so I have $\frac{\partial^2 g}{\partial x \, \partial y}(x,y)=0$ for all $(x,y)$. $$g_{yx}(x,y)=0 \implies g_y(x,y)+h(y)=a \implies g(x,y)+p(x)+q(y)=ay+b$$ $$\implies g(x,y)=-p(x)+j(y)$$ $g(0,0)=0^2+1=1=-p(0)+j(0)$ $g(x,y)=-p(x)+j(y)=g(x,0)+g(0,y)-g(0,0)=x^2+1+cos(y)-1=x^2+cos(y)$.

I thought this question all day long, and finally have a little result, but still need some instruction here about my doubt, thank you~!