# Lagrangian - How can we differentiate with respect to time if $v$ not a function of time?

In the Lagrangian itself, we know that $$v$$ and $$q$$ don't depend on $$t$$ (i.e - they are not functions of $$t$$ - i.e., $$L(q,v,t)$$ is a state function.)

Imagine $$L = \frac{1}{2}mv^2 - mgq$$

Euler-Lagrange is given by $$\frac{d}{dt}\frac{\partial L}{\partial v} = \frac{\partial L}{\partial q}$$

This yields: $$\frac{d}{dt}(mv) = -mg$$

Now we take time derivative of $$mv$$ which seems would only be possible if $$v$$ was a function of time in the beginning, but we know in $$L$$, $$v$$ is not a function of $$t$$, so how can we take derivative of it with respect to to $$t$$?

• "How can we differentiate with respect to time if v not a function of time?" $v$ is a variable that is evaluated at the time derivative of the classical path: $v = \dot \ell(t)$, where $\ell(t)$ is the classical path. So it is a function of time.
– hft
Commented Sep 2, 2023 at 22:44
• (Or rather, it becomes a function of time when you evaluate it at the classical path)
– hft
Commented Sep 3, 2023 at 1:21

In the Lagrangian itself, we know that $$v$$ and $$q$$ don't depend on $$t$$ (i.e - they are not functions of $$t$$ - i.e $$L(q,v,t)$$ is a state function.)

Imagine $$L = \frac{1}{2}mv^2 - mgq$$

OK.

Euler-Lagrange is given by $$\frac{d}{dt}\frac{\partial L}{\partial v} = \frac{\partial L}{\partial q}$$

Not really--Or at least this is vague, since you do not indicate that the arguments are evaluated at the classical path. This vagueness seems to be the cause of your confusion.

The Euler-Lagrange equation you wrote above is only true for the correct classical path, which I will call $$\ell(t)$$ (to avoid the above-mentioned symbolic confusion). We have to evaluate at $$q = \ell(t)$$ and $$v = \dot \ell(t)$$.

When you derive the Euler Lagrange equation you determine the classical path $$\ell(t)$$ by finding the path $$\ell(t)$$ that minimizes $$S[q] = \int_{t_1}^{t_2} L(q(t),\dot q(t), t)dt\;.$$

In other words: $$S_{min}=S[\ell(t)] = \int_{t_1}^{t_2} L(\ell(t),\dot\ell(t),t)dt$$

It is only this correct classical path that satisfies the equation of motion. So, strictly, you should be writing: $$\frac{d}{dt}\left.\frac{\partial L}{\partial v}\right|_{q=\ell(t), v=\dot \ell(t)} = \left.\frac{\partial L}{\partial q}\right|_{q=\ell(t), v=\dot \ell(t)}\;.$$

The function $$L(a,b,c)$$ has three inputs, and we need to know which input we are taking the partial derivative with respect to. In physics we usually do this by writing the derivative with respect to a symbol that we have agreed represents the correct position such as $$\frac{\partial L}{\partial a}$$ to indicate partial derivative with respect to the first argument.

Suppose you wanted to use some different notation such as $$L^{(i)}$$ to mean the derivative with respect to the ith argument. Then the equation of motion would read: $$\frac{d}{dt}L^{(2)}(\ell(t), \dot \ell(t), t) = L^{(1)}(\ell(t), \dot\ell(t), t)\;,$$ which could further be "simpified" to: $$(L^{(2)})^{(1)}\dot\ell +(L^{(2)})^{(2)}\ddot\ell +(L^{(2)})^{(3)}=L^{(1)}$$

This yields: $$\frac{d}{dt}(mv) = -mg$$

No, strictly speaking, it yields: $$\frac{d}{dt} \left(m \dot \ell(t)\right) = -mg\;,$$ since you need to have evaluated $$v$$ at $$v=\dot \ell(t)$$.

• The programming approach of how we look for the path is we pick $t$, we then randomly pick $x$ at that $t$ and we then randomly pick $v$ at that $t$ as well. We do this over the whole interval and we get a constructed path($x(t)$) and constructed velocity($v(t)$) on that path. Since we randomly picked $x$ and $v$, that means $v(t)$ doesn't match the derivative of $x(t)$. I'm wondering what's the point of picking up random $v$ ? when we pick random $x$ at $t$, we could say $v$ at that $t$ is $\frac{x(t) - x(t-dt)}{dt}$(i.e why do we consider such paths where $v$ doesn't match $\dot x(t)$ ? Commented Sep 4, 2023 at 12:08
• We could only consider those $x(t)$ on which $v(t)$ matches the derivative of $x(t)$ and from those, we pick whichever's action is minimum. See here what I mean - physics.stackexchange.com/a/168555/366606 Commented Sep 4, 2023 at 12:09
• If you randomly pick $x$ at any given $t$ your $x(t)$ will not be the correct physical path. Your original question was about the Lagrangian equations of motion. You now seem to have some new questions about something, but I am not sure exactly what. It would probably be best to write it up as a new question post.
– hft
Commented Sep 4, 2023 at 17:06

