This is on a study guide for my Physics 221 final. I feel like I almost got it but I am off by a sign error. Here is the question:
Here is what I got so far:
Known:
$$F_g = \frac{GMm}{r^2}$$ $$U_g = -\int F\space dr$$
My work:
$$U_g = -\int_\sqrt{x^2+a^2}^\infty \frac{GMm}{r^2}\space dr$$ $$=\frac{GMm}{r} |_\sqrt{x^2 + a^2}^\infty$$ $$=\frac{GMm}{\infty} - \frac{GMm}{\sqrt{x^2 + a^2}}$$ $$=-\frac{GMm}{\sqrt{x^2 + a^2}}$$
My answer is super close but it is just off by a sign. If I flip the bounds of my integral my answer works, but if that is what I do I don't understand why. My bounds make sense in my head. Where is my mistake?