# Closed and exact differential forms

In mathematics, especially vector calculus and differential topology, a closed form is a differential form α whose exterior derivative is zero (dα = 0), and an exact form is a differential form, α, that is the exterior derivative of another differential form β. Thus, an exact form is in the image of d, and a closed form is in the kernel of d.
For an exact form α, α = dβ for some differential form β of degree one less than that of α. The form β is called a "potential form" or "primitive" for α. Since the exterior derivative of a closed form is zero, β is not unique, but can be modified by the addition of any closed form of degree one less than that of α.
Because d$^2$ = 0, every exact form is necessarily closed. The question of whether every closed form is exact depends on the topology of the domain of interest. On a contractible domain, every closed form is exact by the Poincaré lemma. More general questions of this kind on an arbitrary differentiable manifold are the subject of de Rham cohomology, which allows one to obtain purely topological information using differential methods.

## Examples

A simple example of a form that is closed but not exact is the 1-form $d\theta$ given by the derivative of argument on the punctured plane $\mathbb {R} ^{2}\smallsetminus \{0\}$. Since $\theta$ is not actually a function (see the next paragraph) $d\theta$ is not an exact form. Still, $d\theta$ has vanishing derivative and is therefore closed.
Note that the argument $\theta$ is only defined up to an integer multiple of $2\pi$ since a single point $p$ can be assigned different arguments $r$, $r+2\pi$, etc. We can assign arguments in a locally consistent manner around $p$, but not in a globally consistent manner. This is because if we trace a loop from $p$ counterclockwise around the origin and back to $p$, the argument increases by $2\pi$. Generally, the argument $\theta$ changes by
    $\oint _{S^{1}}d\theta$
over a counter-clockwise oriented loop $S^{1}$.
Even though the argument $\theta$ is not technically a function, the different local definitions of $\theta$ at a point $p$ differ from one another by constants. Since the derivative at $p$ only uses local data, and since functions that differ by a constant have the same derivative, the argument has a globally well-defined derivative "$d\theta$".
The upshot is that $d\theta$ is a one-form on $\mathbb {R} ^{2}\smallsetminus \{0\}$ that is not actually the derivative of any well-defined function $\theta$. We say that $d\theta$ is not exact. Explicitly, $d\theta$ is given as:
    $d\theta ={\frac {-y\,dx+x\,dy}{x^{2}+y^{2}}},$
which by inspection has derivative zero. Notice that if we restrict the domain to the right half-plane, we can write $d\theta =d\left(\tan ^{-1}(y/x)\right)$, but the angle function $\theta =\tan ^{-1}(y/x)$ is neither smooth nor continuous over $\mathbb {R} ^{2}\smallsetminus \{0\}$ (as is any choice of angle function). Because $d\theta$ has vanishing derivative, we say that it is closed.
On the other hand, for the one-form
    $\alpha =-y\,dx+x\,dy,$
$d\alpha \neq 0$. Thus $\alpha$ is not even closed, never mind exact.
The form $d\theta$ generates the de Rham cohomology group $H_{dR}^{1}(\mathbb {R} ^{2}\smallsetminus \{0\})\cong \mathbb {R} ,$ meaning that any closed form $\omega$ is the sum of an exact form $df$ and a multiple of $d\theta$: $\omega =df+k\ d\theta$, where k=1/2π ∮$_{S1}$ω{\textstyle k={\frac {1}{2\pi }}\oint _{S^{1}}\omega } accounts for a non-trivial contour integral around the origin, which is the only obstruction to a closed form on the punctured plane (locally the derivative of a potential function) being the derivative of a globally defined function.

## Examples in low dimensions

Differential forms in $\mathbb {R} ^{2}$ and $\mathbb {R} ^{3}$ were well known in the mathematical physics of the nineteenth century. In the plane, 0-forms are just functions, and 2-forms are functions times the basic area element $dx\wedge dy$, so that it is the 1-forms
    $\alpha =f(x,y)\,dx+g(x,y)\,dy$
that are of real interest. The formula for the exterior derivative $d$ here is
    $d\alpha =(g_{x}-f_{y})\,dx\wedge dy$
where the subscripts denote partial derivatives. Therefore the condition for $\alpha$ to be closed is
    $f_{y}=g_{x}.$
In this case if $h(x,y)$ is a function then
    $dh=h_{x}\,dx+h_{y}\,dy.$
The implication from 'exact' to 'closed' is then a consequence of the symmetry of second derivatives, with respect to $x$ and $y$.
The gradient theorem asserts that a 1-form is exact if and only if the line integral of the form depends only on the endpoints of the curve, or equivalently, if the integral around any smooth closed curve is zero.

### Vector field analogies

On a Riemannian manifold, or more generally a pseudo-Riemannian manifold, k-forms correspond to k-vector fields (by duality via the metric), so there is a notion of a vector field corresponding to a closed or exact form.
In 3 dimensions, an exact vector field (thought of as a 1-form) is called a conservative vector field, meaning that it is the derivative (gradient) of a 0-form (smooth scalar field), called the scalar potential. A closed vector field (thought of as a 1-form) is one whose derivative (curl) vanishes, and is called an irrotational vector field.
Thinking of a vector field as a 2-form instead, a closed vector field is one whose derivative (divergence) vanishes, and is called an incompressible flow (sometimes solenoidal vector field). The term incompressible is used because a non-zero divergence corresponds to the presence of sources and sinks in analogy with a fluid.
The concepts of conservative and incompressible vector fields generalize to n dimensions, because gradient and divergence generalize to n dimensions; curl is defined only in three dimensions, thus the concept of irrotational vector field does not generalize in this way.

## Poincaré lemma

