 The latter is called a transversality condition for a fixed horizon problem.It can be seen that the necessary conditions are identical to the ones stated above for the Hamiltonian.Thus the Hamiltonian can be understood as a device to generate the first-order necessary conditions.