Theres a question in which I need to derive a langrangian, and then the equations of motion for a particle constrained onto a surface. I think I'll be able to do it, except for the fact that I have no idea how to formulate the POTENTIAL ENERGY of the particle. I'd like to have a go at the rest myself, but can someone help me with how to just find the potential energy? The particle is constrained to a surface: z(x,y)= x^2/a^2 + y^2/b^2, and its moving in presence of a gravitational force in -ve z direction. Obviously the gravitational force is F=-mg, and potential will be some function of x and y?? I'd really appreciate some help!