The main point is that

1. On one hand, the arguments $$(q,v,t)$$ of the Lagrangian $$(q,v,t)\mapsto L(q,v,t)$$ are independent (so that it e.g. makes sense to talk about partial derivatives of $$L$$).

2. On the other hand, for the solutions$$^1$$ $$t\mapsto q(t)$$ to the Lagrange equations, it is assumed that the position $$q(t)$$ and the velocity $$v(t)=\frac{dq(t)}{dt}\equiv\dot{q}(t)$$ do depend on time $$t$$.

For further details, see e.g. my related Phys.SE answer here.

--

$$^1$$ Notabene: Be aware that in the physics literature the same notation is often used for a function, a value of a function, and the codomain variable.

This problem is solved by writing the Euler Lagrange equation more explicitly like this :

$$\frac{d}{dt} \Bigr (\frac{\partial L(q,v)}{\partial v}\Bigr |_{(q,v)=(q(t), \dot {q}(t))}\Bigr )=\frac{\partial L(q,v)}{\partial q}\Bigr |_{(q,v)=(q(t), \dot{q} (t))}$$

So, after differentiating L, we are evaluating the derivative at $$(q(t), \dot {q} (t))$$. This is where both the LHS and the RHS become a function of time.

Indeed, the Euler-Lagrange equations are two, exactly as the Hamilton equations. Unfortunately, almost always one of the two is not written: $$\dot{q}(t)=\frac{dq}{dt}$$ $$\frac{d}{dt}\frac{\partial L(t,q(t),\dot{q}(t))}{\partial \dot{q}}=\frac{\partial L(t, q(t), \dot{q}(t))}{\partial q}$$ where one is looking for a curve $$t\mapsto (q(t),\dot{q}(t)).$$

The Legendre transformation to prove the equivalence of Lagrangian and Hamiltonian formulations strongly relies upon this viewpoint.

Now we take time derivative of $$mv$$ which seems would only be possible if $$v$$ was a function of time in the beginning, but we know in $$L$$, $$v$$ is not a function of $$t$$...

This isn't actually true. The Lagrangian you provided certainly is independent of time (meaning it has no explicit dependence on $$t$$), but this does not mean that $$v$$ and $$x$$ are independent of time. They are, in fact, both implicitly time-dependent, which also makes the Lagrangian implicitly time-dependent. Hence taking the time derivative of an implicit function of time is quite sensible.

See also the Euler-Lagrange equation on Wikipedia where the whole derivation relies on the implicit time-dependence of $$v$$ and $$r$$. It is also discussed in the Wikipedia article on Lagrangian mechanics. I suspect most textbooks cover this as well, but it's been a while since I've looked at one.

• Yes but I may have misunderstood but it is said that L is a state function in which velocity and position are independent and if they are, they cant depend on t. In action, true that they are dependent on t implicitly but not in L itself without action and euler lagrange is applied to L and not the action. Commented Sep 2, 2023 at 17:31
• Not only that, if v implicitly depends on time in L, then how can you partially differentiate L with v because L is the function of t then. Commented Sep 2, 2023 at 17:34
• The phrase "state function" does not appear in either of the two Wikipedia links on the Lagrangian I provided. The term "lagrangian" also does not appear in the Wikipedia entry on "state function". I think you have been misled on the definition of the Lagrangian and/or state functions. Commented Sep 2, 2023 at 17:35
• @Giorgi You provided $L=\frac{1}{2}mv^2,mgq$. There is no $t$ in the right hand side. Hence, the Lagrangian does not explicitly depend on time, it only implicitly depends on it because the arguments it does have ($q$ and $v$) both have an implicit time dependence. Commented Sep 2, 2023 at 17:39
• chat.stackexchange.com/transcript/message/64304587#64304587 check this and see that they agree with me Commented Sep 2, 2023 at 17:40

Consider a map of the Earth. Latitude and longitude are independent. But then consider a path between, say, Denver and Tokyo. Along that path, latitude is a function of longitude. The map is a tool for finding paths.

Similarly, the Lagrangian is a tool for finding paths through the state space. The velocity and position don't depend on time in the space, but they do along any particular trajectory.