This note addresses a problem of nineteenth century applied mathematic
s-is it possible in the context of Hamiltonian mechanics to define a f
unction S of the generalized coordinates and momenta which is monotoni
cally increasing along orbits? The question is of interest, because, f
or a sytem not in thermodynamic equilibrium, entropy should increase s
trictly monotonically along an orbit, and a negative answer implies th
at mechanical principles different from those of Hamiltonian mechanics
must be introduced to explain thermodynamics. This note answers the q
uestion rigorously for Hamiltonian systems confined to an invariant re
gion of finite volume in phase space; it is not possible to define a c
ontinuous function which increases monotonically along orbits. An appe
ndix gives a translation of an 1889 paper of Poincare addressing the s
ame issue.