feynman lectures physics vol 1 chap 13 13-4 prove Hi guys I've recently into this Feynman's book and I have a question while reading it. 
Last part of chap 13 he proves that 

the force produced by the earth at a point on the surface or outside it is the same as if all the mass of the earth were located at its center. 

Here's an url for image which he uses..
http://www.feynmanlectures.caltech.edu/img/FLP_I/f13-06/f13-06_tc_big.svgz
While proving that, he said

If we call $x$ the distance of a certain plane section from the center, then all the mass that is in a slice $dx$ is at the same distance $r$ from $P$, and the potential energy due to this ring is $−Gm′dm/r$. How much mass is in the small slice $dx$? An amount
  $dm=2\pi y\mu ds=\frac{2\pi y\mu dx}{\sin\theta}=\frac{2\pi y\mu dxa}{y}=2\pi a\mu dx$,
where $\mu=\frac{m}{4\pi a^2}$ is the surface density of mass on the spherical shell. (It is a general rule that the area of a zone of a sphere is proportional to its axial width.) Therefore the potential energy due to $dm$ is
  $dW=\frac{−Gm′dm}{r}=\frac{−Gm′2\pi a\mu dx}{r}$.
    But we see that
  $r^2=y^2+(R−x)^2=y^2+x^2+R^2−2Rx=a^2+R^2−2Rx$.

In this part I have some questions..
first how can I get $dm=2\pi y\mu ds=\frac{2\pi y\mu dx}{\sin\theta}=\frac{2\pi y\mu dxa}{y}=2\pi a\mu dx$ and $\mu = m/(4\pi a^2)$ ?
and secondly he sets $r^2=y^2+(R−x)^2$ but if theta exceeds $\pi/2$, then $r^2=y^2+(R+x)^2$
I have no idea how he ends up with 

$W=\frac{Gm′2\pi a\mu}{R}\int_{R+a}^{R-a}dr=−Gm′2\pi a\mu\frac{2a}{R}=\frac{−Gm′(4\pi a2\mu)}{R}=\frac{−Gm′m}{R}$.

Could you explain these two things?
 A: First question: $\mu$ is the surface density. The spherical shell has a mass $m$. The area of a sphere of radius $a$ is $4\pi a^2$. So $$\mu=\frac{m}{4\pi a^2}$$ 
Now we take a thin slice in this spherical shell, at distance $x$ from the center, and thickness $dx$ along this axis. You end up with something like a ring, but the side of the ring is tilted with respect to the axis of the ring. You can clearly see this in the figure. The radius of this ring is $y=a\sin\theta$. The thickness is $ds$, so the area is $2\pi y ds=2\pi a\sin\theta ds$. Like I've mentioned before, the side of the ring is tilted. $ds$ is perpendicular to the radius, so the tangent plane is making the an angle $90^\circ-\theta$ with respect to the horizontal(draw a horizontal at $ds$ and see). Then the projection on the horizontal axis is $dx=ds\cos(90^\circ-\theta)=ds\sin\theta$. Now putting it all together, the mass $dm$ of this ring is equal to the area multiplied by the surface mass density: $$dm=\mu2\pi yds=2\pi\mu a\sin\theta\frac{dx}{\sin\theta}=2\pi\mu a dx$$ 
Now for the second part: the distance between the center of the sphere and point $P$ is $R$. You are confused by the fact that it was not mentioned that $x$ is a signed quantity. It is positive for points in between the center of the spherical shell and the point $P$, but it is negative for points on the left of the center , in the figure. Those occur for $\theta\in(\pi/2,\pi]$. In your understanding $x$ is in fact $|x|$ from the lecture notes.
Let me know if anything else is unclear.
