Wouldn't the answer to $\int x\,dy + \int y\,dx = \int du$ be $xy + xy = u$ which is $$2xy = u+C$$
But my textbook says the answer is $$xy=u+C$$ since $$d(xy)=x\,dy+y\,dx$$ My question is, Isn't this only applicable when $y$ and $x$ are both functions of $x$. Here $x$ and $y$ are both independent since a third variable $u$ is present. Thanks in advance
Comparing
$$ \left\{ \begin{array}{rcl} u & = & u(x,y)\\ du & = & u_x dx + u_y dy\\ du & = & y dx+x dy \end{array} \right. $$
we have $\{u_x = y,\ \ u_y = x \} \Rightarrow \{u_{xy} = u_{yx} = 0\}$
then there exists $u(x,y) = \int u_x dx + \phi_1(y),\ \ u(x,y) = \int u_y dy + \phi_2(x)$
or
$\{u(x,y) = yx+\phi_1(y) = xy+\phi_2(x)\}\Rightarrow u(x,y)=x y + C_0$