# Jerk mechanics - Lagrangian

I have a Lagrangian with the form

$$L = L[q(t,\alpha), \dot{q}(t,\alpha), \ddot{q}(t,\alpha), t],$$

to which I am applying the calculus of variations. The problem is that when I apply the calculus, I obtain the Euler-Lagrange equation

$$-\frac{d^2}{dt^2}\frac{\partial L}{\partial \ddot{q_i}} -\frac{d}{dt}\frac{\partial L}{\partial \dot{q_i}}+\frac{\partial L}{\partial q_i} = 0$$

where the variation is shown as $$q(t, \alpha) = q(t, 0) + \alpha \eta(t)$$ instead of

$$\frac{d^2}{dt^2}\frac{\partial L}{\partial \ddot{q_i}} -\frac{d}{dt}\frac{\partial L}{\partial \dot{q_i}}+\frac{\partial L}{\partial q_i} = 0.$$

My guess is that I am doing the following calculation wrong.

$$\frac{\partial L}{\partial \ddot{q_i}}\frac{\partial \ddot{q_i}}{\partial \alpha}=\frac{\partial L}{\partial \ddot{q_i}}\frac{\partial^2}{\partial t^2}(\frac{\partial q_i}{\partial \alpha}) = \frac{d^2}{dt^2}[\frac{\partial L}{\partial \ddot{q_i}}\frac{\partial q_i}{\partial \alpha}] - \frac{d^2}{dt^2}[\frac{\partial L}{\partial \ddot{q_i}}]\frac{\partial q_i}{\partial \alpha}.$$

Is the above expansion correct? It will be cumbersome to write the entire derivation here.

• You were a little too fast in your last line. It looks like you treated the second derivative, $\frac{d^2}{dt^2}$, as if it was a first derivative. So you assumed the product rule $\frac{d}{dt}(fg)=f'g+g'f$ applies for second derivatives in the sense $\frac{d^2}{dt^2}(fg)=f''g+g''f$. This is not a correct assumption. Try going more slowly, to calculate $\frac{d^2}{dt^2}(fg)$ first calculate the first derivative $\frac{d}{dt}(ft)$ and then apply $\frac{d}{dt}$ to the result. Commented Mar 13, 2021 at 15:52
• I ll look into it thanks Commented Mar 13, 2021 at 18:41
• @Andrew I am still stuck. If I type an answer can you help me ? Commented Mar 13, 2021 at 19:09
• @Layla I can try to help if you type up more details on the derivation. For instance, it would be helpful for me and others to see how you obtained the first Euler-Lagrange equation. to begin with. Commented Mar 13, 2021 at 21:41

1. We start with the product rule: $$$$\frac{\partial}{\partial t}\left[f g\right] = \frac{\partial f}{\partial t}g + \frac{\partial g}{\partial t}f$$$$ For reasons we will come to later, we want to put this equation in a form so that the left hand side involves no derivatives on $$f$$, and the right hand side contains only (a) total derivatives or (b) terms without any derivatives on $$g$$. This can done by simply rearranging the terms $$$$\boxed{ f\frac{\partial g}{\partial t} = \frac{\partial}{\partial t}\left[f g\right] - \frac{\partial f}{\partial t}g }$$$$ This form will be useful later.

2. We can differentiate the product rule to arrive at the analog of the product rule for second derivatives $$\begin{eqnarray} \frac{\partial^2}{\partial t^2}\left[f g\right] &=& \frac{\partial}{\partial t}\left[ \frac{\partial f}{\partial t}g + \frac{\partial g}{\partial t} \right] \\ &=& \frac{\partial^2 f}{\partial t^2}g + 2 \frac{\partial f}{\partial t} \frac{\partial g}{\partial t} + f \frac{\partial ^2 g}{\partial t^2} \end{eqnarray}$$ Like before, we want to massage this expression into a form where the left hand side has no derivatives on $$f$$, and the right hand side is only total derivatives or terms with no derivatives on $$g$$. As a starting point, we rearrange things as above so the left hand side has no derivatives on $$f$$ $$$$f \frac{\partial^2 g}{\partial t^2} = \frac{\partial^2}{\partial t^2}[fg] - 2\frac{\partial f}{\partial t}\frac{\partial g}{\partial t} - \frac{\partial^2 f}{\partial t^2}g$$$$ We don't like the term $$\frac{\partial f}{\partial t}\frac{\partial g}{\partial t}$$. It is not a total derivative, and involves a derivative of $$f$$. We can fix this by using the boxed equation from point 1 $$$$\frac{\partial f}{\partial t}\frac{\partial g}{\partial t} = \frac{\partial}{\partial t}\left[g\frac{\partial f}{\partial t}\right] - \frac{\partial^2 f}{\partial t^2} g$$$$ Using this we get the form we want $$$$\boxed{ f \frac{\partial^2 g}{\partial t^2} = \frac{\partial}{\partial t}\left\{ \frac{\partial}{\partial t}[fg] - 2 g\frac{\partial f}{\partial t} \right\} + \frac{\partial^2 f}{\partial t^2}g }$$$$ As it turns out, the precise form of the total derivative term in curly braces won't matter for us, but I have left it for completeness.

