It directly follows from Gauss's Law for gravitation applied to a plane. Gauss's Law is obviously the base of this.
This isn't designed to be a proof of the earths shape. Its designed to show an infinite amount of matter (in a slab or specifically a plane) can cause a finite gravitational pull. If you don't have any legitimate concerns, please bugger off.
I have a degree in Mathematics. If I were to copy it from a book, I would just have used the method I posted earlier that uses a slab and would have cited it to avoid your crap. If I were to copy it from a book, its fairly obvious that the math is solid, in which case you are trolling.
It is clear you have no background in mathematics at all. If you don't know what a unit vector is then you shouldn't be even trying to understand what is going on. Furthermore, it is silly to make me state which units. Just use units that fit, like almost any other math formula based in physics.
It is perfectly legitimate to use a 2d surface to approximate.
If you don't know whats going on, please just state so and move on. If anyone else has issues with the op, please let me know.