Formulating a function $f$ such that $\nabla f = F$ Example:
Let $F = (2xy)i+(x^2-\cos{z})j+(y\sin{z})k$.
Find a function $f$ so that $\nabla f=F$.
I understand that I can essentially go backwards and determine a solution from guesswork. My question is, what is a more systematic process that can be followed to get to the same solution?
Thanks!
 A: I'm not sure what you mean by guesswork. You have a system of partial differential equations, each in one variable, captured by $\nabla f=F$. By "in one variable", I refer to the fact that each PDE only involves a single partial derivative with respect to one variable. This allows us to integrate both sides of the PDE with respect to the differentiation variable, treating other variables as constants, and the constant of integration becomes a generic function of the remaining variables.
For example,
$$\frac{\partial f}{\partial x}=2xy\implies f(x,y,z)=x^2y+g(y,z)$$
Now differentiation with respect to $y$ gives
$$\frac{\partial f}{\partial y}=x^2-\cos z=x^2+\frac{\partial g}{\partial y}$$
From here you solve for $g$ (integrating with respect to $y$), then use the remaining PDE to arrive at a solution. Here you find
$$\frac{\partial g}{\partial y}=-\cos z\implies g(y,z)=-y\cos z+h(z)$$
Differentiate with respect to $z$ and you find
$$\frac{\partial f}{\partial z}=y\sin z=y\sin z+\frac{\partial h}{\partial z}\implies h(z)=C$$
So the solution to this system of PDEs is
$$f(x,y,z)=x^2y-y\cos z+C$$
