$\require{HMacros}$ $\require{eqn-number}$
$\require{HMacros}$ $\require{eqn-number}$
Recall Gauss' Law, which says that \begin{eqnarray*} \oint_{\hbox{box}} \EE \cdot d\AA = {1\over\epsilon_0} \, Q_{\hbox{inside}} \end{eqnarray*} Consider the example of a point charge inside an imaginary sphere of radius $r$. The electric field due to the charge is \begin{eqnarray*} \EE = {1\over4\pi\epsilon_0} {q\over r^2}\, \rhat \end{eqnarray*} and the surface element is \begin{eqnarray*} d\AA = r^2 \sin\theta \,d\theta\,d\phi\,\rhat \end{eqnarray*} Thus, the flux is given by \begin{eqnarray*} \Int_{\hbox{sphere}} \EE \cdot d\AA &=& \Int_{\hbox{sphere}} {1\over4\pi\epsilon_0} {q\,\rhat\over r^2} \cdot \rhat\,dA \\ &=& {1\over4\pi\epsilon_0} {q\over r^2} \times (\hbox{surface area}) \\ &=& {q\over\epsilon_0} \end{eqnarray*} as claimed. Note that the value of this integral does not depend on the radius $r$ of the spherical box.