# Problems with partial derivatives.

I have a problem with the next exercise. It's so confusing for me. I have one implication, but no the other.

Let $f:D\subset\mathbb{R}^2\rightarrow\mathbb{R}$ with $D$ open set. The exercise is the next:

$\displaystyle\frac{\partial f}{\partial x} = \displaystyle\frac{\partial f}{\partial y}$ for all $(x,y)\in D$ if and only if there exist a derivable function $g$ such that $f(x,y)=g(x+y)$ for all $(x,y)\in D$.

$\Leftarrow )$

Let $(x,y)\in D$

$\displaystyle\frac{\partial f}{\partial x}=\lim\limits_{h\rightarrow 0} \displaystyle\frac{f(x+h,y)-f(x,y)}{h}=\lim\limits_{h\rightarrow 0}\displaystyle\frac{g(x+y+h)-g(x+y)}{h}=g'(x+y)$ (the limit there exist because $g$ is derivable).

$\displaystyle\frac{\partial f}{\partial y}=\lim\limits_{h\rightarrow 0} \displaystyle\frac{f(x,y+h)-f(x,y)}{h}=\lim\limits_{h\rightarrow 0}\displaystyle\frac{g(x+y+h)-g(x+y)}{h}=g'(x+y)$ (again, the limit there exist because $g$ is derivable).

Thus, $\displaystyle\frac{\partial f}{\partial x} = \displaystyle\frac{\partial f}{\partial y}$

But, I can't understand the implication $\Rightarrow)$. Some hint? I think define a function using the partial derivatives, but, really, I don't know how.

Assume \begin{align} \frac{\partial f}{\partial x}- \frac{\partial f}{\partial y} = 0. \end{align} Using a change of variables \begin{align} x = \frac{x'+y'}{2}\\ y = \frac{x'-y'}{2} \end{align} and define \begin{align} u(x', y') := f(x'+y', x'-y') \end{align} then by the chain rule we get that \begin{align} \frac{\partial u}{\partial y'} = \frac{\partial f}{\partial x}\frac{\partial x}{\partial y'}+\frac{\partial f}{\partial y}\frac{\partial y}{\partial y'} = \frac{1}{2}\left(\frac{\partial f}{\partial x}- \frac{\partial f}{\partial y}\right) =0. \end{align} Hence it follows $u$ only depends on $x'$, i.e. $u(x', y') = g(x')$ for some $g$. But since $x' = x+y$ and $y' = x-y$, then we have $f(x, y)= u(x+y, x-y) = g(x+y)$.