Derivation of First-Order Difference Equations for Dynamical Systems by Direct Application of Hamilton’s Principle