__Concept:__

**Gauss’s law**

It states that flux leaving any closed surface is equal to the charge enclosed by that surface.

\({\rm{\Psi }} = \oint \vec D.d\vec S\)

The Divergence theorem states that the surface integral can be converted into the volume integral.

\(\oint \vec D.d\vec S = \smallint \left( {\nabla .\vec D} \right)dV\)

Divergence in cylindrical form for the given vector is:

\(\nabla .\vec D = \frac{1}{\rho }\frac{\partial }{{\partial \rho }}\left( {\rho {D_\rho }} \right) + \frac{1}{\rho }\frac{\partial }{{\partial \phi }}\left( {{D_\phi }} \right) + \frac{\partial }{{\partial z}}\left( {{D_z}} \right)\)

__Calculation:__

A given vector field is:

D = ρ cos^{2}ϕ a_{ρ }+ z^{2}sin^{2}ϕ a_{ϕ }

From the given vector D_{z} = 0

\(\nabla .\vec D = \frac{1}{\rho }\frac{\partial }{{\partial \rho }}\left( {{\rho ^2}{{\cos }^2}\phi } \right) + \frac{1}{\rho }\frac{\partial }{{\partial \phi }}\left( {{z^2}{{\sin }^2}\phi } \right) + \frac{\partial }{{\partial z}}\left( 0 \right)\)

\(\nabla .\vec D = 2{\cos ^2}\phi + \frac{{{z^2}}}{\rho }2sin\phi cos\phi \)

\(\smallint \left( {\nabla .\vec D} \right)dV = \)

\(\mathop {\mathop{{\int\!\!\!\!\!\int\!\!\!\!\!\int\int\int}\mkern-31.2mu } {} }\limits_{\phi = 0,\rho = 0,z = 0}^{\phi = 2π ,\rho = 3,z = 2} \left( {2{{\cos }^2}\phi + \frac{{{z^2}}}{\rho }2sin\phi cos\phi } \right)\rho d\rho d\phi dz\)

\(= \mathop {\mathop{{\int\!\!\!\!\!\int\!\!\!\!\!\int}\mkern-31.2mu } {} }\limits_{\phi = 0,\rho = 0,z = 0}^{\phi = 2π ,\rho = 3,z = 2} \left( {2{{\cos }^2}\phi } \right)\rho d\rho d\phi dz \)

\(+~~ \mathop {\mathop{{\int\!\!\!\!\!\int\!\!\!\!\!\int}\mkern-31.2mu } {} }\limits_{\phi = 0,\rho = 0,z = 0}^{\phi = 2π ,\rho = 3,z = 2} \left( {\frac{{{z^2}}}{\rho }2sin\phi cos\phi } \right)\rho d\rho d\phi dz\)

\( = 2\left[ {\frac{{{\rho ^2}}}{2}} \right]_0^3\left[ z \right]_0^2\mathop \smallint \limits_{\phi = 0}^{2π } {\cos ^2}\phi d\phi + \left[ { - \frac{{cos2\phi }}{2}} \right]_0^{2π }\mathop \int\!\!\!\int \limits_{\rho = 0,z = 0}^{\rho = 3,z = 2} {z^2}d\rho dz\)

\( = 9 \times 2\left\{ {\left[ {\frac{\phi }{2}} \right]_0^{2π } + \left[ {\frac{{sin2\phi }}{4}} \right]_0^{2π }} \right\} \)

\(+ \frac{1}{2}\left[ { - cos4π - \left( { - cos0^\circ } \right)} \right]\mathop \int\!\!\!\int \limits_{\rho = 0,z = 0}^{\rho = 3,z = 2} {z^2}d\rho dz\)

= 18 π = 56.54

Flux leaving through the surface is

**56.54**