Solving Hamilton-Jacobi via canonical transformations

Given a solution to a Hamilton-Jacobi equation in $(X, P)$ variables and a canonical transformation from $(x, p)$ to $(X, P)$, how does one write down the solution to the Hamilton-Jacobi in terms of the variables $(x,p)$?

I know this is a classical question with a known answer. Despite several attempts, I haven't been able to complete the calculation. I am hoping an expert can find a computationally tractable way of writing down a solution.

Given the Hamiltonian $H : \mathbb{R}_+ \times \mathbb{R} \rightarrow \mathbb{R}$, $$H(x,p) = x(e^{-p} - 1) + e^p - 1,$$ and the type-2 generating function $$F_2(x, P) = x \log(P+1) - P,$$ we find the following transformation to be canonical: \begin{align*} x(X, P) &= (X+1)(P+1) \\ p(X, P) &= \log(P+1). \end{align*} Substituting in $H$, we obtain the "Kamiltonian" $K(X, P) = - XP$. A solution $V(t, X)$ to the Hamilton-Jacobi equation $$\frac{\partial V}{\partial t} + K\left(X, \frac{\partial V}{\partial X}\right) = 0$$ is given by $$V(t, X) = X^2 e^{2t}.$$ How can we use this to write down a solution $S(t, x)$ to the original Hamilton-Jacobi equation, $$\frac{\partial S}{\partial t} + H\left(x, \frac{\partial S}{\partial x}\right) = 0?$$ If there are some expressions which are difficult to invert, what is an explicit relationship between $S$ and $V$?

Edit, following secavara's hints.

With $V(t, X) = \alpha X e^t$, we first rewrite $(x, p)$ in $x(\beta, \alpha, t)$ and $p(\beta, \alpha, t)$. We find \begin{align*} x &= (\beta e^{-t} + 1)(\alpha e^t + 1) \\ p &= \log(\alpha e^t + 1). \end{align*} To fulfill $\partial_x S = p$, we might try $$S(x, \alpha, t) = x \log(\alpha e^t + 1) + g(\alpha, t).$$ for some arbitrary function $g(\alpha, t)$. We can verify that with $g(\alpha, t) = -\alpha$, we satisfy $\partial_\alpha S = \beta = X e^t$.

At this point I tried to get the last relationship to work out, $\partial_t S = -H$, but didn't manage (though, granted, I didn't try very hard). Instead, I ansatzed the following solution: $$S(t, x) = x \log x - x + a(t) x + b(t).$$ Plugging in to the HJE, we find the following relationships: \begin{align*} \dot{a}(t) &= -(e^{a(t)} - 1) \\ \dot{b}(t) &= -(e^{-a(t)} - 1). \end{align*} A solution to the HJE is therefore $$S(t, x) = x\log x - x - x\log(e^{-t+c_1} + 1) + e^{-t+c_1} + c_2$$ for constants $c_1, c_2$. The constant $c_1$ plays the role of $\alpha$. Does $c_2$ play the role of $\beta$?

My issue with this solution is that I seem unable to satisfy a boundary condition such as $S(0, x) = 0$ if $x = y$ and $S(0, x) = +\infty$ if $x \neq y$ for some fixed $y \in \mathbb{R}_+$. This might be possible if we had a term such as $-(x-y)\log(1-e^{-t}).$ One can satisfy such a boundary condition in the simple case of a free particle, say $H'(p) = p^2/2$. Then $S(t, x) = (x-y)^2/2t$ satisfies the same HJE (with Hamiltonian $H'$) and $S(0, x) = \infty\cdot 1\{x \neq y\}$. Do you see any way of getting this for our $H$?

Finally, it seems to me that the $\alpha, \beta$ constants are related to the following canonical transformation from $(X, P)$ to $(E, Q)$ variables: \begin{align*} X = \sqrt{E} e^{-Q} \\ P = \sqrt{E} e^{Q}. \end{align*} Then $K(X(E, Q), P(E, Q)) = -E$, and we have "action-angle" coordinates. I hesitate to call them action-angle because the phase space is not compact, so there is no cyclic variable. This system can be viewed as a harmonic oscillator rotated by $p \rightarrow i p$, i.e., $H''(x, p) = x^2 - p^2$. I am not sure how to interpret it.

The way I rationalize the Hamilton-Jacobi process is by thinking of the solution to the HJ equation as an $F_2$ generating function that leads to a trivial Kamiltonian (although I think in some references they take other types of generating functions). So, in sum, the HJ process is a very convenient canonical transformation.

