  When generalizing the principle of least action for fields containing higher
order derivatives, in general, it is not possible not to take into account the
surface integrated term since it gives direct contribution to the forms of the
equations of motion,of the energy-momentum tensor and of the angular-momentum
tensor. This result is applied to two examples. In two dimensional gravity, it
is essential to supplement Dirichclet condition for the surface integrated
terms to vanish. On the contrary, in Hamiltonian description of the open rigid
string, the equation of motion is modified by surface integrated terms.
Boundary conditions are classified according to forms of certain equations of
motion.
