TITLE: Understanding the logic behind finding the Parent Function given an Exact Differential
QUESTION [5 upvotes]: I know the procedure to find the parent function but I do not understand the logic behind this procedure.

Lets suppose we are greeted with an exact differential:
$$du=y\,dx+(x+2y)dy\tag{a}$$ and we wish to find the parent function $u=u(x,y)$.
For the case of a general differential $df$ $$df(x,y)=\frac{\partial f}{\partial x}dx+\frac{\partial f}{\partial y}dy\tag{b}$$
Using the form of $(\mathrm{b})$ in the specific case of $(a)$ we have $$\frac{\partial u}{\partial x}=y\tag{1}$$
and
$$\frac{\partial u}{\partial y}=x+2y\tag{2}$$

Starting with equation $(1)$; I attempt via integration wrt $x$ to find the parent function $u$:
$$u(x,y)=\fbox{$\color{red}{\int\frac{\partial u}{\partial x}dx=xy+g(y)}$}$$
Where $g(y)$ is an unknown function of $y$.
Now it is at this point that I am already confused for $2$ reasons:
1. The LHS of the boxed equation is $$\int\frac{\partial u}{\partial x}\color{blue}{dx}$$ But, shouldn't this really be $$\int\frac{\partial u}{\partial x}\color{blue}{\partial x}$$ since we are integrating a partial derivative? Therefore, Is this really the 'partial integral'? 
I write this as I see no justification in integrating a partial derivative when the integration differential is not partial. 

2. The RHS has $g(y)$ as an unknown function of $y$. But why is this? Why not have an unknown function of $x$; $h(x)$ or an unknown function of $x$ & $y$; $q(x,y)$? 
Or lastly; since I know that only one of these $3$ possibilities can be correct why not write the RHS as $xy+g(y)+\text{constant}$

Proceeding anyway to equation $(2)$ and following the same recipe as before
I find that 
$$u(x,y)=\fbox{$\color{#180}{\int\frac{\partial u}{\partial y}dy=xy+y^2+r(x)}$}$$
Where $r(x)$ is an unknown function of $x$.
Iff $u(x,y)$ is equal to both $\color{red}{xy+g(y)}$ and $\color{#180}{xy + y^2 + r(x)}$ we must match them up I guess and conclude that $g(y)=y^2$ and $r(x)=0$. Is this logic correct?
If so we can write the parent function as $$u(x,y)=xy + y^2$$ 
The problem is that the correct answer is $$\color{#F80}{u(x,y)=xy + y^2+C}$$ where $C$ is a constant. But where on earth did the constant $C$ come from? I just matched up the two equations for $u(x,y)$ and found that there is no extra constant $C$.

I know this is an awful lot of questions for one post, but if anyone is able to answer some or any of them it will be greatly appreciated.

Just in case you were wondering; I got the idea for this question from another users' question on this site which can be found here and I have also read this similar post from the same user, but I'm still confused, sorry.

REPLY [2 votes]: (aside: the OP uses $u$ for two different purposes; I will opt to use $u$ for the variable — if I wish to express the variable $u$ as a function of $x$ and $y$, I will introduce a new letter for that function rather than reuse $u$)
The notation $\partial u / \partial x$ demands special notation, because $\mathrm{d} u$ and $\mathrm{d} x$ (and even $\mathrm{d}u/\mathrm{d}x$, should the differentials be ratios of one another) are things that are meaningful in the same sorts of contexts that one uses the notation $\partial u/\partial x$, and one needs notation to distinguish between them.
(this notation for partial derivatives has other deficiencies, but that's another issue)
However, in the partial integral, there is no ambiguity there — in fact, $\mathrm{d}x$ is specifically desired, since it correctly expresses the differential form to be integrated.
The thing that is different here is the $\int$. Integration here should happen over a path; paths of constant $y$ are implicitly intended here.
(and the scalar $\partial u/\partial x$, when restricted to a path of constant $y$, is equal to $\mathrm{d} u/\mathrm{d} x$, which is well-defined on paths of constant $y$)