Integrating the derivative of a function with respect the components of a vector

I'm stuck determining the integrals of the partial derivatives of a scalar function $$F:\mathbb{R}^3\times\mathbb{R}^3\rightarrow\mathbb{R}$$ with respect to the components of a vector. In the case of the problem I am trying to solve, $$F=F(\vec x, \vec y)$$ and the following relations hold

$$y_i=\frac{\partial F}{\partial x_i} \tag{1}$$ $$x_i=\frac{\partial F}{\partial y_i}\tag{2}$$

My attempt at a solution

Performing the "partial integration" over $$(1)$$ and $$(2)$$,

$$F(\vec x, \vec y)=\int\frac{\partial F}{\partial x_i}dx_i=\int y_idx_i+g_i(x_j, \vec y)=x_iy_i +g_i(x_j, \vec y) \tag{3}$$ $$F(\vec x, \vec y)=\int\frac{\partial F}{\partial y_i}dy_i=\int x_idy_i+h_i(\vec x,y_j)=x_iy_i +h_i(\vec x,y_j) \tag{4}$$

Where $$j\neq i$$ in the functions $$g_i$$ and $$h_i$$. I see that adding for $$i=1,2,3$$ the RHS $$(3)$$ and $$(4)$$ we can write

$$3F(\vec x, \vec y)=\vec x · \vec y + \sum_{i=1\\j\neq i}^3 g_i(x_j, \vec y) \tag{5}$$

$$3F(\vec x, \vec y)=\vec x · \vec y + \sum_{i=1\\j\neq i}^3 h_i(\vec x,y_j) \tag{6}$$

Obtaining this relation for the functions $$g_i$$ and $$h_i$$

$$\sum_{i=1\\j\neq i}^3 g_i(x_j, \vec y)=\sum_{i=1\\j\neq i}^3 h_i(\vec x,y_j) \tag{7}$$

Would this approach be correct? Could we tell something else about the integrating "constants" $$g_i$$ and $$h_i$$ in addition to $$(7)$$?