The gradient theorem, also known as the fundamental theorem of calculus for line integrals, says that a line integral through a gradient field can be evaluated by evaluating the original scalar field at the endpoints of the curve.

The gradient theorem implies that line integrals through gradient fields are path independent. In physics this theorem is one of the ways of defining a "conservative" force. By placing φ as potential, ∇φ is a conservative field. Work done by conservative forces does not depend on the path followed by the object, but only the end points, as the above equation shows.

The gradient theorem also has an interesting converse: any path-independent vector field can be expressed as the gradient of a scalar field. Just like the gradient theorem itself, this converse has many striking consequences and applications in both pure and applied mathematics.

Notice all of the painstaking computations involved in directly calculating the integral. Instead, since the function f(x, y) = xy is differentiable on all of R2, we can simply use the gradient theorem to say

.

Notice that either way gives the same answer, but using the latter method, most of the work is already done in the proof of the gradient theorem.

For a more abstract example, suppose γ ⊂ Rn has endpoints p, q, with orientation from p to q. For u in Rn, let |u| denote the Euclidean norm of u. If α ≥ 1 is a real number, then

Here the final equality follows by the gradient theorem, since the function f(x) = |x|α + 1 is differentiable on Rn if α ≥ 1.

If α < 1 then this equality will still hold in most cases, but caution must be taken if γ passes through or encloses the origin, because the integrand vector field |x|α−1x will fail to be defined there. However, the case α = −1 is somewhat different; in this case, the integrand becomes |x|−2x = ∇(log|x|), so that the final equality becomes log|q|−log|p|.

Note that if n=1, then this example is simply a slight variant of the familiar Power rule from single-variable calculus.

Suppose there are npoint charges arranged in three-dimensional space, and the i-th point charge has chargeQi and is located at position pi in R3. We would like to calculate the work done on a particle of charge q as it travels from a point a to a point b in R3. Using Coulomb's law, we can easily determine that the force on the particle at position r will be

Let γ ⊂ R3 − {p1, ..., pn} be an arbitrary differentiable curve from a to b. Then the work done on the particle is

Now for each i, direct computation shows that

Thus, continuing from above and using the gradient theorem,

We are finished. Of course, we could have easily completed this calculation using the powerful language of electrostatic potential or electrostatic potential energy (with the familiar formulas W = −ΔU = −qΔV). However, we have not yet defined potential or potential energy, because the converse of the gradient theorem is required to prove that these are well-defined, differentiable functions and that these formulas hold (see below). Thus, we have solved this problem using only Coulomb's Law, the definition of work, and the gradient theorem.

The gradient theorem states that if the vector field F is the gradient of some scalar-valued function (i.e, if F is conservative), then F is a path-independent vector field (i.e, the integral of F over some piecewise-differentiable curve is dependent only on end points). This theorem has a powerful converse; namely, if F is a path-independent vector field, then F is the gradient of some scalar-valued function.[2] It is straightforward to show that a vector field is path-independent if and only if the integral of the vector field over every closed loop in its domain is zero. Thus the converse can alternatively be stated as follows: If the integral of F over every closed loop in the domain of F is zero, then F is the gradient of some scalar-valued function.

Proof of the converse

Suppose U is an open, path-connected subset of Rn, and F : U → Rn is a continuous and path-independent vector field. Fix some element a of U, and define f : U → R by

Here γ[a, x] is any (differentiable) curve in U originating at a and terminating at x. We know that f is well-defined because F is path-independent.

To calculate the integral within the final limit, we must parametrize γ[x, x+tv]. Since F is path-independent, U is open, and t is approaching zero, we may assume that this path is a straight line, and parametrize it as u(s) = x + sv for 0 < s < t. Now, since u'(s) = v, the limit becomes

Thus we have a formula for ∂vf, where v is arbitrary.. Let x = (x1, x2, ..., xn) and let ei denote the i-thstandard basis vector, so that

Thus we have found a scalar-valued function f whose gradient is the path-independent vector field F, as desired.[2]

Therefore the above theorem implies that the electric force fieldFe : S → R3 is conservative (here S is some open, path-connected subset of R3 that contains a charge distribution). Following the ideas of the above proof, we can set some reference point a in S, and define a function Ue: S → R by

Using the above proof, we know Ue is well-defined and differentiable, and Fe = −∇Ue (from this formula we can use the gradient theorem to easily derive the well-known formula for calculating work done by conservative forces: W = −ΔU). This function Ue is often referred to as the electrostatic potential energy of the system of charges in S (with reference to the zero-of-potential a). In many cases, the domain S is assumed to be unbounded and the reference point a is taken to be "infinity," which can be made rigorous using limiting techniques. This function Ue is an indispensable tool used in the analysis of many physical systems.

This powerful statement is a generalization of the gradient theorem from 1-forms defined on one-dimensional manifolds to differential forms defined on manifolds of arbitrary dimension.

The converse statement of the gradient theorem also has a powerful generalization in terms of differential forms on manifolds. In particular, suppose ω is a form defined on a contractible domain, and the integral of ω over any closed manifold is zero. Then there exists a form ψ such that ω = dψ. Thus, on a contractible domain, every closed form is exact. This result is summarized by the Poincaré lemma.