  Using purely Hamiltonian methods we derive a simple differential equation for
the generator of the most general local symmetry transformation of a
Lagrangian. The restrictions on the gauge parameters found by earlier
approaches are easily reproduced from this equation. We also discuss the
connection with the purely Lagrangian approach. The general considerations are
applied to the Yang-Mills theory.
