  Recently, a new family of integrators (Hamiltonian Boundary ValueMethods) has
been introduced, which is able to precisely conserve the energy function of
polynomial Hamiltonian systems and to provide a practical conservation of the
energy in the non-polynomial case. We settle the definition and the theory of
such methods in a more general framework. Our aim is on the one hand to give
account of their good behavior when applied to general Hamiltonian systems and,
on the other hand, to find out what are the optimal formulae, in relation to
the choice of the polynomial basis and of the distribution of the nodes. Such
analysis is based upon the notion of extended collocation conditions and the
definition of discrete line integral, and is carried out by looking at the
limit of such family of methods as the number of the so called silent stages
tends to infinity.
