If your Lagrangian satisfies

$$ \frac{\partial \mathcal L}{\partial t} = 0 $$

then you're happy, energy is conserved, etc. However, if the above doesn't hold, that doesn't necessarily mean energy isn't conserved; maybe your Lagrangian has a false explicit time dependency. For example:

$$ \mathcal L = \frac{m}{2}\dot x^2+kt\dot x $$

The above Lagrangian has $\partial \mathcal L/\partial t = k\dot x $ but I call that dependency fake (or as the experts like to say, "spurious") because it has the same equations of motion as this other Lagrangian:

$$ \mathcal L = \frac{m}{2}\dot x^2-kx $$

which has no explicit time dependency whatsoever, so energy is conserved. Specifically, this happened because you can shift derivatives around in your Lagrangian using integration by parts at the level of the action.

Similarly, the following Lagrangian

$$ \mathcal L = \frac{m}{2}\dot x^2+gt $$

also has a fake explicit time dependency, since you can remove $gt$ which is just a total time derivative, equivalent to a boundary term in the action.

On the other hand, the Lagrangian with variable mass

$$ \mathcal L = \frac{m(t)}{2}\dot x^2 $$

is bonafide explicit time-dependent. There's no trick here to avoid it; $\partial \mathcal L/\partial t \ne 0$ no matter what legal modifications you perform.

Finally, the following Lagrangian has a mixture of real and false explicit time-dependencies:

$$ \mathcal L = \frac{m(t)}{2}\dot x^2 -kx +gt $$

Its true explicit time dependency would be defined as $\partial \mathcal L/\partial t$ after all integration by parts that could be performed have been done so and all total derivatives have been removed. Therefore, the question is:

Given a generic Lagrangian, can its true explicit time dependency be determined in general?

  • 1
    $\begingroup$ Comment to the post (v2): Are we allowed to make time-reparametrizations, i.e. to reparametrize time $t^{\prime}=f(t)$? If yes, then the time-varying mass $m(t)$ could also be fake. $\endgroup$
    – Qmechanic
    Oct 21, 2016 at 16:25
  • $\begingroup$ @Qmechanic Time is absolute in the examples I gave, so I wouldn't say you have the right to reparametrize it. $\endgroup$
    – Donjon
    Oct 25, 2016 at 15:31

2 Answers 2


The third Lagrangian differs from the standard free Lagrangian just by a total derivative so that it produces the same equation of motion. This leads you to the answer.

You can ignore explicit temporal dependencies if they are due to an addend $\Delta L$ to $L$ which is a formal total derivative: $$\Delta L = \frac{\partial g}{\partial t} +\sum_{k=1}^n \frac{\partial g}{\partial q^k} \dot{q}^k$$ where $g= g(t,q)$.

So, if $\frac{\partial L}{\partial t} \neq 0$, but $\frac{\partial L - \Delta L}{\partial t} = 0$ for $\Delta L$ as above, you can ignore this dependence on time. More strongly you can re-define $L' = L -\Delta L$ which produces the same equations of motion and $\frac{\partial L'}{\partial t} = 0$.

This is the case also concerning the first couple of Lagrangians as their difference is a total derivative: $$\frac{d }{dt}ktx\:.$$ Alternatively, and this is equivalent, you can neglect the time dependence on time if the partial derivative of the Lagrangian is a total derivative. This follows from the argument above if noticing that the total derivative operator and the partial derivative operator commute on functions of $q $ and $t $.

  1. OP seems to ponder how to reliably check whether a term $\Delta L$ in the Lagrangian $$ \tilde{L}(q,\dot{q},t)~=~ L(q,\dot{q},t)+ \Delta L(q,\dot{q},t) \tag{1}$$ is (perhaps secretly?) a total-derivative term or not? (Say, in complicated situations with many degrees of freedom.) Well, a fool-proof test (that doesn't rely on clever rewritings) is the following: The term $\Delta L$ is a total derivative if$^{~1}$ and only if the Euler-Lagrange (EL) operator annihilates $\Delta L$ identically$^2$ $$ \frac{\partial \Delta L}{\partial q^j} -\frac{\mathrm d}{\mathrm dt} \frac{\partial \Delta L}{\partial \dot{q}^j}~=~0. \tag{2}$$ This strategy was e.g. used in my Phys.SE answer here. See also this related Phys.SE post.

  2. It is true the Euler-Lagrange (EL) equations do not change when we change the Lagrangian with a total time derivative $$ \tilde{L}~=~ L+ \frac{\mathrm dF}{\mathrm dt}, \tag{3}$$ cf. e.g. this and this Phys.SE posts. However, we stress that the pertinent boundary conditions (BCs) of the variational problem might get affected by the change (3), cf. e.g. this and this Phys.SE posts.


  1. G. Barnich, F. Brandt and M. Henneaux, Local BRST cohomology in gauge theories, Phys. Rep. 338 (2000) 439, arXiv:hep-th/0002245.


$^1$ The "if"-part assumes that the configuration space is contractible, cf. an algebraic Poincare lemma of the so-called bi-variational complex, see e.g. Ref. 1. For non-contractible configuration spaces there could in principle be topological obstructions.

$^2$ This statement can be generalized/modified to accommodate local field theories with higher-order derivatives.

  • $\begingroup$ +1 against my own answer! Regarding your 2nd comment: I think that boundary conditions matter only if $F$ includes $\dot{q}$. I have excluded this fact in my answer. This is because it is difficult to interpret things like $\ddot{q}$ in the geometrical setting of standard Lagrangian mechanics where the relevant space is a jet-bundle of order $1$. $\endgroup$ Oct 26, 2016 at 13:33
  • $\begingroup$ Also the condition $ \frac{\partial \Delta L}{\partial q^j} -\frac{\mathrm d}{\mathrm dt} \frac{\partial \Delta L}{\partial \dot{q}^j}~=~0$ is difficult to rigorously understand for me, since performing computations when $\Delta L$ is function of $t,q$ AND $\dot{q}$, I face a term of the form $d\dot{q}/dt $ which, "off shell", has no meaning since the only variables I am supposing to be independent off shell are $q$ and $\dot{q}$. It is clear that your statement is morally true ($q$-in simply connected regions) as it follows by direct inspection... $\endgroup$ Oct 26, 2016 at 14:06
  • $\begingroup$ However to state it into a rigorous form I should use a space where $\ddot{q}$ has an off-shell meaning and this is not the standard space of classical analytical mechanics which is $J^1(V^{n+1})$, where $V^{n+1}$ is the spacetime of configurations (a fiber bundle with basis given by the temporal axis $\mathbb R^2$ and fibers given by the $n$-dimensional configuration spaces $Q^n_t$ at fixed time.) $\endgroup$ Oct 26, 2016 at 14:10
  • $\begingroup$ I prefer $J^1(V^{n+1})$ in place of $TQ \times \mathbb R$ because the second version (the most common) of the spacetime of kinetic states uses a decomposition which is not natural. If it were, conditions like $\partial_t L =0$ would be universal (independent from any possible coordinate system over the spacetime of kinetic states) and they are not. $\endgroup$ Oct 26, 2016 at 14:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.