Hamilton's equation of motion from variational principle

Hamilton's principle is stated as:

Equation 1 is sometimes referred as the modified Hamilton's principle. This principle leads Hamilton's cannonical equations of motion as shown below

Labelling each of the possible path in configuration space with a parameter α, the delta variation can be expressed as

δI = 0

Since end points time are same for every path, limits are independent of α and hence ∂/∂α can be written inside the integral. i.e,

Since pj and qj are independent variables their variation pj and δqj will also be independent of each other. So above integral can vanish only if the coefficients separately vanish i.e.,

which are the desired cannonical equations of motion.

This note is taken from Classical mechanics, MSC physics, Nepal.