How is density related to gravitational force of attraction?
Density has no bearing on gravitational attraction. The only factors involved in gravitational attraction are the two masses in question, and the distance between them. The greater an object’s mass, the greater its gravitational pull, and the closer you are to it, the greater its pull. Thus the gravitational pull of an object depends only on its mass. Volume and geometry only come in to play when trying to find the geometric center of mass, which is where the pull will seem to emanate from. For example- the gravitational pull of a star with say 10x the mass of our sun on a spaceship is some number at some distance from the center of mass of that star. Now if that star were to suddenly collapse into a black hole- essentially compressing itself to a point so that density goes from some number to infinite density- as long as no mass was loss and the spaceship stayed at the same distance, the gravitational pull would not change at all. Even though the density changed.