For independent generalized coordinates , their generalized velocities and a Lagrangian , the Euler-Lagrange equations are
Here the partial derivatives treat as independent arguments, whereas follows the motion. For a conservative mechanical system, choose coordinates satisfying the mechanical constraints, express the kinetic energy and potential energy in those coordinates, set , and evaluate these equations to obtain the equations of motion. If nonconservative generalized forces are present, they appear on the right-hand side.
A cyclic coordinate is absent explicitly from : , even though may depend on . Its canonical momentum is consequently conserved,
This does not require or even that be constant; the relation between canonical momentum and generalized velocity depends on the Lagrangian.
For ordinary conservative classical mechanics, the Lagrangian is , where is the kinetic energy and the potential energy. More generally it is the function whose action satisfies the principle of stationary action. The canonical momenta and Hamiltonian are
For a regular Lagrangian, the first equations can be inverted to express the generalized velocities in terms of ; this defines the Legendre transform on phase space.
Along a solution of the Euler-Lagrange equations, . Taking a total time derivative gives
Thus an autonomous Lagrangian has
For the usual time-independent mechanical coordinates and a velocity-independent potential energy, the kinetic energy is quadratic in the generalized velocities, so and . The conservation proof itself uses the Euler-Lagrange equations, rather than assuming this special expression for energy.