This question already has an answer here:
- Potential energy sign conventions 4 answers
Consider a point mass which creates a gravitational field. The gravitational force pulls a 'test mass' towards the point mass. Since the displacement and gravitational force are in the same direction, the work done by the gravity is positive. I would like to show this mathematically, but my answer comes out negative:
I think the source of this error is how I deal with the displacement (highlighted). The displacement is in the negative direction (towards the point mass), but because you take its magnitude when doing the dot product, I didn't think its direction mattered. I therefore proceeded to swap $ds$ for $dr$ (not really knowing what I was doing, but it seemed to make sense, because $s$ and $r$ are both displacements, albeit in opposite directions).
How should I correctly integrate this dot product to get the right sign of work done?