Given that the rope with uniformly distributed mass is attached to two points (important: the points do not have to be at the same height). How to derive the shape of such rope using calculus of variations? I guess, the total potential energy has to be minimal. Just in case, potential energy of a point is defined as $mgh$, where $g$ is the gravitational acceleration, $m$ is the mass and $h$ is the height. Potential energy of an arbitrary shape is the same $mgh$, where $H$ is the height of its center of mass.