This paper is devoted to investigate the existence of minimizers of a Bolza
-type functional over the solutions of a control system which dynamics is g
iven by a second-order differential equation, and a viability condition on
the trajectories is also assumed.