Now let's see how to use the first identity (the product rule) to derive the Euler Lagrange equation for a Lagrangian that depends on $$\dot{x}$$, ie $$L=L(\dot{q})$$. We can write the variation as $$$$\frac{\partial L}{\partial \alpha} = \frac{\partial L}{\partial \dot{q}}\frac{\partial \dot q}{\partial \alpha} = \frac{\partial L}{\partial \dot{q}} \frac{\partial}{\partial t} \frac{\partial q}{\partial \alpha}$$$$ Now we identify $$f=\frac{\partial L}{\partial \dot{q}}$$ and $$g=\frac{\partial q}{\partial \alpha}$$. Then using the boxed equation from point 1, we arrive at $$$$\frac{\partial L}{\partial \alpha} = \frac{\partial L}{\partial \dot{q}} \frac{\partial}{\partial t} \frac{\partial q}{\partial \alpha} = \frac{\partial}{\partial t}\left[\frac{\partial L}{\partial \dot{q}} \frac{\partial q}{\partial \alpha} \right] - \left(\frac{\partial }{\partial t}\frac{\partial L}{\partial \dot{q}}\right) \frac{\partial q}{\partial \alpha}$$$$ By the normal logic in the calculus of variations, we can throw away the total derivative term (assuming we fix the endpoints of the path), and the part multiplying the variation $$\frac{\partial q}{\partial \alpha}$$ must vanish. Thus the Euler-Lagrange equation is $$$$-\frac{\partial }{\partial t}\frac{\partial L}{\partial \dot{q}} = 0$$$$ The minus sign isn't very meaningful here but I've left it in so we can compare with the second derivative term.

Finally we have the pieces to solve your problem. The variation of a Lagrangian $$L=L(\ddot{q})$$ has the form $$$$\frac{\partial L}{\partial \alpha} = \frac{\partial L}{\partial \ddot{q}} \frac{\partial^2}{\partial t^2} \frac{\partial q}{\partial \alpha}$$$$ We identify $$f= \frac{\partial L}{\partial \ddot q}$$ and $$g=\frac{\partial q}{\partial \alpha}$$. Then using the boxed identify in point 2, we arrive at $$$$\frac{\partial L}{\partial \alpha} = \frac{\partial }{\partial t}\left\{\cdots\right\} + \left( \frac{\partial^2}{\partial t^2}\frac{\partial L}{\partial \ddot q}\right) \frac{\partial q}{\partial \alpha}$$$$ where I haven't filled in the total derivative term because it is irrelevant. Following the same calculus-of-variations logic, we find that the Euler-Lagrange equation has the form $$$$\frac{\partial^2}{\partial t^2}\frac{\partial L}{\partial \ddot q} = 0$$$$ Note that there is no minus sign here, unlike for the first derivative term. This answers your question by showing where the relative minus sign comes from.

The above gives a careful derivation. It's also useful to learn the quick way to do this. If we can ignore total derivatives, then integration by parts amounts to the rule $$$$f\frac{\partial g}{\partial t} = - \frac{\partial f}{\partial t} g \ \ ({\rm up\ to\ total\ derivative\ terms})$$$$ Then for second derivatives, we get $$$$f\frac{\partial^2 g}{\partial t^2} = - \frac{\partial f}{\partial t} \frac{\partial g}{\partial t} = \frac{\partial^2 f}{\partial t^2}g \ \ ({\rm up\ to\ total\ derivative\ terms})$$$$ Using those "identities" you can get to the Euler Lagrange equation in a faster way, so long as you are sure the boundary terms (total derivative terms) don't matter. It's also very easy to generalize this to $$n$$-th derivatives (although that doesn't come up very often!)

The action is a functional of the function $$q(t)$$, and is defined as

$$S\big[q(t)\big]=\int_{t_0}^{t_1}dt\,L\Big(q(t),\dot{q}(t),\ddot{q}(t)\Big).$$

Let the functional derivative be

