Problem 2-21
Let $g_1,g_2:\mathbb{R}^2\to\mathbb{R}$ be continuous. Define $f:\mathbb{R}^2\to\mathbb{R}$ by $$f(x,y)=\int_0^x g_1(t,0)dt+\int_0^y g_2(x,t)dt.$$
(a) Show that $D_2f(x,y)=g_2(x,y)$.
(b) How should $f$ be defined so that $D_1f(x,y)=g_1(x,y)$?
(c) Find a function $f:\mathbb{R}^2\to\mathbb{R}$ such that $D_1f(x,y)=x$ and $D_2f(x,y)=y$. Find one such that $D_1f(x,y)=y$ and $D_2f(x,y)=x$.
When I tried to solve (b), I guessed the answer was $f(x,y)=\int_0^y g_2(0,t)dt+\int_0^x g_1(t,y)dt$ because I already knew the strange integral formula $f(x,y)=\int_0^x g_1(t,0)dt+\int_0^y g_2(x,t)dt$ provided by the author and I already knew the result of (a).
But I thought the most natural answer to (b) was $f(x,y)=\int_0^x g_1(t,y)dt$.
About (c), we can easily find $f(x,y)=\frac{1}{2}x^2+\frac{1}{2}y^2+C$ and $f(x,y)=xy+C$.
If we just want to solve (c), there's no need to use such a strange integral formula.
I would like to confirm since I'm not entirely certain, did the author want to provide a method to find a function $f:\mathbb{R}^2\to\mathbb{R}$ such that $D_1f(x,y)=g_1(x,y)$ and $D_2f(x,y)=g_2(x,y)$ where $g_1$ and $g_2$ are sufficiently good functions?
By the way, I noticed how to find $f$ naturally.
I think a natural way to find $f$ is the following:
Let $g_1,g_2:\mathbb{R}^2\to\mathbb{R}$ be continous.
Suppose that we want to find $f:\mathbb{R}^2\to\mathbb{R}$ such that $D_1f(x,y)=g_1(x,y)$ and $D_2f(x,y)=g_2(x,y)$.
Since $D_2f(x,y)=g_2(x,y)$ must hold, $f$ must be the form $f(x,y)=\int_0^y g_2(x,t)dt + G(x)$, where $G(x)$ is the constant of integration.
$G(x)$ must be differentiable.
We will know $\frac{\partial}{\partial x}\int_0^y g_2(x,t)dt$ exists if $D_1g_2(x,y)$ exists and $D_1g_2(x,y)$ is continuous in Chapter 3.
Since $\frac{\partial}{\partial x}\left(\int_0^y g_2(x,t)dt + G(x)\right)=\frac{\partial}{\partial x}\int_0^y g_2(x,t)dt+G'(x)$ and $D_1f(x,y)=g_1(x,y)$ must holds, $G'(x)=g_1(x,y)-\frac{\partial}{\partial x}\int_0^y g_2(x,t)dt$ must hold.
If $g_1(x,y)-\frac{\partial}{\partial x}\int_0^y g_2(x,t)dt$ is not independent of $y$, then there is no $f$ which satisfies $D_1f(x,y)=g_1(x,y)$ and $D_2f(x,y)=g_2(x,y)$.
Assume that $g_1(x,y)-\frac{\partial}{\partial x}\int_0^y g_2(x,t)dt$ is independent of $y$.
By our assumption, $G'(x)=g_1(x,0)-\frac{\partial}{\partial x}\int_0^0 g_2(x,t)dt=g_1(x,0)$ must hold.
So, $G(x)=\int_0^x g_1(t,0)dt+C$ must hold, where $C$ is an arbitrary real number.
Therefore, $f(x,y)=\int_0^x g_1(t,0)dt+\int_0^y g_2(x,t)dt+C$ must hold.