  The present paper extends the classical second-order variational problem of
Herglotz type to the more general context of the Euclidean sphere S^n following
variational and optimal control approaches. The relation between the
Hamiltonian equations and the generalized Euler-Lagrange equations is
established. This problem covers some classical variational problems posed on
the Riemannian manifold S^n such as the problem of finding cubic polynomials on
S^n. It also finds applicability on the dynamics of the simple pendulum in a
resistive medium.
