# Find generating function $F_1$ for canonical trasformation

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

$$\tag{1}\frac{\partial F_1}{q}=\frac{Q}{q}$$
$$\tag{2}\frac{\partial F_1}{Q}=\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_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)?

-
Presumably you mean $\frac{\partial F_1}{\partial q}$ and $\frac{\partial F_1}{\partial Q}$. –  Emilio Pisanty Feb 12 '13 at 13:18

Your reasoning is not particularly clear (and the question could benefit from you fleshing out the details), but it looks correct up to the formulation of the differential equations for $F_1$: $$\begin{cases}\frac{\partial F_1}{\partial q}=\frac{Q}{q},\\ \frac{\partial F_1}{\partial Q}=\ln q-\frac{1}{2}\ln Q.\end{cases}$$ You have simply integrated the first one without regarding whether it still obeys the second one, which it doesn't. If you integrate the second one directly then you'll get the answer you're looking for.
In general this will not work, either (e.g. if the first equation was of the form $\frac{\partial F_1}{\partial q}=\frac{Q}{q}+f(q)$ it wouldn't), so you have to do your best to find the function that obeys both equations. (In the most general case this is of course impossible, but the condition of the transformation being canonical essentially says that this can be done.)
thanks for your answer, but which are the general steps to follow to find $F_1$? I haven't done exercises like this before, so I don't know how I can do in cases like this.. .I'm trying to find the steps that I can always follow to find $F_1$.. –  sunrise Feb 12 '13 at 14:24
Same as you did above. Find the partial derivatives of $F_1$ wrt $q$ and $Q$ (in terms of $q$ and $Q$, of course!) and integrate. –  Emilio Pisanty Feb 12 '13 at 14:45