Flux through the Surface Find the flux through the surface $\iint_S F\cdot NdS$ where N is the normal vector to S. 
i) $F=3z\hat i-4\hat j+y\hat k$
$~~~S:z=1-x-y$ (first octant) 
 
ii) $F=x\hat i+y\hat j-2z\hat k$
$~~~~S:\sqrt{a^2-x^2-y^2}$
I have evaluated $N$ vector as : $-\hat i-\hat j\over\sqrt2$ for i) and -$\frac{x}{\sqrt{a^2-x^2-y^2}}\hat i-\frac{y}{\sqrt{a^2-x^2-y^2}}\hat j$ for ii). 
I can calculate $F\cdot N$ through this but I am unable to convert $dS$ into $dxdy$ using projections  and find the limits. Can somebody give me a very easy explanation on how to convert using these two examples?
 A: Take the example: $F=x\hat i+y\hat j-2z\hat k$; $~S: z=\sqrt{a^2-x^2-y^2}$. Rewrite the surface as $f(x,y,z)=x^2+y^2+z^2 = a^2$ and calculate its unit normal vector
$$N=\frac{(f_x, f_y, f_z)}{\sqrt{f_x^2+ f_y^2+ f_z^2}}=\frac1a(x,y,z)$$
Then, 
$$F\cdot N = (x,y,-2z)\cdot \frac1a(x,y,z)=\frac1a (x^2+y^2-2z^2)=a-\frac3a z^2=a(1-3\cos^2\theta)$$
where the spherical coordinate $z=a\cos\theta$ is used in the last step. The corresponding surface element on the sphere $S:\>\> x^2+y^2+z^2=a^2$ is
$$dS = a^2\sin\theta \>d\theta d\phi$$
Thus, the surface integral over the half-sphere for $z>0$ is
$$S =\int_{z>0}F\cdot N \>dS =  a^3\int_0^{\pi/2}\int_0^{2\pi} (1-3\cos^2\theta)\sin\theta \>d\theta d\phi=0
$$
Edit: In Cartesian coordinates, we have $F\cdot N = \frac{3(x^2+y^2)-2a^2}{a}$ and $dS = \frac a{\sqrt{a^2-x^2-y^2}}dxdy$. The surface integral instead is
$$S =\int_{z>0}F\cdot N \>dS =  \int_{z>0} \frac{3(x^2+y^2)-2a^2}{\sqrt{a^2-x^2-y^2}}dxdy=0
$$

For the example: $F=3z\hat i-4\hat j+y\hat k$; $~S:z=1-x-y$ in the first octant. Calculate the unit normal vector and $F\cdot N$,
$$N=\frac{(f_x, f_y, f_z)}{\sqrt{f_x^2+ f_y^2+ f_z^2}}=\frac1{\sqrt3}(1,1,1)$$
$$F\cdot N = (3z,-4,y)\cdot \frac1{\sqrt3}(1,1,1)=\frac1{\sqrt3} (3z-4+y)
=-\frac1{\sqrt3} (1+3x+2y)$$
Then, use the standard surface element formula 
$$dS = \sqrt{1+z_x^2+z_y^2}\>dxdy= \sqrt3 \>dxdy$$
As a result, the integral over the first-octant surface $~S:z=1-x-y$
$$S =\int_{x,y>0}F\cdot N \>dS = -\int_0^1\int_0^{1-x}  (1+3x+2y)dydx=-\frac43
$$
(Note: the flux integrals over axis planes in both examples are relatively straightforward if required.)
A: I will assume that you are somehow familiar with surface integrals of vector fields. In case you are wondering, I am following this book. Let's begin with the second exercise. 
You have a vector field $\mathbf{F} = x \boldsymbol{\hat{\imath}}+ y \boldsymbol{\hat{\jmath}} - 2z \boldsymbol{\hat k}$ and a surface which is a semisphere with radius $a$ and $z \ge 0$.

