Consider a single free particle of mass $m,$ moving in space under no forces. If the particle starts from the origin at $t=0$ and reaches the position $(x,y,z)$ at time $t,$ find Hamilton's characteristic function $S$ as a function of $x, y,z,t. $
In this problem, I tried to solve by taking K.E. in terms of velocity in each direction and potential energy I have taken as P.E.$= mgz$ my final equation was
$H = (p_x^2+p_y^2+p_z^2)/(2m) + mgz$
Is this correct? And why this equation doesn't contain variable $t?$