  For a one-dimensional conservative systems with position depending mass, one
deduces consistently a constant of motion, a Lagrangian, and a Hamiltonian for
the non relativistic case. With these functions, one shows the trajectories on
the spaces $(x,v)$ and ($x,p)$ for a linear position depending mass. For the
relativistic case, the Lagrangian and Hamiltonian can not be given explicitly
in general. However, we study the particular system with constant force and
mass linear dependence on the position where the Lagrangian can be found
explicitly, but the Hamiltonian remains implicit in the constant of motion.
