The potential energy for a body of mass m that is acted on by a very massive body is given by U=-mgx+kx33. The corresponding force is
-mg+kx2
mg-kx2
mg-kx
-mg+kx
for consevative force F=-dUdx =- -mg+kx2=mg-kx2