About Boundary Terms in Higher Order Theories
  It is shown that when in a higher order variational principle one fixes fields at the boundary leaving the field derivatives unconstrained, then the variational principle (in particular the solution space) is not invariant with respect to the addition of boundary terms to the action, as it happens instead when the correct procedure is applied. Examples are considered to show how leaving derivatives of fields unconstrained affects the physical interpretation of the model. This is justified in particularl by the need of clarifying the issue for the purpose of applications to relativistic gravitational theories, where a bit of confusion still exists. On the contrary, as it is well known for variational principles of order k, if one fixes variables together with their derivatives (up to order k-1) on the boundary then boundary terms leave solution space invariant. 
L. Fatibene, M. Francaviglia, S. Mercadante
math-ph gr-qc math.MP