The first step is to use spherical coordinates because we have a sphere, which means we have to parametrize the surface.
$$\mathbf r (\phi, \theta) = a \sin  \phi \cos \theta \boldsymbol{\hat{\imath}} + a \sin \phi \sin \theta \boldsymbol{\hat{\jmath}} + a \cos \phi\,\boldsymbol{\hat{k}},$$
with $0\le \phi \le \pi/2$ and $0\le \theta \le 2\pi$. Also, with that parametrization, $\mathbf F$ changes:
$$\mathbf{F}(\mathbf r (\phi, \theta)) = a \sin  \phi \cos \theta \boldsymbol{\hat{\imath}} + a \sin \phi \sin \theta \boldsymbol{\hat{\jmath}} - 2 a \cos \phi \, \boldsymbol{\hat{k}}.$$
You might ask: why am I doing this? Because the integral changes:
$$\iint_S \mathbf{F} \cdot \boldsymbol{\hat{n}}\, dS = \iint_D \mathbf{F} (\mathbf r(u, v)) \cdot (\mathbf r_u \times \mathbf r_v) \, dA,$$
with $D$ the domain of the parametrization. By the way, I am just following what you can find in any textbook about surface integrals. As you may see, this is very long because you have to find the cross product of two vectors, $\mathbf r_\phi$ and $\mathbf r_\theta$. You have to be careful because the vector from the cross product should point away from the enclosed surface, in this case, you want $\mathbf r_\phi \times \mathbf r_\theta$.
$$ \mathbf r_\phi \times \mathbf r_\theta = a^2 \sin^2 \phi \cos \theta \boldsymbol{\hat{\imath}} + a^2 \sin^2 \phi \sin \theta \boldsymbol{\hat{\jmath}} + a^2 \sin \phi \cos \phi\, \boldsymbol{\hat{k}}.$$
We are almost there. Now, the dot product:
$$\mathbf F (\mathbf r (\phi, \theta)) \cdot (\mathbf r_\phi \times \mathbf r_\theta) = a^3 \sin^2 \!\phi \cos \theta \sin \theta \cos \phi + a^3 \sin^3 \! \phi \, \sin^2 \! \theta - 2 a^3 \cos^2 \! \phi \sin \phi.$$
And the integral!
$$\int_0^{\pi /2} \! \int_0^{2\pi} (a^3 \sin^2 \!\phi \cos \theta \sin \theta \cos \phi + a^3 \sin^3 \! \phi \, \sin^2 \! \theta - 2 a^3 \cos^2 \! \phi \sin \phi) \,d \theta \, d \phi $$
Did I say this is long? Notice that $dA$ is just $d\phi \, d\theta$ and that we know the limits for $\phi$ and $\theta$. So the result for each integral is:
$$\int_0^{\pi /2} \! \int_0^{2\pi} a^3 \sin^2 \!\phi \cos \theta \sin \theta \cos \phi \, d\theta \, d\phi = 0,$$
$$\int_0^{\pi /2} \! \int_0^{2\pi} a^3 \sin^3 \! \phi \, \sin^2 \! \theta \, d\theta \, d\phi = \dfrac{2}{3}a^3 \pi,$$
$$\int_0^{\pi /2} \! \int_0^{2\pi}2 a^3 \cos^2 \! \phi \sin \phi \,d \theta \, d \phi = \dfrac{4}{3} a^3 \pi.$$
Let's sum everything:
$$\iint_S \mathbf F \cdot d\mathbf S = 0 + \dfrac{2}{3}a^3 \pi - \dfrac{4}{3} a^3 \pi = -\dfrac{2}{3} a^3 \pi.$$
But wait! We have to do the integral for the bottom of the semisphere. The unit vector that points away from the surface is $-\boldsymbol{\hat k}$, so:
$$\iint_S \mathbf F \cdot \boldsymbol{\hat n} \, dS = \iint_S \mathbf F \cdot (-\boldsymbol{\hat k}) \, dS = \iint_S 2z \, dS = 0,$$
because $z=0$ there. As you may see, it is easier if the parametrization is adequate and you don't have to think over and over about $dS$. After all of this, you may ask: is the answer right? Parametrize, the cross product, the integral, there is a lot of information and I could make a mistake, fortunately, there is another way of doing that integral: the divergence theorem. If you are not familiar with it, don't worry. The theorem says:
$$\iint_S \mathbf F \cdot d \mathbf S = \iiint_V \nabla \cdot \mathbf F \, dV,$$
with $V$ the volume of the closed surface. So, let's find the divergence of $\mathbf F$:
$$\nabla \cdot \mathbf F = \dfrac{\partial}{\partial x} x + \dfrac{\partial}{\partial y} y + \dfrac{\partial}{\partial z} (-2z) = 1 + 1 -2 = -1.$$
And:
$$\iiint_V \nabla \cdot \mathbf F \, dV = \iiint_V (-1) \, dV = - \iiint_V dV = -\dfrac{2}{3}\pi a^3.$$
So the answer we found is correct, by the way, $\iiint_V dV$ is the volume of the semisphere. So much easier, right?

Let's do the first exercise. Always plot the surface.

