For a mechanical system with n degrees of freedom in which conservative forces act and all constraints are holonomic, the Lagrangian is L = T−V, where T denotes kinetic energy and V denotes potential energy. For a light pendulum of length l with a mass m at the end and making an angle θ with the downward vertical,
For such a system, defined by generalized coordinates q1, q2, …, qn, Lagrange’s equations state that
In the example of the pendulum, this gives
See also Hamiltonian mechanics.