I'm trying to derive the HJ the easiest way I can but some issues come up.
$$\mathrm{dS}=\dfrac{\partial S}{\partial q}\mathrm{d}q+\dfrac{\partial S}{\partial t}\mathrm{d}t\Rightarrow\displaystyle{S=\int \mathrm{d}S=\int\dfrac{\partial S}{\partial q}\mathrm{d}q+\int\dfrac{\partial S}{\partial t}\mathrm{d}t}.\tag{1}$$
We also know that: $$S=\displaystyle{\int p\dfrac{\mathrm{d}q}{\mathrm{d}t}\mathrm{d}t-\int H \mathrm{d}t=\int p{d}q-\int H \mathrm{d}t}.\tag{2}$$
By identification: $$p=\dfrac{\partial S}{\partial q}\quad\text{and }\quad\dfrac{\partial S}{\partial t}=-H.\tag{3}$$ These two equations give he HJ equation.
But I'm not comfortable with this derivation.
I feel like I'm playing with the physical quantities but not in a "rigorous way" especially after reading this answer: Hamilton-Jacobi Equation. Is there a problem with that?
I don't see anywhere in this derivation where we assumed that the equations of motion were holding. I.e: we didn't impose $\delta S=0$ or $\frac{\partial L}{\partial q}=\frac{\mathrm{d}}{\mathrm{d}t}\frac{\partial L}{\partial \dot{q}}$ for example (while in the others derivation I saw (at least the ones which were not involving canonical transformations) the Euler-Lagrange equation was used). Isn't it a problem?