Originally posted by mtthwVery interesting!
True, that's exactly the simplication I used.
What does it do if you use a function? It makes it more complicated 🙂.
You need to integrate that function from 0 to r to get the gravitational force for r within the planet - you get something proportional to:
1/r^2 x Int{0 to r}(x^2 f(x) dx)
(which is proportional to r if f is constant)
You then need to integrate it again to get the potential energy difference.
Does it differ a lot, do you think? I mean, the result using the simplyfied formula and using the density as a function?