The question I am asking was asked here but was never given a satisfactory answer and so I will rephrase it and add more detail.
In chapter 9 of Goldstein,when talking about a canonical transformatio $(p,q,t) \to (P,Q,t)$ where Hamilton's principle is obeyed:
He mentions that (9.8) is a sufficient but not necessary condition.
However in chapter 10 between eqs. (10.1) and (10.2) he states that
which we derived using (9.8) with $\lambda=1$. How has the sufficient condition become a necessary one?
I though the idea of (9.8) is that if the integrands are both equal it is one way to satisfy (9.6) and (9.7) but not the only way?