Using purely Hamiltonian methods we derive a simple differential equation f
or the generator of the most general local symmetry transformation of a Lag
rangian. The restrictions on the gauge parameters found by earlier approach
es are easily reproduced from this equation. We also discuss the connection
with the purely Lagrangian approach. The general considerations are applie
d to the Yang-Mills theory. (C) 2000 Published by Elsevier Science B.V. All
rights reserved.