Evaluating the surface integral $\iint_S {({x^2} + {y^2})} \,dS$ using spherical coordinates For the integral $$\iint\limits_S {({x^2} + {y^2})} \,dS\quad,\,S:{x^2} + {y^2} + {z^2} = 2z$$The
correct answer is $${{8\pi } \over 3}$$ I used Spherical coordinate system,it turns to $$\int_0^{2\pi } {d\theta \int_0^{{\pi  \over 2}} {({r^2}{{\sin }^2}\varphi } )({r^2}\sin \varphi )\,d\varphi } ,r = 2\cos \varphi $$Then use $r = 2\cos \varphi$,it turns to $$32\pi \int_0^{{\pi  \over 2}} {{{\sin }^3}\varphi {{\cos }^4}\varphi \,d\varphi }  = {{64} \over {35}}\pi $$Doesn't match the answer,I wonder where am I wrong.
 A: The mistake in your approach is that you just substituted $r=2\cos\phi$ into the usual formula with $dS = r^2\sin\phi\,d\phi\,d\theta$. This formula is only valid when $r$ is a constant.
In particular, if you do the standard algorithm of parametrizing the surface and computing the fundamental vector cross product, you find that $$\vec g(\phi,\theta) = \big(2\cos\phi\sin\phi\cos\theta,2\cos\phi\sin\phi\sin\theta,2\cos^2\phi\big).$$
Then $$\left\|\frac{\partial\vec g}{\partial\phi}\times\frac{\partial\vec g}{\partial\theta}\right\| = 4\sin\phi\cos\phi.$$
Now you can proceed.
A: A fast track: We have $S= \{ (x,y,z): x^2+y^2+(z-1)^2=1\}$, a sphere of radius 1 centered at $(0,0,1)$. By spherical symmetry:
$$ \int_S x^2 \, dS= \int_S y^2 \, dS= \int_S (z-1)^2 \, dS= \frac{1}{3}\int_S 1 \, dS =\frac{4\pi}{3}$$
The result follows.
A: The surface $S$ is a sphere of radius $1$ centered at $(0,0,1)$, which can be determined by completing the square:
$$x^2+y^2+z^2=2z\implies x^2+y^2+(z-1)^2=1$$
Parameterize the surface in spherical coordinates, translating the $z$ coordinate accordingly:
$$\mathbf s(\theta,\phi)=\cos\theta\sin\phi\,\mathbf i+\sin\theta\sin\phi\,\mathbf j+(\cos\phi+1)\,\mathbf k$$
The surface element is
$$\mathrm dS=\left\|\frac{\partial\mathbf s}{\partial\theta}\times\frac{\partial\mathbf s}{\partial\phi}\right\|\,\mathrm d\theta\,\mathrm d\phi=\sin\phi\,\mathrm d\theta\,\mathrm d\phi$$
so the integral indeed has a value of
$$\iint_S(x^2+y^2)\,\mathrm dS=\int_0^{2\pi}\int_0^\pi\sin^3\phi\,\mathrm d\phi\,\mathrm d\theta=\boxed{\frac{8\pi}3}$$

Alternatively,
$$\iint_S(x^2+y^2)\,\mathrm dS=\iint_D(x^2+y^2)\sqrt{\left(\frac{\partial f}{\partial x}\right)^2+\left(\frac{\partial f}{\partial y}\right)^2+1}\,\mathrm dx\,\mathrm dy$$
where $f(x,y)=z=1\pm\sqrt{1-x^2-y^2}$ (corresponding the top and bottom halves of the sphere) and $D$ is the disk in the plane $z=1$ centered at $(0,0,1)$ given by
$$D=\{(r,\theta)\mid0\le r\le1\land0\le\theta\le2\pi\}$$
For either hemisphere, we have
$$\sqrt{\left(\frac{\partial f}{\partial x}\right)^2+\left(\frac{\partial f}{\partial y}\right)^2+1}=\frac1{\sqrt{1-x^2-y^2}}$$
So the integral over either hemisphere in polar coordinates is
$$\iint_D\frac{x^2+y^2}{\sqrt{1-x^2-y^2}}\,\mathrm dx\,\mathrm dy=\int_0^{2\pi}\int_0^1\frac{r^3}{\sqrt{1-r^2}}\,\mathrm dr\,\mathrm d\theta=\frac{4\pi}3$$
which gets doubled to account for the other hemisphere to again yield $\boxed{\frac{8\pi}3}$.
A: As an extra, there is a way of computing this integral without ever integrating by using spherical coordinates, which all hinges on symmetry. Notice that the sphere could also be written as
$$x^2+y^2+(z-1)^2=1$$
Since the integrand doesn't depend on the location in $z$ at all, we could safely translate the sphere down and be assured that
$$\iint\limits_{x^2+y^2+(z-1)^2=1}x^2+y^2\:dS = \iint\limits_{x^2+y^2+z^2=1}x^2+y^2\:dS$$
holds. Second, notice that by rotational symmetry (or just pairwise swapping the variables AKA reflectional symmetry) on the second surface we have that
$$\iint\limits_{x^2+y^2+z^2=1}x^2\:dS = \iint\limits_{x^2+y^2+z^2=1}y^2\:dS = \iint\limits_{x^2+y^2+z^2=1}z^2\:dS \equiv I$$
which is a quantity we will denote by $I$. Then the beauty of being on a sphere tells us that
$$3I = \iint\limits_{x^2+y^2+z^2=1}x^2+y^2+z^2\:dS = \iint\limits_{x^2+y^2+z^2=1}1\:dS = 4\pi$$
Thus the answer to the problem is $2I$, or
$$\frac{8\pi}{3}$$
