The classical Hamilton-Jacobi-Bellman theory in the calculus of variations, which is associated with the Bolza problem, is extended to other kinds of boundary-value problems, such as periodicity. By using the dual action principle of Clarke and earlier results by the author, one can establish the analogue of HJB on the symplectic group and show that it has a solution.