
Originally Posted by
swampyankee
On a planetary scale, neither density (ρ) nor g would be constant. The value of g, if I got my algebra correct, would be:
g(r) = (4/3)*π ρ r
Note that it, too, depends on ρ.
This means that the integral on Wikipedia would have to be rearranged so g is inside the integral. Assuming ρ is constant, you can pull it out of the integral. Just remember z = R0 - r.
I did some planetary hydrostatics in one of my introductory fluids class. Alas, it was about 40 years ago and I remember little of it. I'll dig through the book and find out what the equation should be.