Yes, it is possible. I will give an example to demonstrate the general procedure. Consider $f(x, y) = x^3 - 3xy^2 + x^2 + y^2 + \log x$. Then $\nabla f = \dfrac{\partial f}{\partial x}\hat{i} + \dfrac{\partial f}{\partial y}\hat{j} = \left(3x^2 - 3y^2 + 2x + \dfrac{1}{x}\right)\hat{i} + (2y -6xy)\hat{j}$.
To reverse this, we look at each component individually. We know that
$\dfrac{\partial f}{\partial x} = 3x^2 - 3y^2 + 2x + \dfrac{1}{x}\\
\dfrac{\partial f}{\partial y} = 2y - 6xy
$
Therefore:
$\begin{align}
\displaystyle f(x,y) & = \int \dfrac{\partial f}{\partial x}\, dx\\
& = \int 3x^2 - 3y^2 + 2x + \dfrac{1}{x}\, dx\\
& = x^3 - 3xy^2 + x^2 + \log x + u(y)
\end{align}$
What is that $u(y)$? It's the "constant" of integration, of course.When we differentiate $f$ with respect to $x$ partially, any term of $f$ not containing $x$ is a constant - this includes terms containing only $y$.
Now to determine $u(y)$, we look at $\dfrac{\partial f}{\partial y}$. We could integrate this with respect to $y$, similar to what we did with $\dfrac{\partial f}{\partial x}$. Then some of the terms after the integration will be common. The terms that are not common are those that constitute $u(y)$. So we need to look for terms of $\dfrac{\partial f}{\partial y}$ that do not contain $x$, and integrate them. Here, $\dfrac{\partial f}{\partial y} = 2y - 6xy$, and the only term not containing $x$ is $2y$. Therefore:
$\displaystyle u(y) = \int 2y\, dy = y^2 + C$.
Thus, $\boxed{f(x, y) = x^3 - 3xy^2 + x^2 + \log x + y^2 + C}$.
In general:
$$f(x, y) = \int \dfrac{\partial f}{\partial x} dx + \int \left[\text{terms of $\dfrac{\partial f}{\partial y}$ that do not contain $x$}\right]\, dy$$
When you face an integral
$$I=\int \frac {dx}{\sqrt{x^3+\alpha x^2+\beta x+\gamma}}$$ you will, most of the time obtain very nasty expressions (such as in this case).
However, if you isolate the roots $(a,b,c)$ of the cubic polynomial and write
$$I=\int \frac {dx}{\sqrt{(x-a)(x-b)(x-c)}}=-\frac{2 }{\sqrt{b-
a}}F\left(\sin
^{-1}\left(\frac{\sqrt{b-a}}{\sqrt{x-a}}\right)|\frac{a-c}{a-b}\right)$$ where appears the elliptic integral of the first kind.
The same with quartics.
Best Answer
The domain of an antiderivative function is trivially the subset of the domain of the integrand where it is integrable.
I would rather write a general indefinite integral of $\dfrac 1x$ as
$$\log(|x|)+C+C'u(x)$$ where $u$ denotes a Heaviside step.