How to determine the Lagrangian's "true" explicit dependence on time?

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.

References:

  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.