Now I'm getting confused! The "generalized Stoke's theorem"
says that \int_{\partial M}\omega= \int_M d\omegawhere M is a manifold, \partial M is its boundary, \omega is a differential form on [\partial M, and d\omega is its differential. If we take \omega to be f(x,y,z)dS on the boundary of some 3 dimensional manifold, we get the divergence theorem and if we take it to be f(x,y,z)ds on the boundary of a 2 dimensional manifold, then we get the original "Stoke's theorem".<br />
<br />
A lot of detail is given here:<br />
<a href="http://mathworld.wolfram.com/StokesTheorem.html" target="_blank" class="link link--external" rel="nofollow ugc noopener">http://mathworld.wolfram.com/StokesTheorem.html</a><br />
<br />
But, once again, whether the normal is to the surface or the curve bounding the surface, it is typically <b>not</b> constant.<br />
<br />
One specific question that was asked was "If I have the bottom hemisphere of a ball, z<=0. What would be its normal vector?"<br />
<br />
We can parametrize the sphere, of radius R, centered at the origin, using x, y themselves: x= x, y= y, z= -\sqrt{R^2- x^2- y^2}<br />
Then the "fundamental vector product" (see <a href="http://www.math.duke.edu/education/ccp/materials/mvcalc/parasurfs/para3.html" target="_blank" class="link link--external" rel="nofollow ugc noopener">http://www.math.duke.edu/education/ccp/materials/mvcalc/parasurfs/para3.html</a>) <br />
(i+ \frac{x}{\sqrt{R^2-x^2-y^2}}k)X(j\frac{x}{\sqrt{R^2-x^2-y^2}}k)<br />
is a normal vector to the surface. That time dxdy is the vector differential.<br />
<br />
It would, perhaps be easier to use "spherical coordinates" with \rho= R: x= Rcos(\theta)sin(\phi), y= Rsin(\theta)sin(\phi), z= Rcos(\phi).<br />
<br />
Now the fundamental vector product is<br />
(-Rsin(\theta)sin(\phi)i+ Rcos(\theta)sin(\phi)j)X(Rcos(\theta)cos(\phi)i+ Rsin(\theta)cos(\phi)j- Rsin(\phi)k)<br />
Again, that is a vector normal to the ball. d\vec{S} would be that times d\thetad\phi. To integrate over the bottom, \phi would range from \frac{\pi}{2} to \pi. \theta, of course, ranges from 0 to 2\pi.