Exercise 21. A real-valued function $u(x,y)$ is a real-valued function defined in a domain $D$. If $\frac{\partial u}{\partial x}=\frac{2x}{x^2+y^2}$ and $\frac{\partial u}{\partial y}=\frac{2y}{x^2+y^2}$ at every point in the annulus $A = \{z:1<|z|<3\}$. Determine $u(x,y)$ up to an additive constant.
A similar process is done with the following example in the textbook:
A real-valued function $u(x,y)$ satisfies
$\frac{\partial u}{\partial x} = 3$ and $\frac{\partial u}{\partial y} = 6$ (2)
at every point in the open disk $D=\{z:|z|<1\}$. Show that $u(x,y)=3x + 6y + c$ for some constant $c$.
Solution. Let $v(x,y)=3x+6y$, and consider the function $w(x,y):=u(x,y)-v(x,y).$ From (2) and the definition of $v(x,y)$, we have
$\frac{\partial w}{\partial x}=3-3=0$ and $\frac{\partial w}{\partial y}=6-6=0$
at each point of $D$. Since $D$ is a domain, Theorem 1 asserts that $w(x,y)$ is constant in $D$, say $w(x,y)=c$. Thus $u(x,y) = v(x,y) + w(x,y)+c$, which is the requested formula for $u$.
In order to solve exercise 21, I attempted to integrate $\frac{\partial u}{\partial x}$ with respect to $x$, treating $y^2$ as a constant. Thus getting that
${\partial u} = \frac{2x}{x^2 + y^2}\partial x$.
Then treating $y^2$ as a constant, I get after integrating that $u= \log(x^2+y^2)+C$.
I'm pretty sure that my process is faulty, but I was hoping that someone could show in detail how I would get the equation $v(x,y)$, as illustrated in the example provided.
First confirm that $u$ exists by showing
$$ \frac{\partial^2 u}{\partial x\partial y} = \frac{\partial}{\partial y}\left(\frac{2x}{x^2+y^2}\right) = \frac{\partial}{\partial x}\left(\frac{2y}{x^2+y^2}\right) $$
Next, integrate one of the partials
$$ u(x,y) = \int \frac{2x}{x^2+y^2} dx = \ln (x^2 + y^2) + g(y) $$
where $g(y)$ is the constant of integration which depends on $y$. Take this result and differentiate it the other way:
$$ \frac{\partial u}{\partial y} = \frac{\partial}{\partial y}\big(\ln(x^2+y^2) + g(y) \big) = \frac{2y}{x^2+y^2} + g'(y) = \frac{2y}{x^2+y^2} $$
This gives $g'(y) = 0$, therefore $g(y) = C$
Your final solution is
$$ u(x,y) = \ln(x^2+y^2) + C $$