# Compute Flux (Divergence Theorem)

Given that $\textbf{F} = \langle x\cos^2z, y\sin^2z, \sqrt{x^2+y^2}\:z \rangle$ and let E be the solid cone above the $xy$-plane and inside z = $1 -\sqrt{x^2+y^2}.$

I'm trying to use the divergence theorem to compute the flux. $$\iint_{D} \textbf{F} \cdot \textbf{N} \: dS = \iiint_E \nabla \cdot \textbf{F}\:d\textbf{V}$$

Attempt:

$$\text{div}\textbf{F} \:=\: \nabla \cdot \textbf{F} =\cos^2z + \sin^2z + \sqrt{x^2+y^2} \: = z + r \:$$

Since solid cone is above the $xy$-plane, $\text{z} \ge 0$ and $z = 1-\sqrt{x^2+y^2} = 1-r$. Hence $0 \le \text{z} \le 1-r$. Is this bound right for z?

\begin{align*} \iiint_E \nabla \cdot \textbf{F}\:d\textbf{V} &= \int_0^{2\pi} \int_0^{1} \int_0^{1-r} (z+r) r\: dz\: dr\: d\theta \\ &= 2\pi \int_0^{1} \left(\frac{z^2r}{2} + r^2z\right)\bigg\rvert_0^{1-r} dr \\ &= 2\pi \cdot \frac{1}{2} \int_0^1 r-r^3\, dr \\ &= \pi \left(\frac{r^2}{2}-\frac{r^4}{4}\right)\bigg\rvert_0^1 \\ &= \frac{\pi}{4}. \end{align*}

The answer given was $\frac{\pi}{2}.\:$ Perhaps I'm doing something wrong. One thing that I'm not sure of is picturing the surface that they're looking for. Also, not sure if my bounds are right. Where am I going wrong here? Would appreciate some help! Thank you.

Since $\cos^2z + \sin^2z = 1$, you must have $\nabla \cdot \mathbf{F} = 1+r$. In this case, your integral becomes $$\iiint_E\nabla \cdot \mathbf{F} \, \mathrm{d}V = \int_0^{2\pi} \int_0^1 \int_0^{1-r} (1+r)r\, \mathrm{d}z\, \mathrm{d}r\, \mathrm{d}\theta = \frac{\pi}{2}.$$