  In nonholonomic mechanical systems with constraints that are affine (linear
nonhomogeneous) functions of the velocities, the energy is typically not a
first integral. It was shown in [Fass\`o and Sansonetto, JNLS, 26, (2016)]
that, nevertheless, there exist modifications of the energy, called there
moving energies, which under suitable conditions are first integrals. The first
goal of this paper is to study the properties of these functions and the
conditions that lead to their conservation. In particular, we enlarge the class
of moving energies considered in [Fass\`o and Sansonetto, JNLS, 26, (2016)].
The second goal of the paper is to demonstrate the relevance of moving energies
in nonholonomic mechanics. We show that certain first integrals of some well
known systems (the affine Veselova and LR systems), which had been detected on
a case-by-case way, are instances of moving energies. Moreover, we determine
conserved moving energies for a class of affine systems on Lie groups that
include the LR systems, for a heavy convex rigid body that rolls without
slipping on a uniformly rotating plane, and for an $n$-dimensional
generalization of the Chaplygin sphere problem to a uniformly rotating
hyperplane.
