  The binary radix expansion of a real number can be used to code the outcome
of any series of coin tosses, a fact that provides an intriguing link between
number theory, measure theory and statistical physics. Inspired by this fact, a
general result is established for the definite integral of a differentiable
function of a single variable that allows any such integral to be exactly
written in terms of a double series. The theorem can be directly applied to a
wide variety of integrals of physical interest and to derive new series
expansions of real numbers and real-valued functions. We apply the theorem to
the integration of the equation of motion in one dimension of classical
Hamiltonian systems, focusing in the analysis of the nonlinear pendulum.
