  We give a geometric description of variational principles in mechanics, with
special attention to constrained systems. For the general case of nonholonomic
constraints, a unified variational approach is given, and the equations of
motion of both vakonomic and nonholonomic frameworks are obtained. We study
specifically the existence of infinitesimal variations in both cases. When the
constraints are integrable, both formalisms are compared and it is proved that
they coincide. As examples, we give geometric formulations of the equations of
motion for the case of optimal control and for vakonomic and nonholonomic
mechanics with constraints linear in the velocities.