The Poincaré lemma states that if B is an open ball in R$^n$, any closed p-form ω defined on B is exact, for any integer p with 1 ≤ p ≤ n.
More generally, the lemma states that on a contractible open subset of a manifold (e.g., $\mathbb {R} ^{n}$), a closed p-form, p > 0, is exact.

## Formulation as cohomology

When the difference of two closed forms is an exact form, they are said to be cohomologous to each other. That is, if ζ and η are closed forms, and one can find some β such that
    $\zeta -\eta =d\beta$
then one says that ζ and η are cohomologous to each other. Exact forms are sometimes said to be cohomologous to zero. The set of all forms cohomologous to a given form (and thus to each other) is called a de Rham cohomology class; the general study of such classes is known as cohomology. It makes no real sense to ask whether a 0-form (smooth function) is exact, since d increases degree by 1; but the clues from topology suggest that only the zero function should be called "exact". The cohomology classes are identified with locally constant functions.
Using contracting homotopies similar to the one used in the proof of the Poincaré lemma, it can be shown that de Rham cohomology is homotopy-invariant.

## Relevance to thermodynamics

Consider a thermodynamic system whose equilibrium states are specified by $n$ thermodynamic variables, $x_{1},x_{2},\ldots ,x_{n}$. The first law of thermodynamics can be stated as follows: In any process that results in an infinitesimal change of state where the internal energy of the system changes by an amount $dU(x_{1},x_{2},\ldots ,x_{n}),$ and an amount of work $dW(x_{1},x_{2},\ldots ,x_{n})$ is done on the system, one must also supply an amount of heat
    $dU-dW.$
The second law of thermodynamics is an empirical law of nature which says that there is no thermodynamic system for which $dU=dW$ in every circumstance, or in mathematical terms that, the differential form $dU-dW$ is not closed. Caratheodory's theorem further states that there exists an integrating denominator $T$ such that
    $dS\equiv {\frac {dU-dW}{T}}$
is a closed 1-form. The integrating denominator $T$ is the temperature, and the state function $S(x_{1},x_{2},\ldots ,x_{n})$ is the equilibrium entropy.

## Application in electrodynamics

In electrodynamics, the case of the magnetic field ${\vec {B}}(\mathbf {r} )$ produced by a stationary electrical current is important. There one deals with the vector potential ${\vec {A}}(\mathbf {r} )$ of this field. This case corresponds to k = 2, and the defining region is the full $\mathbb {R} ^{3}$. The current-density vector is ${\vec {j}}$. It corresponds to the current two-form
    $\mathbf {I} :=j_{1}(x_{1},x_{2},x_{3})\,{\rm {d}}x_{2}\wedge {\rm {d}}x_{3}+j_{2}(x_{1},x_{2},x_{3})\,{\rm {d}}x_{3}\wedge {\rm {d}}x_{1}+j_{3}(x_{1},x_{2},x_{3})\,{\rm {d}}x_{1}\wedge {\rm {d}}x_{2}.$
For the magnetic field ${\vec {B}}$ one has analogous results: it corresponds to the induction two-form $\Phi _{B}:=B_{1}{\rm {d}}x_{2}\wedge {\rm {d}}x_{3}+\cdots$, and can be derived from the vector potential ${\vec {A}}$, or the corresponding one-form $\mathbf {A}$,
    ${\vec {B}}=\operatorname {curl} {\vec {A}}=\left\{{\frac {\partial A_{3}}{\partial x_{2}}}-{\frac {\partial A_{2}}{\partial x_{3}}},{\frac {\partial A_{1}}{\partial x_{3}}}-{\frac {\partial A_{3}}{\partial x_{1}}},{\frac {\partial A_{2}}{\partial x_{1}}}-{\frac {\partial A_{1}}{\partial x_{2}}}\right\},{\text{ or }}\Phi _{B}={\rm {d}}\mathbf {A} .$
Thereby the vector potential ${\vec {A}}$ corresponds to the potential one-form
    $\mathbf {A} :=A_{1}\,{\rm {d}}x_{1}+A_{2}\,{\rm {d}}x_{2}+A_{3}\,{\rm {d}}x_{3}.$
The closedness of the magnetic-induction two-form corresponds to the property of the magnetic field that it is source-free: $\operatorname {div} {\vec {B}}\equiv 0$, i.e., that there are no magnetic monopoles.
In a special gauge, $\operatorname {div} {\vec {A}}{~{\stackrel {!}{=}}~}0$, this implies for i = 1, 2, 3
    $A_{i}({\vec {r}})=\int {\frac {\mu _{0}j_{i}\left({\vec {r}}'\right)\,\,dx_{1}'\,dx_{2}'\,dx_{3}'}{4\pi |{\vec {r}}-{\vec {r}}'|}}\,.$
(Here $\mu _{0}$ is the magnetic constant.)
This equation is remarkable, because it corresponds completely to a well-known formula for the electrical field ${\vec {E}}$, namely for the electrostatic Coulomb potential $\varphi (x_{1},x_{2},x_{3})$ of a charge density $\rho (x_{1},x_{2},x_{3})$. At this place one can already guess that
* ${\vec {E}}$ and ${\vec {B}},$
* $\rho$ and ${\vec {j}},$
* $\varphi$ and ${\vec {A}}$
can be unified to quantities with six rsp. four nontrivial components, which is the basis of the relativistic invariance of the Maxwell equations.
If the condition of stationarity is left, on the left-hand side of the above-mentioned equation one must add, in the equations for $A_{i}$, to the three space coordinates, as a fourth variable also the time t, whereas on the right-hand side, in $j_{i}'$, the so-called "retarded time", $t':=t-{\frac {|{\vec {r}}-{\vec {r}}'|}{c}}$, must be used, i.e. it is added to the argument of the current-density. Finally, as before, one integrates over the three primed space coordinates. (As usual c is the vacuum velocity of light.)