How generating function and scale transformation is coming in Hamiltonian? As I was reading Goldstein, there is the Hamiltonian $H$ such that,
$$\delta \int_{t1}^{t2} (p_i\dot q_i - H(q, p ,t)) dt = 0, \tag{9.7}$$ and Kamiltonian $K$,
$$\delta \int_{t1}^{t2} (p_i\dot q_i - K(Q, P ,t)) dt = 0. \tag{9.6}$$
This is ok.
Then,
$$\lambda(p_i\dot q_i - H) = P_i\dot Q_i - K + \frac{dF}{dt} \tag{9.8}$$
but I am not getting how this last expression does come.
Here I am not understating why $\lambda$ and ${dF/dt}$ does come? If you know any mathematical article, paper that would be really helpful.
 A: As mentioned through the comments, $\frac{dF}{dt}$ is the result of how a Lagrangian $L$ that produces an action $S$ by $$dS = \delta \int L\, dt$$ is only unique up to a derivative, hence the existence of the $\frac{dF}{dt}$ term in eqn (9.8).
The term $\lambda$ has been stated by Goldstein as  a scale factor. Improperly, we can imagine this as the jacobian of the transformation $(p,q) \rightarrow (P, Q)$. (Please refer further into Chapter 9.4.)
Also, we note that extremising the action $S$ through both lagrangians $L_K$ and $L_H$ independently must recover the same action, and it is unusual to say that we are extremising (the functional $S$ on) $H$ together with $K$. Nonetheless, the purpose of (9.8) was to therefore show how $H$ would change depending on coordinate representations such that $S$ would be the same.
A: Eq. (9.8) [which is called an extended canonical transformation (ECT) in my Phys.SE answer here, and which is supposed to be satisfied off-shell] is a sufficient condition for the variational principles (9.6) and (9.7) to be equivalent. 
This is because the stationary solution to a variational principle is not changed if the action is modified by an overall non-zero multiplicative factor $\lambda$ or by boundary terms. 
On the other hand, the Euler-Lagrange (EL) equations for the variational principles (9.6) and (9.7) are the Kamilton's and Hamilton's equations, respectively. In this way we see that the ECT (9.8) transforms the Hamilton's equations into the Kamilton's equations.
