(* We verify Gauss' Theorem for the cylinder with radius R standing on top of the origin *)

F={x+z,y,z^2}
R=3
H=2

(* parametrization of side *)
r={R Cos[u],R Sin[u],v}
ru=D[r,u]
rv=D[r,v]
n=Simplify[Cross[ru,rv]]

(* Flux through side *)
FOr=F/.{x->r[[1]],y->r[[2]],z->r[[3]]}
Simplify[Dot[FOr,n]]
Integrate[%,{u,0,2 Pi}]
I1=Integrate[%,{v,0,H}]

(* parametrization of top *)
r={v Cos[u],v Sin[u],H}
ru=D[r,u]
rv=D[r,v]
n=Simplify[Cross[rv,ru]]

(* Flux through top *)
FOr=F/.{x->r[[1]],y->r[[2]],z->r[[3]]}
Dot[FOr,n]
Integrate[%,{u,0,2 Pi}]
I2=Integrate[%,{v,0,R}]

(* parametrization of bottom *)
r={v Cos[u],v Sin[u],0}
ru=D[r,u]
rv=D[r,v]
n=Simplify[Cross[ru,rv]]

(* Flux through bottom *)
FOr=F/.{x->r[[1]],y->r[[2]],z->r[[3]]}
Dot[FOr,n]
Integrate[%,{u,0,2 Pi}]
I3=Integrate[%,{v,0,R}]

(* Total flux *)
I1+I2+I3

(* Triple integral using cylindrical coordinates *)
r={v Cos[u],v Sin[u],w}
rp=D[r,{{u,v,w}}];MatrixForm[rp]
Jac=Abs[Simplify[Det[rp],a]]
dF=Div[F,{x,y,z}]
dFOr=dF/.{x->r[[1]],y->r[[2]],z->r[[3]]}
Integrate[dFOr Jac,{u,0,2 Pi}]
Integrate[%,{v,0,R}]
Integrate[%,{w,0,H}]