Verifying Stokes' theorem on the surface of a torus "Let $0 < a < b$. Verify Stokes' theorem when $\mathbf{F} = (y,z,x)$ and $\Sigma$ is the upper half of the torus generated by rotating the circle $(x-b)^2 + z^2 = a^2$ about the $z$-axis".
I parametrized the torus as $\left((b+a\cos\theta)\cos\phi,(b+a\cos\theta)\sin\phi,a\sin\theta\right)$ and obtained $\pi a(a+2b)$ for the surface integral. For the line integral, I got two semicircles with radii $b-a$ and $b+a$, and got $2\pi ab$, which is different. Can someone assist with identifying the mistake (or set out a correct solution)?
 A: Your parametrization $(\phi,\theta)\mapsto{\bf f}(\phi,\theta)$ of the torus surface is fine.  For the upper half $S$ of this surface the parameter domain is $0\leq\phi\leq2\pi$, $\>0\leq\theta\leq \pi$. The boundary $\partial S$ does not consist of two half circles, but of two full circles in the $(x,y)$-plane, having radii $a+b$ and $a-b$. These two circles are differently oriented, e.g., the outer circle counterclockwise when seen from above, and the inner circle clockwise. This orientation of the circles corresponds to a surface normal ${\bf n}$ on $S$ having positive $z$-component. You will have to check whether ${\bf f}_\phi\times{\bf f}_\theta$ satisfies this.
A: Both your result for the surface integral and line integral(s) look wrong to me.

Surface integral
$\vec F(x,y,z)=(y,z,x)$ has curl $\nabla\times\vec F(x,y,z)=(-1,-1,-1)$. Take the normal vector to $\Sigma$ to be
$$\vec n=\frac{\partial\vec s}{\partial\phi}\times\frac{\partial\vec s}{\partial\theta}=(a\cos\theta(b+a\cos\theta)\cos\phi,a\cos\theta(b+a\cos\theta)\sin\phi,a(b+a\cos\theta)\sin\theta)$$
where $\vec s(\phi,\theta)$ is the parameterization you use for $\Sigma$, with $\phi\in[0,2\pi]$ and $\theta\in[0,\pi]$. Then
$$\iint_\Sigma(\nabla\times\vec F)\cdot\mathrm d\vec S=-\int_0^\pi\int_0^{2\pi}(1,1,1)\cdot\vec n\,\mathrm d\phi\,\mathrm d\theta=-4\pi ab$$

Line integral
Split up the boundary as
$$C=C_{\rm outer}\cup(-C_{\rm inner})$$
where the outer circle $C_{\rm outer}$ is given by $\vec s(\phi,0)$ and has counterclockwise orientation, and the inner circle $C_{\rm inner}$ is given by $\vec s(\phi,\pi)$. On its own, $C_{\rm inner}$ also has counterclockwise orientation, so when taking the line integral you'll need to reverse it by multiplying by $-1$.
We have
$$\int_{C_{\rm outer}}\vec F\cdot\mathrm d\vec r=-(a+b)^2\int_0^{2\pi}\sin^2\phi=-(a+b)^2\pi$$
$$\int_{C_{\rm inner}}\vec F\cdot\mathrm d\vec r=-(a-b)^2\int_0^{2\pi}\sin^2\phi=-(a-b)^2\pi$$
so that
$$\int_C\vec F\cdot\mathrm d\vec r=-(a+b)^2\pi-\big(-(a-b)^2\pi\big)=-4\pi ab$$
