Celestial body integration

I would like to prove that a celestial body's gravitational force is the same as if it would have been a point.

Suppose that the density is the same all over at a certain depth into the body. (It may be less at the surface and more halfway down to the center for example). The density is given by , where r is the distance from the center of the body. An object with mass is laying at the distance d from the center of the celestial body. Suppose it's outside the celestial body, in other words, .

Suppose is the total force the body is affecting the body with, considering only the mass in the body at a distance from the center within the interval , a mass which still fulfills the density criteria*. Note that , since there is no mass within the interval , and that , though I don't want to prove it.

Now, I state that

which can be simplified as

But according to a clause (I have only heard of it) that states that the celestial body can be treated as if it where only a point but with the same mass, we would get

so that

We now has two different formulas for :

Is this true? Correct me if I'm wrong. Or if I have made any error (probably). Or if I am using the mathematical signs wrong. ;)

* The density critera says that the body shall have the same density all over any given distance from the center. And I just made it up.