Verification of the Stokes theorem for the surface that is a part of a cone 
Let $S$ consist of the part of the cone $z=(x^2+y^2)^{1/2}$ for $x^2+y^2\leq9$ and suppose $${\bf A}=(-y,x,-xyz).$$ Verify that Stokes theorem is satisfied for this choice of $\bf A$ and $S$.

In the solution to this question in order to work out the surface integral you can project on to $z=3$ and evaluate over the region $x^2+y^2\leq9$. I was just wondering whether or not you could do the same but this time project onto the plane $z=0$?
 A: By Stoke's theorem,
$$\int_S (\nabla \times \mathbf{A}) \cdot \mathbf{n} \,d\sigma = \oint_C \mathbf{A} \cdot d\mathbf{r},$$
where $C = \{(x,y,z):x^2+y^2=9,z =3\}$ oriented clockwise.
With $\mathbf{A} = -y\mathbf{i}+x\mathbf{j}+-xyz\mathbf{k},$ the line integral is
$$\eqalign{
\oint_C \mathbf{A} \cdot d\mathbf{r}&=-\int_C(-ydx+xdy)\\&=-\int_{0}^{2\pi}[(-3 \sin \theta)( -3 \sin \theta) + (3 \cos \theta)( 3 \cos \theta)]\,d \theta\\&=-18\pi.
}$$
Now we can do the surface integral by projecting on the plane $z=0$. 
We have
$$\nabla \times \mathbf{A}= -xz\mathbf{i}+yz\mathbf{j}+2\mathbf{k}.$$
The surface can be expressed as $z=g(x,y)=\sqrt{x^2+y^2}$ over the region $\{(x,y):0 \leq x^2+y^2 \leq 9\}$ in the $x$-$y$ plane.  The differential element of area is
$$d\sigma = \sqrt{1+ \Big{(}\frac{\partial g}{\partial x}\Big{)}^2+\Big{(}\frac{\partial g}{\partial y}\Big{)}^2 }dxdy$$
and the outer unit normal vector is
$$\mathbf{n}=\frac{ \Big{(}\frac{\partial g}{\partial x}\Big{)}\mathbf{i}+\Big{(}\frac{\partial g}{\partial y}\Big{)}\mathbf{j}-\mathbf{k} }{\sqrt{1+ \Big{(}\frac{\partial g}{\partial x}\Big{)}^2+\Big{(}\frac{\partial g}{\partial y}\Big{)}^2 }},$$
where
$$\frac{\partial g}{\partial x}= \frac{x}{\sqrt{x^2+y^2}},\,\frac{\partial g}{\partial y}= \frac{y}{\sqrt{x^2+y^2}}$$
The surface integral reduces to 
$$\eqalign{
\int_S (\nabla \times \mathbf{A}) \cdot \mathbf{n} \,d\sigma &= \int_{-3}^{3} \int_{-\sqrt{9-x^2}}^{\sqrt{9-x^2}}\left[-xz\frac{\partial g}{\partial x}+yz\frac{\partial g}{\partial y}-2\right]\,dx\,dy\\
&=\int_{-3}^{3} \int_{-\sqrt{9-x^2}}^{\sqrt{9-x^2}}\left(-x^2+y^2-2\right)\,dx\,dy\\
&=4\int_{0}^{3} \left[\int_{0}^{\sqrt{9-x^2}}\left(-x^2+y^2-2\right)\,dy\right]\,dx\\
&=4\int_{0}^{\pi/2} \left[\int_{0}^{3}\left(-r^2 \cos^2 \theta+r^2\sin^2 \theta-2\right)\,rdr\right]\,d \theta\\
&=4\int_{0}^{\pi/2} \left[\int_{0}^{3}\left(-r^2 \cos 2 \theta - 2\right)\,rdr\right]\,d \theta\\
&=4\int_{0}^{\pi/2} \left(-\frac{81}{4} \cos 2 \theta - 9\right)\,d \theta\\
&=\left.4\left(-\frac{81}{8} \sin 2 \theta - 9\theta\right)\right|_0^{\pi/2}\\
&=-18\pi
}$$
A: It is much simpler to produce $S$ by means of  the parametric representation
$${\bf f}:\quad(r,\phi)\mapsto(r\cos\phi, r\sin\phi,r)\qquad(0\leq r\leq 3, \ -\pi\leq\phi\leq\pi)\ .$$
Then
$${\bf f}_r=(\cos\phi,\sin\phi,1),\quad{\bf f}_\phi=(-r\sin\phi,r\cos\phi,0), \quad {\bf f}_r\times{\bf f}_\phi=(-r\cos\phi,-r\sin\phi,r)\ .$$
As given the normal vector ${\bf f}_r\times{\bf f}_\phi$ points upwards, which is consistent with counterclockwise orientation of $\partial S$ (as seen from above).
Since
$${\rm curl}\,{\bf A}=(-xz,yz,2)$$
we now obtain
$$\eqalign{\int_S {\rm curl}\,{\bf A}\cdot\>d\vec S&=   
\int_0^r\int_{-\pi}^\pi{\rm curl}\,{\bf A}\bigl({\bf f}(r,\phi)\bigr)\cdot ({\bf f}_r\times{\bf f}_\phi)\ d\phi\>dr
\cr &=\int_0^r\int_{-\pi}^\pi 
(-r^2\cos\phi,r^2\sin\phi,2)\cdot(-r\cos\phi,-r\sin\phi,r)\>d\phi\>dr\cr
&=\int_0^3 4\pi r\>dr=18\pi\ .\cr}$$
For $\partial S$ we use the parametrization
$$\phi\mapsto {\bf x}(\phi)=(3\cos\phi,3\sin\phi,3)\qquad(-\pi\leq\phi\leq\pi)$$
and obtain
$$\int_{\partial S}{\bf A}\cdot d{\bf x}=\int_{-\pi}^\pi(-3\sin\phi,3\cos\phi,-27\cos\phi\sin\phi)\cdot(-3\sin\phi,3\cos\phi,0)\>d\phi=18\pi\ .$$
Note that there appear no square roots at all, as it should be the case when computing a flux.
