Here's the problem: Let $G(x,y,z)= \langle x+\cos z,y+y\sin x,z+\cos y-z\sin x\rangle$. Compute the surface integral $\int\int_SG\cdot ds$ where $S$ is the boundary of the solid which is inside the cylinder $x^2+y^2=4$ bounded above by the plane $z=x$ and below by the $xy$-plane.
First, I got $\mathrm{div} G=3$ Then my integral was structured as so: \begin{eqnarray*} \int_{-\pi/2}^{\pi/2}\int_0^2\int_{-r\cos\theta}^0 3r~\mathrm dz~\mathrm dr~\mathrm d\theta &=& \int_{-\pi/2}^{\pi/2}\int_0^2 3r^2\cos\theta~\mathrm dr~\mathrm d\theta \\ \\ &=& [2^3][\sin(\pi/2)-(-\sin(\pi/2))] \\ \\ &=&2^3\cdot2=16 \end{eqnarray*}
Is this correct, or am I missing something?
Yep, you're answer is completely right. Usually however, the divergence theorem is used when you don't want to explicitly solve the integral $\iint_S G \cdot ds$. In this case, you would say $$\iint_S G \cdot ds = \iiint_V \mbox{div}(G) \, dV $$ You were correct in finding $$\mbox{div}(G)=\bigg(\frac{\partial}{\partial x}x+\cos(z)\bigg)+\bigg(\frac{\partial}{\partial y}y+y\sin(x)\bigg)+\bigg(\frac{\partial}{\partial z}z+\cos(y)-z\sin(x)\bigg)=3$$ So our equation now becomes $$\iint_S G \cdot ds = \iiint_V 3 \, dV$$ It's easier to write the bounds in cylindrical coordinates, so doing that (and remembering to include the extra $r$ term) yeilds \begin{aligned} \iint_S G \cdot ds &= \int_{-\frac{\pi}{2}}^{\frac{\pi}{2}} \int_{0}^{2} \int_{0}^{r\cos(\theta)} 3r \, dz \,dr \, d\theta \\ &=16 \end{aligned} Which is what you concluded from your work.