Constrained motion

Consider a system with coordinates qiq_i. Say we want to constrain its motion such that some scalar function f(qi)=0f(q_i) = 0. For example, we could constrain two coordinates to be equal by setting f(qi)=q1q2f(q_i) = q_1 - q_2.

For uncontrained motion, we have used the Euler-Lagrange equation to find the path through space that minimizes the action, i.e. the integral of the Lagrangian. We considered all possible paths with some given start and end points.

Now we want to constrain our search to only paths that satisfy this constraint equation. We will use Lagrange multipliers to do this. We set the gradient of the Lagrangian parallel to the weighted sum of the gradients of the constraint equations.

L(t)=kλk(t)f(k). \begin{align*} \vec\nabla L(t) = -\sum_k \lambda_k(t) \cdot \vec\nabla f(k). \end{align*}

We then define a function Lλ(qi,q˙i,t,λk)L_\lambda(q_i,\dot q_i,t,\lambda_k) such that optimizing it is equivalent to the above.

Lλ(qi,q˙i,t,λk)=L(qi,q˙i,t)+kλk(t)f(k). \begin{align*} L_\lambda(q_i,\dot q_i,t,\lambda_k) = L(q_i,\dot q_i,t) + \sum_k \lambda_k(t) \cdot \vec\nabla f(k). \end{align*}

We then consider variations to the action

δS=[i(Lqi ⁣d ⁣dtLq˙i)δqi+k(iλkfLqiδqi+fkδλk)] ⁣dt=[i(Lqi ⁣d ⁣dtLq˙i+kλkfqi)δqi+kfkδλk]=0. \begin{align*} \delta S &= \int \left[\sum_i \left(\frac{\partial L}{\partial q_i} - \frac{\d}{\dt} \frac{\partial L}{\partial\dot q_i} \right) \delta q_i + \sum_k \left(\sum_i \lambda_k \frac{\partial fL}{\partial q_i} \delta q_i + f_k \delta \lambda_k \right)\right] \dt \\ &= \int \left[\sum_i \left( \frac{\partial L}{\partial q_i} - \frac{\d}{\dt} \frac{\partial L}{\partial \dot q_i} + \sum_k \lambda_k \frac{\partial f}{\partial q_i} \right) \delta q_i + \sum_k f_k \delta \lambda_k \right] = 0. \end{align*}

For the above to hold for all Lagrange multipliers λk\lambda_k and all variations δqi\delta q_i, the following must be true:

fk(qi,t)=0Lqi ⁣d ⁣dtLq˙i=kλkfqi. \begin{align*} f_k(q_i,t) &= 0 \\ \frac{\partial L}{\partial q_i} - \frac{\d}{\dt} \frac{\partial L}{\partial\dot q_i} &= -\sum_k \lambda_k \frac{\partial f}{\partial q_i}. \end{align*}

Here we applied the Euler-Lagrange equation to the left term in the integral as we would normally. We see that the right-hand side of the resulting equation has extra terms that describe the constraint forces.