Work done by varying force on a curved path