Are we to assume that X is a single real number and "grad" is just the derivative?
If that is the case, the, for x< 0, [itex]x/|x|^3= -1/x^2[/itex] and the integral is 1/x. If x> 0, [itex]x/|x|^3= 1/x^2[/itex] and the integral is -1/x.
If, however, X is the vector <x, y, z>, then the problem is not at all the same!
You are looking for a function U(x,y,z) such that
[tex]\left<\frac{\partial U}{\partial x}, \frac{\partial U}{\partial y}, \frac{\partial U}{\partial z}\right>= \left<\frac{x}{(x^2+ y^2+ z^2)^{3/2}}, \frac{y}{(x^2+ y^2+ z^2)^{3/2}}, \frac{z}{(x^2+ y^2+ z^2)^{3/2}}\right>[/tex]
And that's not terribly difficult.
To integrate
[tex]\frac{\partial U}{\partial x}= x(x^2+ y^2+ z^2}^{-3/2}[/tex]
with respect to x, let [itex]W= x^2+ y^2+ z^2[/itex]. Then, treating y and z as constants, dW= 2xdx and we have to integrate
[tex]\frac{1}{2}\int W^{-3/2}dW= -W^{-1/2}+ \phi(y,z)= -(x^2+ y^2+ z^2)^{-1/2}+ \phi(y,z)[/tex]
(Since the integration is done treating y and z as constant, the "constant of integration" may depend on y and z.)
Now, differentiate that with respect to y:
[tex](1/2)(x^2+ y^2+ z^2)^{-1/2}(2y)+ \phi_y= \frac{y}{\sqrt{x^2+ y^2+ z^2}}+ \phi_y[/tex]
Comparing that with the gradient, we see that [itex]\phi_y= 0[/itex] and so does not depend on y. Doing the same with z shows that [itex]\phi_z= 0[/itex] also and so it reallyis a constant.