Hamilton's principal of least action