Let the action functional $S[q]$ given by \begin{equation}\label{eq16} S[q]=\int\limits^{t_2}_{t_1}L\left(q^i(t),\dot{q}^i(t)\right)dt.\tag{1} \end{equation} Also, we know that using Legendre Transform the hamiltonian $H(q^i,p_i)$ is related with $L(q^i,\dot{q}^i)$ by \begin{equation} L(q^i,\dot{q}^i)=p_i q^i - H(q^i,p_i) \quad \text{with} \quad p_i=\frac{\partial L}{\partial \dot{q}^i}\tag{2} \end{equation} Thus, replacing this last equation inside the action function we have \begin{align}\label{eq105} S(q,t)&=\int\limits^t_{t_0}p_i(t)\dot{q}^i(t)dt-\int\limits^t_{t_0}H(q^i(t),p_i(t))dt\tag{3}\\ S(q,t)&=\int\limits^{q(t)}_{q(t_0)}p_i(t)dq^i-\int\limits^t_{t_0}H(q^i(t),p_i(t))dt.\tag{4} \end{align} Finally, we also know the diferential form of $S(q,t)$ is by definition \begin{equation}\label{eq110} dS(q^i,t)=\frac{\partial S(q^i,t)}{\partial q^i}dq^i + \frac{\partial S(q^i,t)}{\partial t}dt\tag{5} \end{equation} which give us these following relations \begin{equation} p_i=\frac{\partial S(q^i,t)}{\partial q^i} \quad \text{and} \quad -H(q^i,p_i)=\frac{\partial S(q^i,t)}{\partial q^i}.\tag{6} \end{equation} Replacing $p_i$ relation inside $H$ give us the Hamilton-Jacobi equation \begin{equation}\label{eq116} \frac{\partial S(q^i,t)}{\partial t}+H\left(q^i,\frac{\partial S(q^i,t)}{\partial q^i}\right)=0.\tag{7} \end{equation}
Question When working with action functional we already know that physical motions are those curves that are the an extremum of $S[q]$. But here we actually wrote $S[q]$ as a function $S(q,t)$ of $(q,t)$ and this give us Hamilton-Jacobi equation. My question is:
Every solution of Hamilton-Jacobi equation is an extremum of $S[q]$?
Also, there's an relation (even conceptually) between extremum of $S[q]$ and general solutions of Hamilton-Jacobi equation?