$$\frac{\delta S\big[q(t)\big]}{\delta q(t)}=\lim_{\alpha\to0}\frac{S\big[q(t)+\alpha\eta(t)\big]-S\big[q(t)\big]}{\alpha}.$$

We want the action to be stationary under small variations of $$q(t)$$, i.e. $$\frac{\delta S[q(t)]}{\delta q(t)}=0$$, and since the Lagrangian also depends on the second derivative of $$q$$, we need both $$\eta(t)$$ and its first derivative to vanish at $$t_0$$ and $$t_1$$. Then we have

$$0=\frac{\delta S\big[q(t)\big]}{\delta q(t)}=\lim_{\alpha\to0}\frac{S\big[q(t)+\alpha\eta(t)\big]-S\big[q(t)\big]}{\alpha}=\\=\lim_{\alpha\to0}\frac 1\alpha\Bigg(\int_{t_0}^{t_1}dt\,L\Big(q(t)+\alpha\eta(t),\dot{q}(t)+\alpha\dot{\eta}(t),\ddot{q}(t)+\alpha\ddot\eta(t)\Big)-\int_{t_0}^{t_1}dt\,L\Big(q(t),\dot{q}(t),\ddot{q}(t)\Big)\Bigg)=$$

since the variation $$\alpha\eta(t)$$ is small, a Taylor expansion can be performed

$$=\lim_{\alpha\to0}\frac 1\alpha\Bigg(\int_{t_0}^{t_1}dt\,L\Big(q(t),\dot{q}(t),\ddot{q}(t)\Big)+\alpha\int_{t_0}^{t_1}dt\,\Big(\eta(t)\frac{\partial L}{\partial q}+\dot{\eta}(t)\frac{\partial L}{\partial \dot{q}}+\ddot{\eta}(t)\frac{\partial L}{\partial \ddot{q}}\Big)+\\-\int_{t_0}^{t_1}dt\,L\Big(q(t),\dot{q}(t),\ddot{q}(t)\Big)\Bigg)=\int_{t_0}^{t_1}dt\,\Big(\eta(t)\frac{\partial L}{\partial q}+\dot{\eta}(t)\frac{\partial L}{\partial \dot{q}}+\ddot{\eta}(t)\frac{\partial L}{\partial \ddot{q}}\Big)$$

The second term is

$$\frac{d\eta(t)}{dt}\frac{\partial L}{\partial \dot{q}}=\frac{d}{dt}\Bigg(\eta(t)\frac{\partial L}{\partial \dot{q}}\Bigg)-\eta(t)\frac{d}{dt}\Bigg(\frac{\partial L}{\partial \dot{q}}\Bigg),$$

but the integral of the first summand is $$0$$ since $$\eta(t_0)=\eta(t_1)=0$$.

The third term is

$$\frac{d^2\eta(t)}{dt^2}\frac{\partial L}{\partial \ddot{q}}=\frac{d}{dt}\Bigg(\frac{d\eta(t)}{dt}\frac{\partial L}{\partial \ddot{q}}\Bigg)-\frac{d\eta(t)}{dt}\frac{d}{dt}\Bigg(\frac{\partial L}{\partial \ddot{q}}\Bigg)=\frac{d}{dt}\Bigg(\frac{d\eta(t)}{dt}\frac{\partial L}{\partial \ddot{q}}\Bigg)-\frac{d}{dt}\Bigg(\eta(t)\frac{d}{dt}\bigg(\frac{\partial L}{\partial \ddot{q}}\bigg)\Bigg)+\eta(t)\frac{d^2}{dt^2}\Bigg(\frac{\partial L}{\partial \ddot{q}}\Bigg),$$

but the integral of the first two terms is $$0$$ since $$\eta(t)$$ and its derivative must vanish at $$t_0$$ and $$t_1$$.

With these considerations, we have that

$$0=\int_{t_0}^{t_1}dt\,\eta(t)\Bigg[\frac{\partial L}{\partial q}-\frac{d}{dt}\Bigg(\frac{\partial L}{\partial \dot{q}}\Bigg)+\frac{d^2}{dt^2}\Bigg(\frac{\partial L}{\partial \ddot{q}}\Bigg)\Bigg]$$

must be satisfied for any $$\eta(t)$$, so the Euler-Lagrange equation is

$$\frac{\partial L}{\partial q}-\frac{d}{dt}\Bigg(\frac{\partial L}{\partial \dot{q}}\Bigg)+\frac{d^2}{dt^2}\Bigg(\frac{\partial L}{\partial \ddot{q}}\Bigg)=0$$

• You and also @Andrew 's answers were great just I had to pick someone.. Commented Mar 14, 2021 at 6:20