<s>[INST] 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?
 [/INST] 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.)
</s>