It is a plane, I will parametrize the plane using other variables, $u$ and $v$.
$$\mathbf r(u, v) = u \boldsymbol{\hat{\imath}}+ v \boldsymbol{\hat{\jmath}} + (1- u -v) \boldsymbol{\hat k}.$$
From that, I have to find $\mathbf r_u$ and $\mathbf r_v$ and then the cross product:
$$\mathbf r_u = \dfrac{\partial}{\partial u} u \boldsymbol{\hat{\imath}} + \dfrac{\partial}{\partial u} v \boldsymbol{\hat{\jmath}} + \dfrac{\partial}{\partial u} (1- u- v) \boldsymbol{\hat{k}} = \boldsymbol{\hat{\imath}} - \boldsymbol{\hat{k}},$$
$$\mathbf r_v = \dfrac{\partial}{\partial v} u \boldsymbol{\hat{\imath}} + \dfrac{\partial}{\partial v} v \boldsymbol{\hat{\jmath}} + \dfrac{\partial}{\partial v} (1- u- v) \boldsymbol{\hat{k}} = \boldsymbol{\hat{\jmath}} - \boldsymbol{\hat{k}}.$$
Again, be careful with the cross product, $\mathbf r_u \times \mathbf r_v$ will give you the right vector (it must point away from the enclosed surface).
$$\mathbf r_u \times \mathbf r_v = \boldsymbol{\hat{\imath}} + \boldsymbol{\hat{\jmath}} + \boldsymbol{\hat{k}}.$$
From that parametrization, I have to change $\mathbf F$:
$$ \mathbf F (\mathbf r (u, v)) =  3(1 -u - v) \boldsymbol{\hat{\imath}} - 4\boldsymbol{\hat{\jmath}} + v \, \boldsymbol{\hat{k}},$$
and then the dot product:
$$ \mathbf F (\mathbf r (u, v)) \cdot (\mathbf r_u \times \mathbf r_v) = -1 - 3u -2v.$$
The integral is:
$$\iint_D \mathbf F (\mathbf r (u, v)) \cdot (\mathbf r_u \times \mathbf r_v) \, dA = \iint_D (-1 - 3u -2v)\, dA.$$
We have not talked about the domain $D$, in other words, the limits for $u$ and $v$ ($dA$ is just $du \, dv$). You should draw the plane in the $xy$ plane and you should notice that it is just a line with equation $y = -x + 1$, so $x$ goes from  $0$ to $1$ and $y$ goes from $0$ to $-x + 1$; using that with $u$ and $v$: $0 \le u \le 1$ and $0 \le v \le -u + 1.$ So the first integral is:
$$\int_0^{1} \! \int_0^{-u+1} (-1 -3v -2v)\, dv \, du = -4/3.$$
Remember that this is a closed region, so there are four planes, the plane with equation $z = 1 - x- y$ and the other three are triangles. For examples, for the triangle in the $xz$ plane the unit vector is $-\boldsymbol{\hat \jmath}$, so the integral is:
$$\iint_S \mathbf F \cdot (-\boldsymbol{\hat \jmath})\, dS = \iint_S 4 \, dS = 4 \iint_S dS = 4 \cdot \dfrac{1}{2} = 2. $$
As you see, $\iint_S dS$ is the area of that triangle. The triangle in the $zy$ plane has a unit vector $-\boldsymbol{\hat \imath}$, you should plot the triangle and see the limits for $y$ and $z$:
$$\iint_S \mathbf F \cdot (-\boldsymbol{\hat \imath}) = \iint_S -3z \, dS = -\int_0^{1} \! \int_0^{1- y} 3z \, dz\, dy.$$
The same with the triangle in the $xy$ plane. I will leave the last two integrals to you. Remember that you have to sum the result of those four integrals.
A: The surface element $dS$ in terms of $dxdy$ is always given by 
$$dS = \sqrt{1+\left(\frac{\partial z}{\partial x}\right)^2+\left(\frac{\partial z}{\partial y}\right)^2} dx\, dy.$$ Let me know if you want to know where this comes from.
Here is how you find the boundaries of the integrals in $x$ and $y$:
i) First octant means $x>0$, $y>0$, and $z=1-x-y>0\implies x+y<1$. That is the area inside the triangle below

So you can either do 


*

*horizontal stripes with $y$ from $0$ to $1$ and $x$ from $0$ to $1-y$ 

*or do vertical stripes with $x$ from $0$ to $1$ adn $y$ from $0$ to $1-x$.


ii) Let me clarify before giving what you want that this problem is way easier in polar coordinates (or even better, in spherical coordinates) because your surface is a hemisphere. But since you are asking for converting $dS$ to $dxdy$ I will just do it your way:
The boundary is given by $a^2-x^2-y^2>0 \implies x^2+y^2 < a^2$ which is inside the circle of radius $a$ at the origin. Again you can either do horizontal or vertical stripes:


*

*$y$ from $-a$ to $a$ and $x$ from $-\sqrt{a^2-y^2}$ to $\sqrt{a^2-y^2}$

*or $x$ from $-a$ to $a$ and $y$ from $-\sqrt{a^2-x^2}$ to $-\sqrt{a^2-x^2}$.

