I'd like to know the steps to follow to find the generating function $F_1(q,Q)$ given a canonical transformation.
For example, considering the transformation
$$q=Q^{1/2}e^{-P}$$ $$p=Q^{1/2}e^P$$
I have thought to find p and P:
$$p=\frac{Q}{q}$$
$$P=\frac{1}{2}\ln Q-\ln q$$
And so, using the definition of the generating function $F_1(q,Q)$:
$$\tag{1}\frac{\partial F_1}{\partial q} \equiv p =\frac{Q}{q}$$
$$\tag{2}\frac{\partial F_1}{\partial Q} \equiv -P = \ln q-\frac{1}{2}\ln Q$$
Then I have thought to integer these relations and I have obtained:
$$F_1=Q\ln q + f(Q)$$
$$F_1=Q\ln q-\frac{1}{2}(Q\ln Q-Q) $$
The result must be: $$F_1=Q\ln q-\frac{1}{2}(Q\ln Q-Q) $$
Now, I'm trying to find the general rule:
At the beginning I have thought that I have to sum the two $F_1$, but then the result is wrong. And so I ask you: do I have to integer the two relations and then take as $F_1$ that relation that verifies both (1) and (2)?