Vector Analysis Flux question using divergence theorem, trouble understanding the vector field Let $S$ be the curve cylindrical surface $x^2+y^2=a^2$ for $0 \leq z \leq 2a$. 
Calculate flux of the of $\displaystyle \int \vec{r} \cdot \vec{ds}$ over $S$ directly and also verify the answer using the divergence theorem. 
I normally know how to set these up but im not sure what $\vec{r}$ is? Any help would be much appreciated
 A: Well if we want to calculate the total flux of $\mathbf{F}=x\mathbf{i}+y\mathbf{j}+z\mathbf{k} $ outward the cylinder (If I understand this correctly...) then:
Top part of cylinder is a disk. There $z=2a$, normal field is $\hat{\mathbf{N}}=\mathbf{k}$ and the surface element $dS=r dr d\phi$. Then flux is
$$\int\int_{top} \mathbf{F} \cdot \hat{\mathbf{N}}dS =2a\int_0^{2\pi} d\phi \int_0^ar dr =  2\pi a^3$$
On the bottom of the disk $z=0$, $\hat{\mathbf{N}}=-\mathbf{k}$ and $dS=r dr d\phi$. $\mathbf{F} \cdot \hat{\mathbf{N}}=-z=0$ so the flux out of the bottom part is zero
$$\int\int_{bottom} \mathbf{F} \cdot \hat{\mathbf{N}}dS=0$$
At the cylinder wall $\mathbf{F}=a\cos \phi\mathbf{i}+a\sin\phi\mathbf{j}+z\mathbf{k}$, $\hat{\mathbf{N}}=\cos\phi \mathbf{i}+\sin\phi\mathbf{i}$ and $dS=ad\phi dz$. Flux is
$$\int\int_{wall} \mathbf{F} \cdot \hat{\mathbf{N}}dS =a^2\int_0^{2\pi} \overbrace{(\cos^2\phi+\sin^2\phi)}^{1} d\phi \int_0^{2a}  dz =  4\pi a^3$$
So the total flux is sum of these components:
$$\int \int_{total}\mathbf{F} \cdot \hat{\mathbf{N}}dS=2\pi a^3 + 0 +4\pi a^3 =6\pi a^3$$
And verification with divergence theorem
$$\int \int_{total}\mathbf{F} \cdot \hat{\mathbf{N}}dS =\int\int\int \overbrace{\text{div}\mathbf{F}}^{3} dV =3\int_0^{2\pi}d\phi \int_0^{a}rdr\int_0^{2a}dz=6\pi a^3$$
