$\partial F_2/dt$ part of a time dependent canonical transformation Suppose we have a time-dependent canonical transformation - say generated by a function of the  type $F_2(q,P,t)$.  The resulting Kamiltonian picks up an extra partial $\partial F_2/\partial t$:
\begin{align}
K= H(Q,P,t)+\frac{\partial F_2}{\partial t}\, .
\end{align}
If we are instead given not the generating function but directly the canonical transformation, is there a way to determine the extra additive piece $\frac{\partial F_2}{\partial t}$ without first recovering the generating function?
(The same general question applies to any type of generating function.)
 A: Assume you have the explicit time-dependent canonical transformation of the Hamiltonian $H\big(q, \, p, \, t\big)$ (and you  are sure it is canonical). Let's say the transformation has formulas
\begin{align}
&q \, = \, q \big(Q, \, P, t\big)\\
&p \, = \, p \big(Q, \, P, t\big)
\end{align}
Then construct the one-from
$$p \cdot dq \, - \, H\big(q, \, p, \, t\big) \, dt$$ and take its exterior derivative
$$dp \wedge dq \, - \, dH_{(q, \, p, \, t)} \wedge dt$$
Next, change its variables with the canonical transformation:
$$d\Big(p \big(Q, \, P, t\big)\Big) \wedge d\Big(q \big(Q, \, P, t\big)\Big) \, - \, d \Big( H\Big(\, q \big(Q, \, P, t\big), \, p \big(Q, \, P, t\big),\, t  \Big) \,\Big) \wedge dt$$
Then differentiate, expand and simplify as much as possible. Also, group together all the terms with $\wedge dt$ in them. If the transformation is indeed canonical, the resulting two form, in the new coordinates $Q, \, P, \, t$ should look like:
\begin{align}
dp \wedge dq \, - \, dH_{(q, \, p, \, t)} \wedge dt \, = \, dP \wedge dQ \, - \, dK_{(Q, \, P, \, t)} \wedge dt
\end{align}
Since we have the identity between two-form in the old and the new coordinates, we can rewrite it as follows:
\begin{align}
d\Big(p \big(Q, \, P, t\big)\Big) \wedge d\Big(q \big(Q, \, P, t\big)\Big) \, -& \, d \Big( H\Big(\, q \big(Q, \, P, t\big), \, p \big(Q, \, P, t\big),\, t  \Big) \,\Big) \wedge dt \, = \\
&=  \, dP \wedge dQ \, - \, dK_{(Q, \, P, \, t)} \wedge dt
\end{align} which means that the difference between the two-form on the left and on the right is zero:
\begin{align}
d\Big(p \big(Q, \, P, t\big)\Big) \wedge d\Big(q \big(Q, \, P, t\big)\Big) \, -& \, d \Big( H\Big(\, q \big(Q, \, P, t\big), \, p \big(Q, \, P, t\big),\, t  \Big) \,\Big) \wedge dt \, \\
& -\, dP \wedge dQ \, + \, dK_{(Q, \, P, \, t)} \wedge dt \, = \, 0
\end{align}
But this zero difference is the exterior derivative:
\begin{align}
d\Big[ \, p \big(Q, \, P, t\big) \cdot d\Big(q \big(Q, \, P, t\big)\Big) \, -& \, H\Big(\, q \big(Q, \, P, t\big), \, p \big(Q, \, P, t\big),\, t  \Big) \,\Big) \, dt \, \\
& -\, P \cdot dQ \, + \, K(Q, \, P, \, t) \, dt \, \Big]\, = \, 0
\end{align}
If we assume that the $Q, \, P$ coordinates vary in simply connected region (or at least in a locally simply connected), there exists a function $f(Q, \, P,\, t)$ such that
\begin{align}
p \big(Q, \, P, t\big) \cdot d\Big(q \big(Q, \, P, t\big)\Big) \, -& \, H\Big(\, q \big(Q, \, P, t\big), \, p \big(Q, \, P, t\big),\, t  \Big) \,\Big) \, dt \, \\
& -\, P \cdot dQ \, + \, K(Q, \, P, \, t) \, dt \, = \, d\,f
\end{align}
Expand:
\begin{align}
\left(p^T \frac{\partial q}{\partial Q} \right)\cdot dQ \,  + \, \left(p^T \frac{\partial q}{\partial P} \right)\cdot dP  \, + \,  \left(p \cdot \frac{\partial q}{\partial t} \right)dt\, -& \, H\Big(\, q \big(Q, \, P, t\big), \, p \big(Q, \, P, t\big),\, t  \Big) \,\Big) \, dt \, \\
& -\, P \cdot dQ \, + \, K(Q, \, P, \, t) \, dt \, = \, d\,f
\end{align}
After some grouping and component-wise comparing:
\begin{align}
& p^T \frac{\partial q}{\partial Q} \, - \, P \, = \, \frac{\partial f}{\partial Q}\\
& p^T \frac{\partial q}{\partial P} \, = \, \frac{\partial f}{\partial P}\\
& p \cdot \frac{\partial q}{\partial t} \, + \, K(Q,\, P,\, t) \, - \, H\Big(\, q \big(Q, \, P, t\big), \, p \big(Q, \, P, t\big),\, t  \Big) \, = \, \frac{\partial f}{\partial t}
\end{align}
Hence, we can calculate the hamiltonian function $K$ from the equation
$$K(Q,\, P,\, t) \, = \,  H\Big(\, q \big(Q, \, P, t\big), \, p \big(Q, \, P, t\big),\, t  \Big) \, - \, p \cdot \frac{\partial q}{\partial t} \, + \, \frac{\partial f}{\partial t}$$ However, we do not know exactly $\frac{\partial f}{\partial t}$. However, we do know exactly
\begin{align}
& \frac{\partial f}{\partial Q} \, = \, p^T \frac{\partial q}{\partial Q} \, - \, P \\
&\frac{\partial f}{\partial P} \, = \, p^T \frac{\partial q}{\partial P}\, 
\end{align}
This, allows us to calculate a function for every arbitrary fixed $t$ $$\tilde{f}(Q, \, P,\, t) \, = \, \int_{(Q_0,P_0)}^{(Q,P)} \, \left(p^T \frac{\partial q}{\partial Q} \, - \, P\right) \cdot dQ \, + \, \left(p^T \frac{\partial q}{\partial P}\right) \cdot dP $$ By construction, the difference $f - \tilde{f}$ has zero derivatives wirh respect to $Q$ and $P$, which means that $f - \tilde{f}$ is just a function of $t$, which does not play a role in the definition of a hamiltonain $K$. Therefore, we can calculate the hamiltonain $K$, up to an irrelevant $t-$dependent term, as
$$K(Q,\, P,\, t) \, = \,  H\Big(\, q \big(Q, \, P, t\big), \, p \big(Q, \, P, t\big),\, t  \Big) \, - \, p \cdot \frac{\partial q}{\partial t} \, + \, \frac{\partial f}{\partial t}$$ where
$${f}(Q, \, P,\, t) \, = \, \int_{(Q_0,P_0)}^{(Q,P)} \, \left(p^T \frac{\partial q}{\partial Q} \, - \, P\right) \cdot dQ \, + \, \left(p^T \frac{\partial q}{\partial P}\right) \cdot dP $$
