I am trying to prove Newton's Shell Theorem, and the natural integral I think of to use does not seem to give the right answer, so I am trying to find my mistake.
For simplicity, I will work in one dimension. Assume there is a uniform "sphere" of one dimension (ie, a segment) of mass $M$ and radius $R$ centered at $x = 0$, which exerts a gravitational force on a particle of mass $m$ located at $x = r$, where $r > R$.
According to Newton's Theorem, the gravitational force exerted by the sphere on the particle should be $G\dfrac{Mm}{r^2}$.
It seems to me that the force exerted on the particle by an infinitesimal slice of the sphere at location $x$ with width $dx$ should be $\dfrac{G(M\dfrac{dx}{2R})m}{(x - r)^2}$. Integrating over $[-R,R]$ should then give the total force. But $$\int_{-R}^R \dfrac{GMm}{2R(x-r)^2}dx = \dfrac{GMm}{r^2-R^2}.$$ Not only is this different from $G\dfrac{Mm}{r^2}$, but it gives the absurd result that the force increases to infinity as $r$ approaches $R$. Can anyone explain the flaw in my setup?
[Note: In 3 dimensions my integral becomes $$\int\int\int \dfrac{GMm}{\frac{4}{3}\pi R^3[(x-r)^2+y^2+z^2]}dV,$$ where the integration is over the sphere of radius $R$ centered at the origin and the particle is located at $(r,0,0)$. This too is incorrect, but the problem already arises in one dimension where the integral is far easier to evaluate.]