# Lagrangian Dynamics

**Lagrangian dynamics** are an alternative to Newtonian mechanics. Lagrangian dynamics are particularly useful in solving for the equations of a motion of a system operating under constraints. Often it is possible, using Lagrangian dynamics, to solve for the equations of motion for a system without needing to solve for the constraint forces, which is why they are often preferred over Newtonian mechanics for these types of problems. It is important to note that both methods will yield the same end result, the only thing that changes is the method of arriving at the end result.

One form of the Lagrangian equation is as follows:

<math>\frac{\partial}{\partial t}({\partial L }/ {\partial \dot q}) - {\partial L} /{\partial q} = Q </math>

Where: L, the Lagrangian function, is defined as L = T - V, where T is the total kinetic energy of the system and V is the total potential energy of the system, q is the generalized coordinate, and Q is the generalized force. <math>{\partial L }/ {\partial \dot q}</math> is known as the generalized momentum.

### Example

Consider a mass m attached a spring with spring constant k. The system has a single degree of freedom: x, the displacement of the mass from its equilibrium position. Then,

<math>T=\frac{1}{2}m\dot x^2</math>

<math>V=\frac{1}{2}kx^2</math>

Thus,

<math> {\partial L }/ {\partial \dot x} = m\dot x </math>

<math> {\partial L}/{\partial x} = -kx </math>

(Note that the generalized momentum is the same as the "normal" Newtonian momentum of mass times velocity in this problem.) <math>Q=0</math> for this simple problem, and so the equation of motion is

<math> m\ddot x = -kx </math>

which is the same as the result one arrives at by just considering the forces acting on the mass in Newtonian mechanics.