Refer to the diagram shown below.
The outward normal to the cylindrical surface is [tex]\hat{n}[/tex].
The given vector field is
[tex]\vec{f} = x\hat{i} + y\hat{j}+z\hat{k}[/tex]
The flux of the vector field is the surface integral
[tex] \phi = \int _{A} ( \vec{f}.\hat{n} )\, dA[/tex]
From the Gauss Divergence Theorem, the surface integral is converted into a volume integral as
[tex]\phi = \int_{V} \, (\bigtriangledown . \vec{f} ) \, dV[/tex]
Note that
[tex]dV = \pi (1^2)dx = \pi dx \\ \bigtriangledown .\vec{f} = 1+1+1 = 3[/tex]
Therefore
[tex]\phi = \int_{-1}^{1} 3 \pi dx = 3 \pi (2) = 6 \pi [/tex]
Answer: [tex]6 \pi [/tex]