# Meaning of $d\mathcal{L}=-H$ in analytical mechanics?

In Lagrangian mechanics the momentum is defined as:

$$p=\frac{\partial \mathcal{L}}{\partial \dot q}$$

Also we can define it as:

$$p=\frac{\partial S}{\partial q}$$

where $$S$$ is Hamilton's principal function. From that we have:

$$\frac{\partial \mathcal{L}}{\partial \dot q}=\frac{\partial S}{\partial q}$$ $$\frac{\partial \mathcal{L}dt}{\partial q}=\frac{\partial S}{\partial q}$$

$$d\mathcal{L}=\frac{\partial S}{\partial t}$$

But the Hamilton-Jacobi PDE is

$$\frac{\partial S}{\partial t}=-H$$

so we get:

$$d\mathcal{L}=-H$$

Thus we get that the change of the Lagrangian is equal to the negative Hamiltonian. Does that have any physical meaning? Or is it just gibberish and I am not allowed to make such algebraic manipulations?

I think it is gibberish in your own words. $$\frac{\partial}{\partial \dot{q}}$$ cannot be replaced by $$dt \frac{\partial}{\partial {q}}$$ even in the most cavalier approach because $$\dot{q} = \frac{dq}{dt}$$, not $$\frac{q}{dt}$$.
Apart from the fact that I am really skeptical about its mathematical validity, your replacement $$\frac{\partial}{\partial\dot{q}}\rightarrow\frac{dt}{\partial q}$$ makes little sense in the context of the Lagrangian formalism since position $$q$$ and velocity $$\dot{q}$$ are treated as entirely independent variables. What does have physical meaning is expressing the Hamiltonian as the Legendre transform of the Lagrangian.