# The density within of sphere so that gravity is constant

1. Dec 1, 2009

### richard7893

1. The problem statement, all variables and given/known data
If the gravitational field vector g inside a sphere is independent of the
distance from the center of the sphere r, how does the density ρ(r) of the
sphere vary as a function of r?

2. Relevant equations
gauss' law for gravity: integrate g*da=4*pi*G integrate ρ(r) dv

3. The attempt at a solution
So far i have g=contant= (a/r^2) integrate 0 to r r^2 dr im not sure what to do next.

2. Dec 2, 2009

### Matterwave

If the field vector g inside is constant with respect to radii, then you can pull it outside the integral for Gauss's law as long as your gaussian surface is a sphere. So you get $$g\oint_{dS}dA = -4\pi GM$$ The integral is just the surface area of the sphere you have, so $$g(4\pi r^2)=-4\pi GM$$ Can you figure it out from there?