In your case, you seem to perform first a canonical transformation, and then solve the HJ equation for the transformed Hamiltonian, coordinates and momenta. So, you see, in my mind, while you managed to solve the problem, you did this by doing effectively 2 canonical transformations: one intermediate one and one related to the solution of the HJ equation. In some way, your $S$ is the type 2 generating function that accounts for the composition of these 2 transformations.

One thing you can try to do is to invert these 2 canonical transformations. Try using the relations between derivatives of $V$ and the $X$ and $P$ coordinates to deduce the corresponding canonical transformation: usually this will allow you to write $X$ and $P$ in terms of 2 constants and possibly time. Once this is done, you might be able to invert all the way to $p$ and $x$, so that that you literally solve the dynamic problem since you end up with $x$ and $p$ written in terms of these 2 constants and time. Then if you really need $S$, then $S$ corresponds to the type 2 generating function associated to the canonical transformation that takes you from $(x,p)$ to the 2 constants you picked. Depending on how ugly the results were so far, this might be hard or not, but I think that when it's framed as this, the problem sounds more textbook standard as many exercises ask you to find an $F_2$ given a specific canonical transformation.

EDIT:

After some checks, I can give you some hints on how to proceed. The first thing to take into account is that you can find much more general solutions $V$ for your HJE. For instance, you can take $$V_r = \alpha_r \, X^r \, \mathrm{e}^{r t} \, ,$$ with $r$ and $\alpha_r$ constants. Or you can take $$V_\gamma = \gamma \, \left( \log X + t \right) \, ,$$ with $\gamma$ a constant. Or you can even take a superposition of the form $$V = V_\gamma + \sum_r V_r \, .$$ It is a very rich space of solutions, which in other contexts would be constrained by boundary or initial conditions. But here it offers us the possibility of picking the solution that simplifies our computations. After some experimentation, it turns out that $$V = V_{r=1} = \alpha \, \, X \, \mathrm{e}^{t} \, ,$$ simplifies our lives a lot (here I simply picked $\alpha_1 = \alpha$). The rest of the problem becomes much more tractable than when you use your original choice for $V$.

Now you can use the type 2 relations $$P = \frac{\partial V}{\partial X} \, \, \mathrm{and} \, \, \beta = \frac{\partial V}{\partial \alpha} \, .$$ This allows you to write $X$ and $P$ as a function of $t$ and the constants $\beta$ and $\alpha$. With this, you'll be able to write $x$ and $p$ in terms of the same variables, using the canonical transformation. Now, in order to find $S$, you want to focus on the canonical transformation that goes from $(x,p)$ to $(\beta,\alpha)$. Since $S$ is type 2, you want to find an $S(x,\alpha,t)$ such that: \begin{eqnarray} p &=& \frac{\partial S}{\partial x} \, , \\ \beta &=& \frac{\partial S}{\partial \alpha} \, , \\ - H &=& \frac{\partial S}{\partial t} \, . \end{eqnarray} Fortunately, with our choice of HJE solution, this is now a much simpler problem.

• Thank you very kindly for all your work, it is much appreciated. A few more questions: it is true that there are many more solutions to the original HJE -- perhaps you see a way of writing them all out from the "action-angle" coordinates (see my edit)? I also admit I am confused about how you knew to choose a constant ($\alpha$) as a variable, any insight there would be appreciated. Finally, my last concern is to satisfy the boundary data I prescribe in the edit -- please let me know if you see a way. I'm happy to accept your answer as is, I'll give it a few days just in case.
– snar
Commented Aug 16, 2018 at 13:55
• Ok, no worries. Let me first mention a couple of things. The reason why I expected a constant in $V$ follows from the fact that, since you have a 2D phase space, you expect to need two initial conditions in the solution of your dynamical problem. These, or a function of them, eventually manifest as the constants that you reach through the HJ approach, which also picks them in such a way that they are conjugate variables. Consequently, one of them must appear as a 'conjugate momentum' in the solution to the HJE. In simpler exercises in which you know in advance some constants of motion Commented Aug 16, 2018 at 15:40
• you can play with this concept and manipulate the HJE to find solutions that involve precisely the constants of motion you are already aware of, such as energy or momentum, depending on the system. Or you can manipulate it such that the HJ conjugate variables exactly match the initial position and momentum. The second thing to mention is that I got $g(\alpha,t) = - \alpha \,\mathrm{e}^t$, in terms of your notation for the solution. Check this and then I'll try to comment on the other stuff. Commented Aug 16, 2018 at 15:42