Why is $Q=p$, $P=-q$ a canonical transformation from the perspective of 2 variational principles satisfying boundary conditions?
Modified Hamilton's Principle overconstraining a system by imposing too many boundary conditions