  The set of closed (or holonomic) measures provides a useful setting for
studying optimization problems because it contains all curves, while also
enjoying good compactness and convexity properties.
  We study the way to do variational calculus on the set of closed measures.
Our main result is a full description of the distributions that arise as the
derivatives of variations of such closed measures. We give examples of how this
can be used to extract information about the critical closed measures.
  The condition of criticality with respect to variations leads, in certain
circumstances, to the Euler-Lagrange equations. To understand when this
happens, we characterize the closed measures that are invariant under the
Euler-Lagrange flow. Our result implies Ricardo Ma\~n\'e's statement that all
minimizers are invariant.
