Hamiltons principle can be used to derive Lagrange's equations IF our coordinates are independent. Thus you pretty much show that for independent coordinates Hamiltons principle is equivalent to Newtons laws. However, it seems that my book also likes to think that Hamiltons principle must still be satisfied even when our coordinates are not independent - this is crucial for the introduction of lagrangian multipliers in mechanical problems, but I don't see why the statement is true. Surely we can't derive Lagranges equation now. So where does this knowledge come from?