By the divergence theorem,
[tex]\displaystyle\iint_{\mathcal S}\mathbf f\cdot\mathrm d\mathbf S=\iiint_{\mathcal R}\nabla\cdot\mathbf f\,\mathrm dV[/tex]
where [tex]\mathcal R[/tex] is the 3-dimensional space with boundary [tex]\mathcal S[/tex]. We have
[tex]\mathbf f(x,y,z)=(\cos z+xy^2)\,\mathbf i+xe^{-z}\,\mathbf j+(\sin y+x^2z)\,\mathbf k[/tex]
[tex]\implies\nabla\cdot\mathbf f=\dfrac{\partial(\cos z+xy^2)}{\partial x}+\dfrac{\partial(xe^{-z})}{\partial y}+\dfrac{\partial(\sin y+x^2z)}{\partial z}=y^2+x^2[/tex]
So the flux is given by
[tex]\displaystyle\iiint_{\mathcal R}(x^2+y^2)\,\mathrm dx\,\mathrm dy\,\mathrm dz[/tex]
Converting to cylindrical coordinates lets us compute the following integral:
[tex]\displaystyle\int_{\theta=0}^{\theta=2\pi}\int_{r=0}^{r=3}\int_{z=r^2}^{z=9}r^3\,\mathrm dz\,\mathrm dr\,\mathrm d\theta[/tex]
and the flux is then
[tex]\displaystyle2\pi\int_{r=0}^{r=1}r^3(9-r^2)\,\mathrm dr=\frac{243\pi}2[/tex]