Mass of a sphere where density varies

1. Feb 26, 2013

johnaaronrose

Consider a sphere of radius r where its density at any point is f(d) with d being the distance of the point from the origin and f(d) being an algebraic function and thus integrable. What is the function (ideally expressed as one integral & using constants such as Pi) for the mass of the sphere? PS please also supply the proof.

2. Feb 26, 2013

mathman

4π∫f(r)r2dr

Proof is obvious. I'll leave it to you.

3. Feb 26, 2013

johnaaronrose

Is below valid proof?
Consider sphere made up of infinite number of spherical shells. Assume that a spherical shell is at distance x from centre with infinitesimal thickness dx..
Volume of spherical shell = Its surface area * thickness = 4Pi(x^2)dx
Mass of spherical shell = mass of spherical shell * density of spherical shell
= 4Pi(x^2)dx * f(x) = 4Pi(x^2)f(x)dx
Mass of sphere = Integral from r to 0 of 4Pi(x^2)f(x)dx

Last edited: Feb 26, 2013
4. Feb 26, 2013

johnaaronrose

My answer IMO is the same as yours, mathman.
Reason I asked this is that Brian Cox & Jeff Forshaw's book titled 'The quantum universe: everything that can happen does happen, they state (on page 235) that where g(a) represents the fraction of a star's mass lying in a sphere of radius a is:
4Pi(R^3)p * Integral from a to 0 of (x^2)f(x)dx
where R is the radius of the star & p is the average density of the star.
I think it should be:
Integral from a to 0 of 4Pi(x^2)f(x)dx / (4Pi(R^3)/3)p)
= Integral from a to 0 of (x^2)f(x)dx / ((R^3)/3)p)

PS apologies for the use of Pi, ^, brackets & the Integral ( as I don't know how to create the appropriate symbols).