Find the flux of the vector field across the boundary of the cube Find the flux of the vector $F=e^{xy} \hat{i} +e^{yz} \hat{j} +z \hat{k}$ across the boundary of $[0,1] \times [0,1] \times [0,1]$.
Can someone tell me the setup of this problem?
 A: We'll work out this flux integral two different ways: the first time by direct evaluation of the surface integrals $ \ \iint_S \ \mathbf{F} \cdot \mathbf{n} \ \ dS \ $ over each of the six faces of this unit cube in the first octant; the second, by applying the divergence theorem 
$$ \ \iint_S \ \mathbf{F} \cdot \mathbf{n} \ \ dS \ \ = \ \ \iiint_V \ \nabla \cdot \mathbf{F} \ \ dV \ \  $$
over the interior of the cube.
$$ \ \ $$
surface integrations --
This is a bit tedious to write out, although the calculations are fairly simple, because we must produce an integral for each of the six faces of the cube.  The vector field is $ \ \mathbf{F} \ = \ \langle \ e^{xy} \ , \ e^{yz} \ , \ z \ \rangle $ .  For the individual faces of the cube, we have
$$ x \ = \ 0 \ :  \ \ \mathbf{n} \ = \ -\mathbf{i}  \ \ \Rightarrow \ \ \mathbf{F} \cdot \mathbf{n} \ = \ -e^{xy} \ \ \rightarrow \ \ -e^{0 \ \cdot \ y} \ = \ -1 \ \  ; $$
$$ x \ = \ 1 \ :  \ \ \mathbf{n} \ = \ +\mathbf{i}  \ \ \Rightarrow \ \ \mathbf{F} \cdot \mathbf{n} \ = \ e^{xy} \ \ \rightarrow \ \ e^{1 \ \cdot \ y} \ = \ e^y \ \   ; $$
$$ y \ = \ 0 \ :  \ \ \mathbf{n} \ = \ -\mathbf{j}  \ \ \Rightarrow \ \ \mathbf{F} \cdot \mathbf{n} \ = \ -e^{yz} \ \ \rightarrow \ \ -e^{0 \ \cdot \ z} \ = \ -1 \ \    ; $$
$$ y \ = \ 1 \ :  \ \ \mathbf{n} \ = \ +\mathbf{j}  \ \ \Rightarrow \ \ \mathbf{F} \cdot \mathbf{n} \ = \ e^{yz} \ \ \rightarrow \ \ e^{1 \ \cdot \ z} \ = \ e^z \ \   ; $$
$$ z \ = \ 0 \ :  \ \ \mathbf{n} \ = \ -\mathbf{k}  \ \ \Rightarrow \ \ \mathbf{F} \cdot \mathbf{n} \ = \ -z \ \ \rightarrow \ \ 0 \ \    ; $$
$$ z \ = \ 1 \ :  \ \ \mathbf{n} \ = \ +\mathbf{k}  \ \ \Rightarrow \ \ \mathbf{F} \cdot \mathbf{n} \ = \ z \ \ \rightarrow \ \ 1 \ \   , $$
with some amount of simplification of the integrands being possible since one coordinate variable has a fixed value across the entire cube face.
The six integrals are then
$$ x \ = \ 0 \ :  \ \ \int_0^1 \int_0^1 \ ( -1 ) \ \ dy \ dz \ = \ -1 \ \ ; $$
$$ x \ = \ 1 \ :  \ \ \int_0^1 \int_0^1 \ e^y \ \ dy \ dz \  \ = \ \ \int_0^1 \ e^y \ \vert_0^1 \ \  dz  \  \ = \ \ \int_0^1 \  (e \ - \ 1) \ \  dz   $$
$$ = \ \  (e \ - \ 1)  \cdot  z \ \vert_0^1 \ = \ e \ - \ 1 \ \ ;  $$
$$ y \ = \ 0 \ :  \ \ \int_0^1 \int_0^1 \ ( -1 ) \ \ dx \ dz \ = \ -1 \ \ ; $$
$$ y \ = \ 1 \ :  \ \ \int_0^1 \int_0^1 \ e^z \ \ dz \ dx \  \   = \ e \ - \ 1 \ \ ;  $$
$$ z \ = \ 0 \ :  \ \ \int_0^1 \int_0^1 \ 0 \ \ dx \ dy \ = \ 0 \ \ ; $$
$$ z \ = \ 1 \ :  \ \ \int_0^1 \int_0^1 \ 1 \ \ dx \ dy \  \ = \  1 \ \ ,  $$
four of the integrals simply being a constant evaluated over the area of a unit square, and the $ \ y = 1 \ $ surface integral is computed in a manner analogous to that for the $ \ x = 1 \ $ integral.  The total flux is thus 
$$ \ (-1) \ + \ ( e \ - \ 1 ) \ +  \ (-1) \ + \ ( e \ - \ 1 ) \ + \ 1 \ = \ 2e \ - \ 3 \ \ . $$ 
$$ \ \ $$
volume integration --
I am showing this calculation because it turns out that the order of integration must be handled somewhat carefully to avoid producing non-elementary integrals.  The divergence of the vector field is 
$$ \nabla \cdot \mathbf{F} \ = \ \frac{\partial}{\partial x} [e^{xy}] \ + \  \frac{\partial}{\partial y} [e^{yz}] \ + \ \frac{\partial}{\partial z} [z] \ = \ y \ e^{xy} \ + \ z \ e^{yz} \ + \ 1 \ \ . $$
It would seem that we could write 
$$ \ \int_0^1  \int_0^1 \int_0^1 \ ( \ y \ e^{xy} \ + \ z \ e^{yz} \ + \ 1 \ ) \ \ dx \ dy \ dz $$
and immediately set to evaluating it, but in fact the first two terms will cause us some difficulties if we don't arrange the integrations just so.  Instead we will break this into a sum of three volume integrals, the last of which is very easy:
$$  \int_0^1  \int_0^1 \int_0^1 \  \ y \ e^{xy}  \ \ dz \ dy \ dx \ \ = \ \ \int_0^1  \int_0^1  \   yz \ e^{xy} \ \vert_{z=0}^{z=1}  \ \  dy \ dx \ \ = \ \ \int_0^1  \int_0^1  \   y \ e^{xy}   \ \  dy \ dx $$
$$ = \ \ \int_0^1    \    e^{xy} \ \vert_{y=0}^{y=1}   \ \   dx  \ \ = \ \ \int_0^1    \   ( \ e^{x \ \cdot \ 1} \ - \ e^{x \ \cdot \ 0} \ )  \ \   dx \ \ = \ \ \int_0^1    \   e^x \  - \ 1  \ \   dx $$
$$ = \ ( \ e^x \ - \ x \ ) \ \vert_{x=0}^{x=1} \ = \ ( e^1 - 1 ) \ - \ (e^0 - 0 ) \ = \ e \ - \ 2 \ \ ; $$
$$  \int_0^1  \int_0^1 \int_0^1 \  z \ e^{yz}  \ \ dx \ dz \ dy \ \ = \ \ \int_0^1  \int_0^1  \   xz \ e^{yz} \ \vert_{x=0}^{x=1}  \ \  dz \ dy \ \ = \ \ \int_0^1  \int_0^1  \   z \ e^{yz}   \ \  dz \ dy  $$
$$  = \ \ \int_0^1    \    e^{yz} \ \vert_{z=0}^{z=1}   \ \   dy \ \ = \ \ \ldots  \ = \ e \ - \ 2 \ \ ; $$
$$  \int_0^1  \int_0^1 \int_0^1 \  1  \ \ dx \ dy \ dz \ = \ 1 \ \ , $$
this last integral simply being a constant evaluated over the volume of the unit cube.  The total flux is again found to be $ \ (e - 2) \ + \ (e - 2) \ + \ 1 \ = \ 2e \ - \ 3 \ \ $ .
A: By the divergence theorem,
$\int_0^1 \int_0^1 \int_0^1 ye^{xy}+ze^{yz}+1 dzdydx$
