# Question about explicit dependencies of the Lagrangian

When considering whether or not the total energy of a system varies over time, we consider the time dependence of the Lagrangian, namely by looking at $$\frac{\partial L}{\partial t} \, .$$

Why is it that we only consider explicit time dependence in this case, and not the dependence of each variable within the Lagrangian? My notes on this topic are fairly vague and I just wondered if there was a simple reason.

Short answer: it can be shown that the Hamiltonian satisfies $$\frac{dH}{dt}=\frac{\partial H}{\partial t}=-\frac{\partial L}{\partial t}.$$Long answer: since $H=\dot{\mathbf{q}}\cdot\mathbf{p}-L$ we have $\partial_t H=-\partial_t L$, and by Hamilton's equations $$\frac{dH}{dt}-\frac{\partial H}{\partial t}=\frac{dH}{d\mathbf{q}}\cdot\dot{\mathbf{q}}+\frac{dH}{d\mathbf{p}}\cdot\dot{\mathbf{p}}=\frac{dH}{d\mathbf{q}}\cdot\frac{dH}{d\mathbf{p}}-\frac{dH}{d\mathbf{p}}\cdot\frac{dH}{d\mathbf{q}}=0.$$