As I've already said, I have a problem in understanding a reasoning from which we derive the Hamilton–Jacobi equation from a variational principle. Let's take the Hamilton functional:
$$ S = \int_{t_0}^{t_1} [ p_{\alpha}\dot{q}^{\alpha} - H(q^{\alpha},p_{\alpha},t) ]\, dt $$
The first variation on the phase space of this functional is, in the most general form:
$$ (\delta S)_{\bar{\gamma}} = [p_\alpha \delta q^{\alpha} - H \delta t]_{t_0}^{t_1} + \int_{t_0}^{t_1} \left\{ \left[ \dot{q}^{\alpha} - \frac{\partial H}{\partial p_\alpha} \right]_{\bar{\gamma}}\pi_\alpha - \left[ \dot{p}_{\alpha} + \frac{\partial H}{\partial q^\alpha} \right]_{\bar{\gamma}}\eta_\alpha \right\}\, dt $$
Where the variation of the functional S is evaluated on the deformation of the curve ${\bar{\gamma}} \to \gamma$ in the phase space:
$$ \bar{\gamma}: \begin{cases} q^{\alpha} = \overline{q}^{\alpha}(t) \\ p_{\alpha} = \overline{p}_{\alpha}(t) \\ A = \{ \overline{q}^{\alpha}(t_0);\overline{p}_{\alpha}(t_0) \} \\ B = \{ \overline{q}^{\alpha}(t_1);\overline{p}_{\alpha}(t_1) \} \\ \end{cases} \qquad t \in [t_0,t_1] $$ $$ \gamma: \begin{cases} q^{\alpha} = \overline{q}^{\alpha}(t) + \lambda\eta_{\alpha}(t) \\ p_{\alpha} = \overline{p}_{\alpha}(t) + \lambda\pi_{\alpha}(t)\\ A' = \{ \overline{q}^{\alpha}(t_0 + \lambda \delta t_0) + \lambda \eta_{\alpha}(t_0 + \lambda \delta t_0) ; \overline{p}_{\alpha}(t_0 + \lambda \delta t_0) + \lambda \pi_{\alpha}(t_0 + \lambda \delta t_0) \} \\ B' = \{ \overline{q}^{\alpha}(t_1 + \lambda \delta t_1)+\lambda \eta_{\alpha}(t_1 + \lambda \delta t_1); \overline{p}_{\alpha}(t_1 + \lambda \delta t_1) + \lambda \pi_{\alpha}(t_1 + \lambda \delta t_1) \} \\ \end{cases} \qquad t \in [t_0 +\lambda \delta t_0,t_1 +\lambda \delta t_1] $$
Where $\eta_{\alpha}$ and $\pi_{\alpha}$ are regular function. Now, in my notes we choose $\bar{\gamma}$ e we let $A=A'$, so that we have an initial fixed point. Then we say that on the curve chosen, are satisfied the Hamilton equation, so that the variation of S becomes only:
$$ (\delta S)_{\bar{\gamma}} = [p_\alpha \delta q^{\alpha} - H \delta t]_{t_0}^{t_1} $$
[First question Is this legit? If the Hamilton equation are derived from the same variational principle, can we say ``a priori'' that them are valid on a particular path on the phase space? ]
Then we consider the point B movable, so that it depends from time. In this way, S isn't a functional anymore, but instead is a function of time. So the variation can be interpreted as a differential:
$$ dS= p_\alpha d q^{\alpha} - H d t $$
[Second question I wish to have a mathematical proof for that, because for me isn't trivial as it sounds.]
Then we can prove that S is function of $S(q^{\alpha}(t), t ,q^{\alpha}(t_0), t_0 )$, so that: $$ dS = \frac{\partial S}{\partial q^{\alpha}}d q^{\alpha} +\frac{\partial S}{\partial t} dt $$
Equating the two results, we obtain:
$$ \frac{\partial S}{\partial t} + H \left( q^{\alpha} , \frac{\partial S}{\partial q^{\alpha}}, t \right) = 0 $$
Which is the Hamilton-Jacobi equation.
Third question Is this reasoning formally correct ? It doesn't feel quite right to me. And also, more importantly, do you know any book that treats the argument in this way, or similar, that is more rigorous?