Maupertuis’ principle

If the initial and final coordinates are fixed: