Q:

Center of mass of an arc

A very thin tube shaped like a quarter of a toroid has one end attached to the origin $(0,0,0)$ and the other end at $(R,0,R)$. Determine its center of mass. 
So obviously $y_G = 0$. Using Pappus theorem, we may determine $x_G$ by rotating the tube around the z-axis, giving half a sphere with radius $R$. The surface area is $A = 2 \pi R^2$ and the length of the arc $l$ is $R\pi/2$ (quarter of a circle) so we get $x_G = A/(2\pi l) = \frac{2\pi r^2}{2\pi R\pi/2} = 2R/\pi$. 
Now to the tricky part, determining $z_G$. Rotating the arc around the x-axis renders a surface area that can be calculated using the formula $A = 2 \pi \int f(x) \sqrt{1+f'(x)^2} dx $. We can express the arc in terms of $z$ and $x$ as $$z(x) = \sqrt{R^2 - x^2}$$ giving $f'(x)^2 = \frac{x^2}{R^2-x^2}$. Thus the area is: $$A = 2\pi \int_{0}^{R} \sqrt{R^2-x^2} \sqrt{1+\frac{x^2}{R^2-x^2}} dx $$ $$= 2 \pi \int_{0}^{R} \sqrt{\frac{(R^2-x^2)(R^2-x^2+x^2)}{R^2-x^2}} dx$$ $$= 2\pi \int_{0}^{R} |R| dx = 2 \pi R^2 $$
Again, using Pappus theorem to obtain $z_G$, we get $$z_G = A/(2\pi l) = \frac{2\pi R^2}{2 \pi R \pi/2} = 2R/\pi$$
This is however is wrong! According to the book, $z_G = R - \frac{2R}{\pi}$. What did I do wrong?

A:

A better and convenient solution to this question would be this (In case it is not compulsory to use Pappus theorem)

Image is self explanatory. I prefer using the X-Y coordinates as shown. Thesecan be converted to match the question later.
Center of mass in any dimension is given by $$x_{CM}=\dfrac{\int x\,dm}{\int dm}$$
By symmetry, the centre of mass lies on the Y axis. $$x_{CM}=0$$
$$y_{CM}=\dfrac{\int^{3\pi/4}_{\pi/4}\lambda R^2\sin\theta\,d\theta}{\int^{3\pi/4}_{\pi/4}\lambda R\,d\theta}\implies R \dfrac{[-\cos\theta]^{3\pi/4}_{\pi/4}}{[\theta]^{3\pi/4}_{\pi/4}}\implies \dfrac{2\sqrt{2}R}{\pi}$$
Therefore, $\dfrac{2\sqrt{2}R}{\pi}$ is the distance from the center of the arc (located at $(R, 0, 0)$) along a line making $135^{\circ}$ with positive X-axis in the question's coordinate system. Thus, $$x_G=R-[\dfrac{1}{\sqrt{2}}\times\dfrac{2\sqrt{2}R}{\pi}]\implies\dfrac{(\pi-2)R}{\pi}$$ $$z_G=\dfrac{1}{\sqrt{2}}\times\dfrac{2\sqrt{2}R}{\pi}\implies\dfrac{2R}{\pi}$$
I guess you somehow interchanged $x_G$ and $z_G$. Hope this helps and I made no calculation errors!

