Given a conservative field and a closed curve, let a and b be any two points on the curve. Run forward along the first path and backward along the second and the two equal integrals cancel, giving 0. Thus the integral around a closed curve in a conservative field is 0. conversely, assume the integrals around closed curves are always 0 and draw two paths from a to b. This forms a closed curve. The integral of the first path minus the integral of the second is 0, hence we have path independence and the field is conservative.
Let a continuous vector field f equal c∇g, i.e. some constant times the gradient of the scalar field g. Consider the line integral of f along a path from a to b. Choose any path p(t) from a to b. Recall that the integrand is f(p(t)).p′(t). However, this expression is the derivative of cg(p(t)) by the chain rule. The line integral becomes c×(g(b)-g(a)), and does not depend on the path. If a continuous vector field is proportional to the gradient of some other scalar field g, it is conservative.
We often use a constant of -1. As g rises, a force field, such as gravity, pushes you back downhill, opposite to the gradient of g. Under this convention, g(b)-g(a) gives the line integral from b back to a.
Conversely, assume f is a continuous conservative field throughout a region that includes the origin. For any point b in this region, let g(b) be the line integral of f from b back to 0. This is well defined since integrals are path independent. Note that g(0) = 0. Also, g(b)-g(a) is the line integral from b to 0 to a, and since we have path independence, g(b)-g(a) gives the line integral from b back to a along any path. We will now show that f = -∇g.
Let h be a small distance parallel to the x axis and consider g(b+h)-g(b). This is the line integral of f from b+h back to b. Again, we have path independence, so choose the simplest path, a straight line at constant speed. Now f.p′ extracts and negates the first component of f. The integrand is -f1(b+h-t), as t runs from 0 to h. Now we need the continuity of f. For any ε, keep h small enough so that f1(b+h-t) doesn't stray by more than ε from f1(b). The line integral is bounded by h×(-f1(b)±ε). Divide by h to produce the difference quotient, and in the limit, the partial of g with respect to x becomes -f1(b). This holds for all partials, hence f = -∇g. Since the partials are continuous, g is indeed differentiable, with f as derivative.
In summary, a continuous vector field is conservative iff it is minus the gradient of another field g. And if this is the case, the scalar field g is indeed differentiable, and the mixed partials are equal. This gives a necessary condition for path independence. If you've got a continuous vector field f, and you want to know if it is conservative, see if the mixed partials are equal.
If f is known to be conservative throughout a path-connected region, we can construct g algebraically by evaluating any line integral from the origin. (Assume the region contains the origin, or shift coordinates accordingly.) When feasible, a line integral with segments running parallel to the axes is most convenient. Let f comprise the following three component functions.
x ← y y ← z×cos(yz) + x z ← y×cos(yz)
Verify that the mixed partials are equal. The derivative of the first function with respect to y equals the derivative of the second with respect to x, and so on. Looks good; we should be able to find g. (This isn't guaranteed, but it's likely.)
Given a point x,y,z, let the first path run from 0 to x along the x axis. Now f.p′ extracts the first component, which is y; yet y = 0 along the x axis. The first line integral is 0.
The next segment runs from 0 to y, with x fixed. Remember that z is still 0. Since x is a constant as we move parallel to the y axis, the integral is xy.
Finally fix x and y and run parallel to the z axis. The integral becomes sin(yz), hence f is the gradiant of xy+sin(yz). Or if you prefer, f is minus the gradient of -xy-sin(yz).
Recall that the line integral gives the change in kinetic energy. If f = -∇g, Then g(x)-g(0) gives the kinetic energy that can be realized by any line integral from x back to 0. In this case g measures the potential energy, which can be converted into kinetic energy by following the force field f. For example, consider the common swing set. As the child descends from the top of the arc down to the bottom, potential energy, courtesy of the earth's gravitational field, is converted into kinetic energy, in the form of forward motion. As the child climbs back up the arc kinetic energy is converted back into potential energy, until he comes to a halt at the top. Near the earth's surface, potential energy is proportional to altitude.
Without friction or thrust, kinetic energy plus potential energy is constant. This sounds profound, but it is practically the definition of g. Let's illustrate with a space ship in a long elliptical orbit. The ship travels fast as it swoops low over the earth, and slows down as it reaches the highest point of its orbit. If you know the ship's altitude at any given time, you can compute its speed. Of course we don't know that gravity produces a conservative field, but we're going to prove that next.